Hi Support,
I am using Unidac version 6.14 with Lazarus 1.4.
Connecting to Postgres i am sending something like below after connecting:
start transaction;
sql1;
...
sql10;
commit;
in a ExecSQL command.
I am getting an error with '...cannot insert multiple commands into a prepared statement'.
Please advise how this could be sent to the server, the below did not work for me and I did not find a reference somewhere else:
conn.SpecificOptions.Values['UnpreparedCommandExecution'] := 'true';
Thank you
[SOLVED] Postgres - prepared statement
[SOLVED] Postgres - prepared statement
Last edited by tudi_x on Sun 12 Jul 2015 14:16, edited 1 time in total.
Re: Postgres - prepared statement
In order to execute several commands separated by semicolon in one SQL query, use Protocol 2.0 for connection to PostgreSQL For this, before establishing connection, set the 'UnpreparedExecute' specific option to 'True'. For example:
Code: Select all
UniConnection.SpecificOptions.Values['ProtocolVersion'] := 'pv20';
Re: [SOLVED] Postgres - prepared statement
Thank you.
It worked with pv20.
It worked with pv20.