This is what I have been doing :-) Trying to learn more SQL.
Thanks again.
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Stone, Joel
Sent: Wednesday, December 05, 2012 2:33 PM
To: 'Midrange Systems Technical Discussion'
Subject: RE: Another SQL Question
Did you mean withOUT naming all of the fields?
Sure you can!
Will this work?
CPYF FROMFILE(*LIBL/myFile) TOFILE(QTEMP/myFile) FROMRCD(1)
MBROPT(*REPLACE) CRTFILE(*YES)
Runsql 'UPDATE qtemp/myfile set company# = ''2'''
CPYF FROMFILE(QTEMP/myFile) TOFILE(*LIBL/myFile) FROMRCD(1) MBROPT(*add)
Should do the trick.
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of JackTucky
Sent: Wednesday, December 05, 2012 12:50 PM
To: 'Midrange Systems Technical Discussion'
Subject: RE: Another SQL Question
Yes. I thought I could get away with naming all of the fields.
Thanks
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of rob@xxxxxxxxx
Sent: Wednesday, December 05, 2012 1:39 PM
To: Midrange Systems Technical Discussion
Subject: Re: Another SQL Question
You mean like
INSERT INTO MYTABLE
(select 2, colb, colc, cold, cole, colf, colg from mytable)
Rob Berendt
--
IBM Certified System Administrator - IBM i 6.1 Group Dekko Dept 1600 Mail
to: 2505 Dekko Drive
Garrett, IN 46738
Ship to: Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com
From: "JackTucky" <jacktucky@xxxxxxxxx>
To: <midrange-l@xxxxxxxxxxxx>,
Date: 12/05/2012 01:26 PM
Subject: Another SQL Question
Sent by: midrange-l-bounces@xxxxxxxxxxxx
I have several different files that all contain a company#. I want to use
SQL to write a new record for every record in the file but change the
company number to 2. All of the other fields remain the same.
I know it's possible but I'm having a hard time googling. I'm guessing
I
need an insert into with another select?
Thanks, Jack.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe,
or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at
http://archive.midrange.com/midrange-l.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe,
or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at
http://archive.midrange.com/midrange-l.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe,
or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at
http://archive.midrange.com/midrange-l.
________________________________________________________________________
This inbound email has been scanned for all viruses by the MessageLabs
SkyScan
service.
________________________________________________________________________
______________________________________________________________________
This outbound email has been scanned for all viruses by the MessageLabs
Skyscan service.
For more information please visit
http://www.symanteccloud.com
______________________________________________________________________
As an Amazon Associate we earn from qualifying purchases.