Re: stored procedure having an arrays as parameter (IDS 9.40)
Posted in 2009
Topics: Stored Procedures & SPL, Versions, Editions & End-of-Life
Good to know. That's why I couldn't find anything about it. By the way do the newer IDS versions support arrays as parameters? 2009/3/20 Art Kagel <art.kagel@gmail.com>: > > No, no arrays. Use a temp table or a permanent staging table to pass the > array of values instead. If you use a temp table the procedure will > recompile itself each time it is run (as the table didn't exist at compile > time). If you use a permanent staging table that problem goes away. You > can use the session_id as a key to the rows in the staging table that belong > to the particular function call for a session. > > Art > > On Fri, Mar 20, 2009 at 3:43 PM, Gentian Hila <genti.tech@gmail.com> wrote: >> >> Is it possible to have a stored procedure in IDS 9.40 that accepts an >> array as parameter? >> >> If so how can it be declared and how can it be accessed in the body of >> the stored procedure. >> >> >> Thank you very much. >> _______________________________________________ >> Informix-list mailing list >> Informix-list@iiug.org >> http://www.iiug.org/mailman/listinfo/informix-list > > -- > Art S. Kagel > Oninit (www.oninit.com) > IIUG Board of Directors (art@iiug.org) > > Disclaimer: Please keep in mind that my own opinions are my own opinions and > do not reflect on my employer, Oninit, the IIUG, nor any other organization > with which I am associated either explicitly or implicitly. Neither do > those opinions reflect those of other individuals affiliated with any entity > with which I am affiliated nor those of the entities themselves. > > > _______________________________________________ > Informix-list mailing list > Informix-list@iiug.org > http://www.iiug.org/mailman/listinfo/informix-list > >
I disagree: collections work just fine :-) For example:
CREATE PROCEDURE multiset_count(data MULTISET(INT NOT NULL))
RETURNING INT AS value;
DEFINE value INT;
FOREACH SELECT * INTO value FROM TABLE(data)
RETURN value WITH RESUME;
END FOREACH
END PROCEDURE;
EXECUTE PROCEDURE multiset_count('MULTISET{1,2,3,4}');
Regards,
Doug
"Gentian Hila" <genti.tech@gmail.com> wrote in message
news:mailman.406.1237591903.1831.informix-list@iiug.org...
>
> Good to know. That's why I couldn't find anything about it.
> By the way do the newer IDS versions support arrays as parameters?
>
> 2009/3/20 Art Kagel <art.kagel@gmail.com>:
>>
>> No, no arrays. Use a temp table or a permanent staging table to pass the
>> array of values instead. If you use a temp table the procedure will
>> recompile itself each time it is run (as the table didn't exist at
>> compile
>> time). If you use a permanent staging table that problem goes away. You
>> can use the session_id as a key to the rows in the staging table that
>> belong
>> to the particular function call for a session.
>>
>> On Fri, Mar 20, 2009 at 3:43 PM, Gentian Hila <genti.tech@gmail.com>
>> wrote:
>>>
>>> Is it possible to have a stored procedure in IDS 9.40 that accepts an
>>> array as parameter?
>>>
>>> If so how can it be declared and how can it be accessed in the body of
>>> the stored procedure.