Difference between revisions of "COMMIT"

From Lianjapedia
Jump to: navigation, search
 
m (Text replace - "Recital" to "Lianja")
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
==Purpose==
 
==Purpose==
 
Ends the current transaction, saving changes
 
Ends the current transaction, saving changes
 
  
 
==Syntax==
 
==Syntax==
 
COMMIT [TRANSACTION <transaction>] [WORK]
 
COMMIT [TRANSACTION <transaction>] [WORK]
 
  
 
==See Also==
 
==See Also==
 
[[SQL BEGIN TRANSACTION|BEGIN TRANSACTION]], [[SQL END TRANSACTION|END TRANSACTION]], [[SQL ROLLBACK|ROLLBACK]], [[SAVE TRANSACTION]], [[SAVEPOINT]], [[SET TRANSACTION]], [[TXNISOLATION()]], [[TXNLEVEL()]]
 
[[SQL BEGIN TRANSACTION|BEGIN TRANSACTION]], [[SQL END TRANSACTION|END TRANSACTION]], [[SQL ROLLBACK|ROLLBACK]], [[SAVE TRANSACTION]], [[SAVEPOINT]], [[SET TRANSACTION]], [[TXNISOLATION()]], [[TXNLEVEL()]]
 
  
 
==Description==
 
==Description==
Line 20: Line 17:
 
The optional WORK keyword is included for SQL ANSI 92 compatibility.  COMMIT WORK and COMMIT operate in the same way.
 
The optional WORK keyword is included for SQL ANSI 92 compatibility.  COMMIT WORK and COMMIT operate in the same way.
  
A transaction is a sequence of SQL statements that Recital treats as a single unit.  A transaction begins with the first executable SQL statement after a BEGIN TRANSACTION.  A transaction ends with a COMMIT, ROLLBACK or END TRANSACTION.
+
A transaction is a sequence of SQL statements that Lianja treats as a single unit.  A transaction begins with the first executable SQL statement after a BEGIN TRANSACTION.  A transaction ends with a COMMIT, ROLLBACK or END TRANSACTION.
 
+
  
 
==Example==
 
==Example==
Line 39: Line 35:
  
  
==Products==
 
Recital Server, Recital
 
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:SQL]]
 
[[Category:SQL]]
 
[[Category:Commands]]
 
[[Category:Commands]]

Latest revision as of 12:32, 7 December 2012

Purpose

Ends the current transaction, saving changes

Syntax

COMMIT [TRANSACTION <transaction>] [WORK]

See Also

BEGIN TRANSACTION, END TRANSACTION, ROLLBACK, SAVE TRANSACTION, SAVEPOINT, SET TRANSACTION, TXNISOLATION(), TXNLEVEL()

Description

The COMMIT statement ends the current or specified transaction and any transactions that are nested within it and makes permanent all changes performed in the transaction or transactions.

TRANSACTION <transaction>

The optional TRANSACTION <transaction> is used to specify the name of the transaction to be committed.

WORK

The optional WORK keyword is included for SQL ANSI 92 compatibility. COMMIT WORK and COMMIT operate in the same way.

A transaction is a sequence of SQL statements that Lianja treats as a single unit. A transaction begins with the first executable SQL statement after a BEGIN TRANSACTION. A transaction ends with a COMMIT, ROLLBACK or END TRANSACTION.

Example

BEGIN TRANSACTION trans1
  INSERT INTO customer;
    (TITLE, LAST_NAME, FIRST_NAME, INITIAL, STREET,;
    CITY, STATE, ZIP,LIMIT, START_DATE);
    VALUES;
    ('Ms', 'Jones', 'Susan', 'B', '177 High Street','Beverly', 'MA', '01915', 2000, date())
  INSERT INTO accounts (ORD_VALUE) VALUES (30)
  // Commit the trans1 transaction 
  COMMIT TRANSACTION trans1
END TRANSACTION
// End of program