Re: more than one return value from SPL?
Posted in 1996
MFerris wrote
>
>cdr@xteam.co.at (Chris Drauch) writes:
>>
>> It's easy to use the SPL as
>> select name, call_number (state,phone) from ....>> if the SP 'call_number' is returning just **one** value.
>> But how to do if there is more than one? Using DB-Access I've got:
>>
>You need to put your SQL statement in a FOREACH loop:
>
>FOREACH
> Select col1, col2,col3 ....
> Return var1,var2,var3 WITH RESUME;>END FOREACH
>
>The "WITH RESUME" statement is very important as it tells
>Informix to go back for more data after the first select.
I don't have multiple rows, just multiple return values. I will try to clarify:
# create procedure test() returning int,int;
# return 1,2;
# end procedure
and a following:
# execute procedure test();
(expression) (expression)
1 2
# select name, zip, test() from customer;
--> 684: Procedure (informix.test) returns too many values
--
Chris Drauch <cdr@xteam.co.at> ... just speaking for myself ...