FirebirdSQL / firebird

Firebird server, client and tools
https://www.firebirdsql.org/
1.23k stars 212 forks source link

EXECUTE STATEMENT - double quoted named input parameters - "Unsuccessful execution" [CORE4551] #4869

Open firebird-automations opened 10 years ago

firebird-automations commented 10 years ago

Submitted by: Gorynich (gorynich)

execute block (P smallint = :P) returns (R smallint) as declare variable S varchar(512); begin S = 'select cast(:"P1" as integer) from RDB$Database';
for execute statement(:S)("P1" := :P) into :R do suspend; end

Unsuccessful execution caused by system error that does not preclude successful execution of subsequent statements. Execute statement preprocess SQL error. Parameter name expected.

firebird-automations commented 10 years ago

Commented by: Sean Leyne (seanleyne)

It looks like your SELECT statement is wrong.

S = 'select cast(:"P1" as integer) from RDB$Database'; should read: S = 'select cast(:P1 as integer) from RDB$Database';

Also, shouldn't ("P1" := :P) read as ('P1' := :P)?

firebird-automations commented 9 years ago

Commented by: Gorynich (gorynich)

select cast(:"P1" as integer) from RDB$Database

statement is wrong?

execute block ( "P1" smallint = :P1) returns ( R smallint(512)) as declare variable S varchar(512); begin for select cast(:"P1" as integer) from RDB$Database into :R do suspend; end

works properly

firebird-automations commented 9 years ago

Commented by: @hvlad

I confirm that quoted parameter names is not supported by EXECUTE STATEMENT so far.

firebird-automations commented 9 years ago
Modified by: @hvlad assignee: Vlad Khorsun \[ hvlad \]