Re: rpgle, pcml & arrays
- From: "Tim M" <scott1328@xxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 5 Mar 2008 17:55:57 -0600
"Eric Masson" <emss@xxxxxxx> wrote in message
news:fm32a5-qnv1.ln1@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hello,
I'd like to create rpgle code that would return an unbounded array
(list
of PF records which size isn't known when calling).
From different readings, it seems I'll have to mess with dynamic
memory
allocation (user heap or Alloc/Realloc/Dealloc).
If the program allocates memory on demand to store the array, fills it
and then returns, I suppose memory leaks will happen, no ?
Is there any simple way to proceed except by providing 3 procedures :
- first one returns records (bounded by maximum allocation limits)
- second one returns next records (bounded by maximum allocation
limits)
and will eventually get called until no more records are returned
- third one cleanups memory allocations.
Last but not least, if these procedures are exposed via iSeries Web
Services Server (SI30196), is the context (memory allocation and file
pointers) preserved beetween each call ?
Regards
Éric Masson
--
NC> J'ai perdu tous mes messages reçus, alors, je n'ai plus ton nom.
BB>Curieux chez l'utilisateur d'OE 5 cette manie de perdre les
messages
Mais non, c'est une des principales caracteristiques d'Outlook
Express,
-+-RG in <http://www.le-gnu.net> : La cuisine au bug -+-
SQL provides a way for a stored procedure to return a result set. You
can construct result set from a query or
from an array.
look at the SET RESULT SETS FOR CURSOR statement.
You can use this in a stored procedure written in a HLL using embedded
SQL or in
a store procedure in SQL stored procedure statements.
.
- Follow-Ups:
- Re: rpgle, pcml & arrays
- From: Eric Masson
- Re: rpgle, pcml & arrays
- References:
- rpgle, pcml & arrays
- From: Eric Masson
- rpgle, pcml & arrays
- Prev by Date: Creating a command [WAS: Creazione di un comando]
- Next by Date: Tape Compatiblily
- Previous by thread: Re: rpgle, pcml & arrays
- Next by thread: Re: rpgle, pcml & arrays
- Index(es):
Relevant Pages
|