Subject Problem when returning values with EXECUTE STATEMENT
Author aalliana
Hello,

I'm trying to use EXECUTE STATEMENT to call stored procedures that return values. ie. Called with "execute procedure and returning_values"

A simplified example would be:

Sql = 'execute procedure ' || Pname || '(';
Sql = Sql || CAST(Par AS VARCHAR(20)) || ', ' || CAST(Par AS VARCHAR(20)) || ')';

EXECUTE STATEMENT Sql into :r1, :r2;

------------------------------------------------------------

The procedure that I'm calling is:
create or alter procedure AUX_BORRAME_TEST_PROC (
ID1 integer,
ID2 varchar(50))
returns (
R1 integer,
R2 varchar(50))
AS
begin
r1 = 108;
r2 = 'borrame!';
end

--------------------------------------------------------------

I'm getting the following error:

Unsuccessful execution caused by system error that does not preclude successful execution of subsequent statements.
request synchronization error.
At procedure 'AUX_BORRAME_DRIVER_PROC' line: 21, col: 5.


Adding a suspend clause to the procedure and changing the EXECUTE STATEMENT syntax to select * from succeeds.

Is there any way to call non selectable stored procedures (and receiving retunrning values) with EXECUTE STATEMENT?

TIA