Error when executing parametrized SET statement in postgresq
Posted: 26.08.2014, 14:42
Hello
I found problem ZEOSDBO-7.1.3a-stable when trying to run such code:
I got exception
ERROR: syntax error at or near "$1" LINE 1: SET application_name = $1;
It looks like zeos try to call prepare on "SET application_name = :app_name;' statement, but postgresql can accept only SELECT, UPDATE, INSERT, DELETE statements;
Executing
SET application_name = 'other_app_name' ;
works fine, problem occurs when i use params.
I found problem ZEOSDBO-7.1.3a-stable when trying to run such code:
Code: Select all
v_query.SQL.Text:= 'SET application_name = :app_name; ';
v_query.ParamByName('app_name').AsString:= 'some_app_name';
v_query.ExecSQL;
ERROR: syntax error at or near "$1" LINE 1: SET application_name = $1;
It looks like zeos try to call prepare on "SET application_name = :app_name;' statement, but postgresql can accept only SELECT, UPDATE, INSERT, DELETE statements;
Executing
SET application_name = 'other_app_name' ;
works fine, problem occurs when i use params.