for the insert you *should* be able to do something along the lines of
mystatement = 'INSERT INTO MYLIB/MYFILE (SELECT A.*, ''' + MYFILENAME +
''' FROM ' + %TRIM(MYNEWLIB) + '/' %TRIM(MYNEWFILE) + ' A UNION ALL SELECT
B.*, ''' +
MYOTHERFILENAME + ''' FROM ' + %TRIM(MYOTHERLIB) + '/' +
%TRIM(MYOTHERFILE) + ' B )';

exec sql execute immediate :mystatement;


Thanks,
Tommy Holden



From: "Dennis Lovelady" <iseries@xxxxxxxxxxxx>
To: "'Midrange Systems Technical Discussion'"
<midrange-l@xxxxxxxxxxxx>
Date: 03/16/2010 08:51 AM
Subject: RE: Select mytable name from mytable?
Sent by: midrange-l-bounces@xxxxxxxxxxxx



what exactly would make it fail on the first rename when you are
building
the INSERT on the fly? here is a sample program i wrote years ago that
does this type of thing and haven't had a problem ever...

Nothing at all (I'll look at the program later; thanks). But since data
tends to persist in files, whatever data was in there before the rename is
now misrepresenting the file in which it resides. That is unless you also
update all data when you rename. But there's no system constraint to
ensure
that you'll do that, is there?

Dennis Lovelady
http://www.linkedin.com/in/dennislovelady
--
"I wasn't kissing her, I was whispering in her mouth."
-- Chico Marx




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.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 on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.