SQL - Select using a SPL
Posted in 2000
Topics: SQL Development & Query Writing, Stored Procedures & SPL
Does any know if there is a way to use a SPL that returns
2 values in a SELECT statement? For example:
CREATE PROCEDURE testproc(arg INT)
RETURNING INT, INT; RETURN 1, 2;
END PROCEDURE
SELECT arg, testproc(arg) FROM tab WHERE arg = 1
If I use this as is I get the following error:
684: Procedure (testproc) returns too many values.
Any help with this would be greatly appreciated!!
Thanks,
Tony
Sent via Deja.com http://www.deja.com/
Before you buy.
SELECT the results of the procedure to a temp table and join to that.
Art S. Kagel
tony_kastle@my-deja.com wrote:
> Does any know if there is a way to use a SPL that returns
> 2 values in a SELECT statement? For example:
>
> CREATE PROCEDURE testproc(arg INT)
> RETURNING INT, INT;> RETURN 1, 2;
> END PROCEDURE
> SELECT arg, testproc(arg) FROM tab WHERE arg = 1>
> If I use this as is I get the following error:
>
> 684: Procedure (testproc) returns too many values.>
> Any help with this would be greatly appreciated!!
>
> Thanks,
> Tony
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.