Portable SQL/Statements/Transactions
From Linuxnetworks
Start transactions
Database vendors use various statements for starting transactions and there is no single string that fits for all.
| Database | Statement |
|---|---|
| Firebird | SET TRANSACTION |
| MySQL | BEGIN |
| Oracle | SET TRANSACTION ISOLATION LEVEL READ COMMITTED |
| PostgreSQL | BEGIN |
| SQLite | BEGIN |
| SQL Server | BEGIN TRANSACTION |
| Sybase ASE | BEGIN TRANSACTION |
Saving changes
Making the changes done within a transaction permanent is easily done with a single statement for all databases:
COMMIT
Discarding changes
To undo all changes done within a transaction is as easy as committing them. A single statement for all databases exists:
ROLLBACK
Back to Overview