|
Tim: Haven't tried this, but haven't seen other replies either, so, maybe like... d presarray * d resarray ds based( presarray ) occurs(32767) d field1 5 0 d field2 15 d field3 9 2 Then, when you know the value of i, alloc as much space as needed while referencing the presarray pointer. When finished, dealloc the space. Shouldn't matter if your occurs() specifies the maximum since it shouldn't actually reserve the space. Just take care not to overstep your alloc'd area. Tom Liotta rpg400-l-request@xxxxxxxxxxxx wrote: > 6. Another Question / Stored procedure w/result set. > (Hatzenbeler, Tim) >------------------------------ > >message: 6 >date: Wed, 20 Aug 2003 11:32:58 -0700 >from: "Hatzenbeler, Tim" <thatzenbeler@xxxxxxxxxxxxx> >subject: Another Question / Stored procedure w/result set. > >Using a simple example... I was wondering if there was a way to handle >unknow amount of records I would like to send back via a result set? > >Currently, I define a DS with a size. > >/* create the result set. >d resarray ds occurs(9999) >d field1 5 0 >d field2 15 >d field3 9 2 > >I know, a DS can have a lot of entries, 9999 entries, but what if I need >20,000 rows returned? Is there a way to append a DS entry on to the current >result set, instead of filling the whole result set at one time? > >**** fill 5 DS with data... > >c eval i = 5 >/* >c/exec sql >c+ set result sets array :resarray for :i rows >c/end-exec > >************* But I would rather have it work like this... ****** > >1. read a record >2. load a simple one record DS >3 append DS to result set. >4. goto 1 > >Is this possible? Thanks, tim -- Tom Liotta The PowerTech Group, Inc. 19426 68th Avenue South Kent, WA 98032 Phone 253-872-7788 x313 Fax 253-872-7904 http://www.powertechgroup.com __________________________________________________________________ McAfee VirusScan Online from the Netscape Network. Comprehensive protection for your entire computer. Get your free trial today! http://channels.netscape.com/ns/computing/mcafee/index.jsp?promo=393397 Get AOL Instant Messenger 5.1 free of charge. Download Now! http://aim.aol.com/aimnew/Aim/register.adp?promo=380455
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.