what's the Transaction for ? lazarus / 16-Databases ---------------------------------------------------------------------- mirce.vladimirov · 2012-05-10 13:36 I've been reading http://wiki.freepascal.org/Working_With_TSQLQuery  and there is a short example of how to insert rows in a database, which is exactly the same that i am doing, and my applications work fine, but there is one more line of code in the example that confuses me: Code: [Select]sql_temp.sql.text := 'insert into PRODUCTS (ITEMNR,DESCRIPTION) values (:OURITEMNR,:OURDESCRIPTION)'  ...  sql_temp.Params.ParamByName('OURITEMNR').AsString := 'XXXX';  sql_temp.Params.ParamByName('OURDESCRIPTION').AsString := 'description';  sql_temp.ExecSQL;  SQLTransaction1.Commit; //or possibly CommitRetaining, depending on how your application is set upand that's the line that contains the "SQLTransaction1.commit" What is this for ? I repeat, my applications are working with "query.ExecSQL;" ---------------------------------------------------------------------- Leledumbo · 2012-05-10 14:20 I forgot what the real term is, but it's some kind of exception handler and checkpoint (AFAIK not all DMBS supports). First you "Start" the transaction, and if everything goes fine, you "Commit" the transaction, marking it as OK (and also marking it as a checkpoint). Otherwise, you could "Rollback" the transaction, restoring values you've changed before the rollback to the last checkpoint.