SPL Return Value problem
Posted in 1997
Topics: Stored Procedures & SPL, Error Codes & Troubleshooting, Jobs, Consulting & Announcements
Hi can someone help me with this SPL problem?
SELECT so_no, cust_name, so_getnextdate(so_no)
FROM so_custinfo WHERE so_status = 0 and blt = '01172'
Above is my SQL statment which calls a SPL named so_getnextdate, which
returns two values.
When I run the SQL I get error code 684 (Procedure
(informix.so_getnextdate) returns too
many values.).
How do I get the returned values and is there a way to label the returned
values within the SQL statment? I tried the following code too, which gave
a syntax error.
SELECT so_no, cust_name, so_getnextdate(so_no) nextdate, soamount
FROM so_custinfo WHERE so_status = 0 and blt = '01172'
what am I doing wrong??
Following is my Proc.
CREATE PROCEDURE so_getnextdate(sono INT)
RETURNING DATE,MONEY(12,2); DEFINE next_date DATE;
DEFINE soamount MONEY(12,2);
FOREACH
SELECT min(payment_date) as nextdate,amount INTO next_date,soamount
FROM so_payments WHERE so_no = sono AND paid_ind = 0
RETURN next_date,soamount WITH RESUME;
END FOREACH;
END PROCEDURE
Have A Great Day!
Ram Muhunthan, Bank of Nova Scotia
Email: rmuhunth@netcom.ca