Portable SQL/Statements/Transactions

From Linuxnetworks
< Portable SQL
Revision as of 22:51, 27 April 2007 by Nose (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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