Page 1 of 1

SQL with parameters

Posted: Wed 04 Mar 2020 15:18
by Isaev
for example:

Code: Select all

PgQuery.SQL.Text := 'SELECT * FROM table WHERE field1=:field1';
PgQuery.ParamByName('field1').AsString := '10';
How can I get SQL with replaced parameters?
The component actually replaces the parameters in the SQL, before sending to the server
whether there are property from where it is possible to get: SELECT * FROM table WHERE field1=10?

Re: SQL with parameters

Posted: Mon 16 Mar 2020 15:09
by oleg0k
Hello,
PgDAC doesn't have a property for replacing the parameters in a SQL statement with actual values.
You may use the TPgSQLMonitor component to monitor which SQL statements are being sent to the server.
PgDAC uses protocol version 3, which assumes sending SQL statements and parameters separately.

wbr, Oleg