Is there any other difference between ExecSQL and Open of TSQLQuery?
Firebird now supports 'insert ... RETURNING'. For example, following SQL statement is valid.
insert into testtable (code, text) values (1, 'code 1') returning code
In Lazarus, I can see the result by SQLQuery1.Open (assuming that content of SQLQuery1.SQL is the above statement). When there were no 'returning', I would use TSQLQuery.ExecSQL. This does not return any value.
Is there any other difference between ExecSQL and Open of TSQLQuery?
But you don't really need RETURNING in your query. You can call the last id before inserting a record.Does that work with triggers? I can't imagine it does.
Retrieving the last value isn't a good idea in a multi-user environment and getting the value before hand with a generator can work but is an extra call..