Subject returning_val
Author chris.waldmann
Hello all

I have a question to usage and performance of stored procedures that return only one result row/value.
Is there a performance drawback when I code it as a selectable procedure, or should I use always the execute procedure syntax and drop the suspend?

Is it correct that I can not assign directly to a variable as with a UDF?

Many thanks
Chris

create procedure MYPROC(
IN_PORTION float)
returns (
HALF_PORTION float)
as
begin
HALF_PORTION = IN_PORTION / 2;
suspend;
end

usage as (SELECTABLE) STORED PROCEDURE:
execute procedure MYPROC( PARAM) returning_values :RESULT

usage as SELECTABLE STORED PROCEDURE:
select * from MYPROC( 19.0 ) into :RESULT;

usage of a UDF
:RESULT = udf_myProc( 19.0 );