|
Yes, you can fetch into an externally defined data structure with the *. I
-think- that a potential problem -may- occur. If you modify the structure
of your file by adding columns, and do -not- recompile your program then I
think that this may generate a severe error. On earlier versions of
OS/400 it was no big deal. However I think IBM got quite picky on this on
a particular release.
hmmm...
Just for you Dan I created this simple file and program:
CREATE TABLE ROB/DAN01 (FIELD1 CHAR (10 ) NOT NULL WITH DEFAULT,
FIELD2 CHAR (10 ) NOT NULL WITH DEFAULT)
and added a row
...
D Dan01ds e ds extname(dan01)
C* SQL's version of an H spec
C/EXEC SQL
C+ Set Option
C+ Naming = *Sys,
C+ Commit = *None,
C+ UsrPrf = *User,
C+ DynUsrPrf = *User
C/END-EXEC
C/EXEC SQL
C+ select * into :dan01ds
C+ from dan01
C/END-EXEC
/free
dsply sqlstt;
*inlr=*on;
return;
/end-free
sqlstt was 00000
Then I did this:
ALTER TABLE ROB/DAN01 ADD COLUMN FIELD3 CHAR (10 ) NOT NULL WITH DEFAULT
and ran DAN01 again. Again sqlstt was 00000.
I must have misread something somewhere.
Rob Berendt
--
"They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety."
Benjamin Franklin
Dan <dbcerpg@xxxxxxxxx>
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
04/08/2003 12:19 PM
Please respond to RPG programming on the AS400 / iSeries
To: rpg400-l@xxxxxxxxxxxx
cc:
Fax to:
Subject: SQLRPG - Fetch Into a record format?
Doing the SQL thing again. If I do a "Select *", is there a way to
"Fetch" into a record format
or a data structure which is externally defined as the file being fetched?
__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://tax.yahoo.com
_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.