How to use transactions in Firebird?

In MS SQL Server, I can easily add multiple transactions to transactions, for example:

begin tran
insert into mytable values (1, 2, 3)
insert into mytable values (4, 5, 6)
commit tran

I am trying to do the same in Firebird, but I cannot understand the syntax. Googling for Firebird transaction syntax does not return anything useful. I found enough to know that transaction support exists, but there are no examples of how to use it correctly.

So, I suppose I can ask here. Does anyone know how to write a transaction using multiple inserts for a Firebird database?

+5
source share
4 answers

@Allan ( , BTW), .

begin tran SQL Server, , . , ! begin tran, " ", SQL Server ( ).

, commit tran " ".

, , . . , Firebird , .

, , "auto-commit at each statement", SQL Server. , , " ".

+6

Firebird . , . , :

insert into mytable values (1, 2, 3);
insert into mytable values (4, 5, 6);
commit;
+5

FB 2.5 , .

IN AUTONOMOUS TRANSACTION
DO
  < simple statement | compound statement >

http://www.firebirdsql.org/rlsnotesh/rlsnotes25.html#rnfb25-psql-auton

+3

Firebird

commit; 

Below is a screenshot from a Firebird session showing how it works.

screenshot from firebird session

0
source

All Articles