MIDRANGE dot COM Mailing List Archive



Home » MIDRANGE-L » December 2012

Re: Another SQL Question



fixed

Well, you can do the same thing with SQL:

INSERT INTO NEWFILE (SELECT * FROM MYFILE);

UPDATE NEWFILE SET company# = '2';

INSERT INTO MYFILE (SELECT * FROM NEWFILE);

:-))


Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx> writes:
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.


Mike Naughton
Senior Programmer/Analyst
Judd Wire, Inc.
124 Turnpike Road
Turners Falls, MA 01376
413-676-3144
Internal: x 444
mnaughton@xxxxxxxxxxxx
****************************************
NOTICE: This e-mail and any files transmitted with it are confidential and solely for the use of the intended recipient. If you are not the intended recipient or the person responsible for delivering to the intended recipient, be advised that any use is
strictly prohibited. If you have received this e-mail in error, please notify us immediately by replying to it and then delete it from your computer.






Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2014 by MIDRANGE dot COM and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available here. If you have questions about this, please contact