Subject | Re: [firebird-support] Stored Procedure Output Parameter |
---|---|
Author | Helen Borrie |
Post date | 2003-11-25T12:56:19Z |
At 12:18 PM 25/11/2003 +0000, you wrote:
EXECUTE PROCEDURE and read the output parameters after execution.
You could also do this directly with a DSQL statement (no SP) as follows:
select cast((((all of that complicated stuff ))) as varchar(200) )
as CRETSTRING CHARACTER SET WIN1252
from RDB$DATABASE;
heLen
>Hi all,SUSPEND;
>
>I am trying to use a SP in order to choose one of two strings,
>depending on the value of a numeric variable. All of them are passed
>as input parameters to the procedure.
>FB Version is 1.0.
>Following the advice in the FB Doc I wrote:
>----------------------------------------------------
>SET TERM ^^ ;
>CREATE PROCEDURE FORM2 (NVAL Double Precision, NDEC Double Precision,
>CTEXTSINGULAR VarChar(25) CHARACTER SET WIN1252, CTEXTPLURAL VarChar
>(25) CHARACTER SET WIN1252) returns (CRETSTRING VarChar(200)
>CHARACTER SET WIN1252) AS
>
>begin
>cretstring = cast(cast(:nval as varchar(20)) || cast(' ' as varchar
>(20)) || ... <UDF to choose the correct string-variable> ... as
>varchar(200));
>endYou need a SUSPEND statement for a selectable stored procedure.
>^^
>SET TERM ; ^^
>--------------------------------------------------------
>In debug mode I can see, that the procedure works fine, since
>cretstring holds the correct string at the end.
>
>But there is no result returning to the calling statement:
>
>select * from form2(1,0,'String1','String2');
>
>Where is the error ?
> Any alternatives ?Since this is a singleton, it would work "as is" if you called it with
EXECUTE PROCEDURE and read the output parameters after execution.
You could also do this directly with a DSQL statement (no SP) as follows:
select cast((((all of that complicated stuff ))) as varchar(200) )
as CRETSTRING CHARACTER SET WIN1252
from RDB$DATABASE;
heLen