Subject Re: Stored Procedure with return value
Author csswa
Hellen,

Paul's reply illustrates a point of confusion: you have the same name
for your input parameter and the value returned. You may want to
adopt clearer naming habits, e.g.

create procedure A
(in_param char(8))
returns(ret_param1 numeric(5))

execute procedure B(:in_param);


Regards,
Andrew Ferguson

--- In ib-support@y..., Paul Reeves <paul@f...> wrote:
> Hellen Huang wrote:
> > set term ^;
> > create procedure A
> > (param1 char(8))
> > returns(retparam1 numeric(5))
> > as
> > begin
> > if (param1='GOOD' ) then
> > retparam = 100;
> > else
> > retparam = 0;
> >
> > execute procedure B(:retparam);
> > end ^
> > set term ;^
> >
> > but when I executed it, it was return null values...
> >
> > Can anyone tell me how to make the right one..?
> >
>
>
> Try
>
> execute procedure B(:retparam) returning_values :retparam;
>
>
> Paul
> --
>
> Paul Reeves
> http://www.ibphoenix.com
> taking InterBase further