This sample illustrates use of TRANSACTIONS via SQL. Notice that TAbsDatabase supports transactions as class methods so you might find it better to use another way.
This SQL script contains 14 queries.
Table "MyTable" is deleted, then recreated and filled with data.
A transaction is started, data is inserted, then this last action is cancelled.
Another transaction is started. data is inserted, then changes are comitted.
At last you can see what data is contained in the table after all queries.
drop table MyTable;
create table MyTable (ID AutoInc, val1 Integer, val2 string(10));
insert into MyTable (val1, val2) values (2,'Start');
start transaction;
insert into MyTable (val1, val2) values (4,'Rollback');
rollback;
start transaction;
insert into MyTable (val1, val2) values (5,'Commit');
commit;
select * from MyTable;
Download Absolute Database | Learn more |
|
|
Current version: 7.95
Released: February 08, 2023
Price: $ 149
|
|
We made three requests of the technical support personnel and despite the fact that these were all implementation questions (not bugs in their software) we received support within 24 hours. It is rare to get such good customer support these days and I really appreciate everything ComponentAce has done for us.
Jason Goodridge, Development Manager
|
|
|