Subject Re: [firebird-support] EXECUTE STATEMENT problem understanding
Author Mark Rotteveel
On Fri, 26 Jul 2013 13:14:08 +0100, Alan J Davies
<Alan.Davies@...> wrote:
> Ok, Mark & Markus, thanks again for both your help.
> I've tried this construct but get an error -206 column unknown pjs_no_in
> which is passed in as an input parameter
> declare variable table_to_use varchar(30);
> declare variable stmnt varchar(500);
> begin
> table_to_use='q_tool';
> begin
> EXECUTE STATEMENT 'update '|| table_to_use ||
> ' set tgp_no=:tgp_no,del_date=:del_date
> where (pjs_no=:pjs_no_in)';
> Column does not belong to referenced table.
> Dynamic SQL Error.
> SQL error code = -206.
> Column unknown.

You are not passing any parameters into the EXECUTE STATEMENT, so it does
not know about pjs_no_in, del_date or tgp_no. The query executed cannot
access parameters or variables declared in the stored procedure, you need
to pass them explicitly. See

See also my first mail for an example on how you pass in parameters.