PostgreSQL support INSERT,UPDATE,DELETE with RETURNING clause
Original Reporter info from Mantis: lacak @lacak.sk
-
Reporter name: LacaK
Original Reporter info from Mantis: lacak @lacak.sk
- Reporter name: LacaK
Description:
Now, when you try Open query with insert, update,delete statement which contains returning clause you will get error 'Cannot open a non-select statement'
"If the INSERT command contains a RETURNING clause, the result will be similar to that of a SELECT statement containing the columns and values defined in the RETURNING list, computed over the row(s) inserted by the command."
Patch uses similar approach like IBConnection, where Statement type is changed when detected that DML uses returning i.e. returns result data.
From IBConnection.pp:
// If the statementtype is isc_info_sql_stmt_exec_procedure then
// override the statement type derrived by parsing the query.
// This to recognize statements like 'insert into .. returning' correctly
if IBStatementType = isc_info_sql_stmt_exec_procedure then
FStatementType := stExecProcedure;