Subject Re: [firebird-support] Problem when returning values with EXECUTE STATEMENT
Author Martijn Tonies
Hi,

> 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)) || ')';

It seems you're trying to pas "Par" as a string, but it is not surrounded
by quotes.

With regards,

Martijn Tonies
Upscene Productions
http://www.upscene.com

Download Database Workbench for Oracle, MS SQL Server, Sybase SQL
Anywhere, MySQL, InterBase, NexusDB and Firebird!

Database questions? Check the forum:
http://www.databasedevelopmentforum.com


> 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?