Re: Return value from stored procedure ?
Posted in 1998
Wu -
My 4GL is weak, so forgive my shoddy syntax. Basically, you'd do this:
LET cmd="EXECUTE PROCEDURE get_customer_name(?)"
PREPARE qry FROM cmd
DECLARE cur CURSOR FOR qry
OPEN cur USING <cust_num>
FETCH cur INTO <cust_name>
CLOSE cur
FREE qry
Hope this helps,
- Tom Girsch
Database Systems Manager
Arch Communications Group, Inc.
Wu wrote in message <71pp9k$1e0$1@news.xmission.com>...
>
>Hi,
>
> I have created a simple stored procedure which will return the
>customer name based on the customer code that passed in ... However, I
>do not know how to return the value from the stored procedure to a 4GL
>program ? Can anyone of your enlighten me please ...
>
>thanx ...
>
>The stored procedure :
>
>create procedure get_customer_name (l_customer_code char(8)) returning
>varchar(40)
> define
> l_customer_name varchar(40)>
> select customer_name into l_customer_name
> from customer
> where customer_code = l_customer_code
>
> return l_customer_name
>end procedure
>
>