× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Thank you for your idea, and I was thinking about something similar.  But
what I was really fishing for, was there a way to use sql cursor commands to
append data into the result set, I was hoping to get away from allocating or
reallocating datastructures, as my result set grew...  

My real desire was to have my program work this way...
1  crystal reports, refreshes a report and calls my stored procedure, and
awaits for my result set.
2. have my rpg/stored procedure, while accumlating the records, it woould
append them into the result set, that way, crystal could be downloading the
data at the same time, my rpg program is populating the data, instead of
having to wait for the rpg program to finish, and then populate the result
set.

Tim
  

> -----Original Message-----
> From: qsrvbas@xxxxxxxxxxxx [SMTP:qsrvbas@xxxxxxxxxxxx]
> Sent: Wednesday, August 20, 2003 4:10 PM
> To:   rpg400-l@xxxxxxxxxxxx
> Subject:      RE: Another Question / Stored procedure w/result set.
> 
> 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
> _______________________________________________
> 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 e-mail message, including any attachments, is for the sole use of the
intended recipient(s) and may contain confidential or privileged
information.  Any unauthorized review, use, disclosure or distribution is
prohibited.  If you are not the intended recipient, please contact the
sender by reply e-mail and destroy the message.

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.