Page 1 of 1

TIBCQuery Execute/ExecSQL uses read-only transaction

Posted: Thu 02 Dec 2010 11:58
by KeitaroBR
Hi,

how could I make TIBCQuery use the UpdateTransaction when the SQL called with execute is an UPDATE/INSERT?

Example:

Code: Select all

qy.Transaction := readOnlyTrans;
qy.UpdateTransaction := updTrans;
qy.SQL := 'UPDATE Client SET code=code+1';
qy.Execute;
In this case it uses readOnlyTrans, thus resulting in an error "attempting to update during read-only transaction"

Posted: Fri 03 Dec 2010 12:58
by Dimon
The UpdateTransaction property is used to get a transaction for modifying a dataset that was opened using the SELECT statement in the SQL property. In your case you should use the Transaction property instead of UpdateTransaction.