So it only reads the DB, no updates are used.
Assign the result of the select to a TBufDataset.I give up :( Have no idea how to do that. Please advice.
Try CommitRetaining or RollbackRetaining, instead of Commit or Rollback of transacition. XXX Retaining maintains the dataset open even after commit or rollback of transaction.
For information - as asides - when doing reports, it is advisable to set the level of isolation - for queries - in a "snapshot" transaction through one connection, if possible (if it's a really a very present and important server-side database activity, the creation of dedicated "view" objects can also be justified, in order too to isolate it further from other activities).
Seems that setting isolation level is an important thing... But how to do that in Lazarus? If this can be done by setting SQLTransaction.params, then I have no idea which parameters will accept IBM Informix ODBC driver.
Setting isolation level works for the whole DB or for my session only?
You are talking about setting DB Isolation Level, yes? I start to investigate this and discovered that isolation level can be set in DB (SQL command SET ISOLATION), in ODBC driver or in my application.
I've never programmed with ODBC, but whatever the connection is, I believe you have to use transaction to run query on a database. You must be usingI use the following code:
Transaction1.Active := True; SQLQuery1.SQL.Text := 'select * from mytable where...'; SQLQuery1.open; { In the following sentence, if you call Transaction1.Commit, then SQLQuery1 will be closed. But if you use CommitRetaining, then SQLQuery1 will remain in Active state. } Transaction1.CommitRetaining;
What SQLTransaction1.CommitRetaining; will do, if applied before ODBCConnection1.Close(); ?
So copying SQLQuery1 to BufDataset1 is the only solution that I can do for this task.Nope.