|
Cool, I'll have to keep that in mind. I'd recommend a comment or two around that just to reiterate the fact that the RRN field gets included in the DS. I for one certainly wouldn't expect such a thing. Charles > -----Original Message----- > From: Ben_Pforsich@xxxxxxxxxxxx [mailto:Ben_Pforsich@xxxxxxxxxxxx] > Sent: Tuesday, August 17, 2004 3:08 PM > To: RPG programming on the AS400 / iSeries > Subject: RE: Can SQL recognize a nested data structure? > > > > > > > > I think I figured it out... I didn't need to create a nested > data structure > after all. I simply added the field I needed for RRN at the > END of the > external data structure: > > d JPP010 e ds occurs(10) > d RRN 10s 0 > > Then I just switched the order I selected the fields in SQL: > > c/exec SQL > c+ declare C1 cursor for > c+ select A.*, rrn(A) > c+ from JRP010 A > c+ where R1COM = :Company and R1IYR * 100 + R1IWK between > c+ :FromIYRIWK and :ToIYRIWK > c/end-exec > > And it works when fetch into the data structure JPP010 like I > wanted it to. > SQLER3 returns the # of records actually fetched. I guess I > just assumed I > needed something complex... > > > > > >
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.