|
Take a look at chapter 8 of the SQL programming book. I think this has also been discussed here before. Try searching the achieves on "dynamic sql" or "SQLDA". Matt -----Original Message----- From: SRamanujan@xxxxxxxxxxxxxxxxxx [mailto:SRamanujan@xxxxxxxxxxxxxxxxxx] Sent: Tuesday, August 24, 2004 10:24 AM To: rpg400-l@xxxxxxxxxxxx Subject: RE: %elem Thanks for this link. It is very informative. I was actually trying to write a routine to go through each sub-field of an array when the array is defined as an extname. I was trying to write a generic routine to which I could pass the file name which will get referred in the extname (inputfilename). Since this was a copy book, I could open the source and replace the file name. So I can do the fetch filecursor into fileDs. I got everything to work except, I could not read from the data structure since I did not know the name of the sub-fields. I was just wondering if like in java, where we can read through ResultSet till it ends and get all the column we need, could we do the same thing like: Java: while (rs.next()) i=1; // loop through every field in this record. for(i=1; i <= colcount; i++){ data[i-1] = rs.getString(i); out.println("<TD>" + data[i-1] + " </TD>"); } } SQLRPGLE: for i= 1 to %size(fileDs) For y=%elem(fileDs) down to 1 <Get the fields from fileDs> endfor endfor This is not a show stopper since I can write a java code for this, but am just curious to know if there is something out there that I can use. Perhaps a base pointer to the ds and read *next? Thanks, Sudha Sudha Ramanujan SunGard Futures Systems sramanujan@xxxxxxxxxxxxxxxxxx (312) 577 6179 (312) 577 6101 - Fax -----Original Message----- From: Jon Paris [mailto:Jon.Paris@xxxxxxxxxxxxxx] Sent: Saturday, August 21, 2004 1:50 PM To: rpg400-l@xxxxxxxxxxxx Subject: RE: %elem It is really difficult to tell what you are trying to do but _if_ what you are attempting is to treat a series of input fields as an array you may find the information in this article of interest. http://www.eservercomputing.com/iseries/articles/index.asp?id=553 If that is not what you want to do, I'm afraid you'll have to explain yourself a little more. Jon Paris Partner400 www.Partner400.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. -- 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-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.