[fpc-pascal] How to insert a record and get the primary key with sqldb?

Martin Schreiber mse00000 at gmail.com
Sat Oct 22 17:53:57 CEST 2011


On Saturday 22 October 2011 17.23:38 Marcos Douglas wrote:
> On Sat, Oct 22, 2011 at 11:21 AM,  <michael.vancanneyt at wisa.be> wrote:
> >>  DBComm.SQLTransaction.StartTransaction; <-- Fails here with
> >> "transaction already active"
> > 
> > Correct. The default transaction is made active after connecting.
> > You should call StartTransaction on this transaction only after a commit
> > or rollback.
> 
> I also found this problem when I migrated from Zeos to SQLdb.
> Only SQLdb works in this way. IMHO, it not make sense.
> For automatic transactions, the user can define AutoCommit=True If it
> is False, I can call StartTransaction BEFORE the Commit. That is the
> way that all libs work.
> 
That means there are different transactions for reading and writing? MSEgui 
has this option too. But what if reading and writing should be in a single 
transaction?

Martin



More information about the fpc-pascal mailing list