Navigation:  NexusDB Guide > SQL Reference > SQL Statements > Transaction Statements >

ROLLBACK statement

Previous pageReturn to chapter overviewNext page

NexusDB V3 Manual

ROLLBACK statement

button_main button_prev button_next

NexusDB Manual V3 > SQL Reference > SQL Statements > Transaction Statements

Cancel a transaction.

 

Syntax

 

<rollback statement> ::= ROLLBACK [ WORK ]

 

 

Usage

 

The ROLLBACK statement terminates the active transaction and cancels all changes made during the transaction.

 

 

Notes

 

§

The COMMIT statement will return an error if no transaction is active.

 

 

Examples

 

1)

The following example cancels the current transaction:

 

      ROLLBACK;

 

2)

The following example shows the ROLLBACK statement used in the context of a TRY statement:

 

      START TRANSACTION;

      TRY

// Execute some data-change statements here.

COMMIT;

      CATCH POSITION( 'Unable to open table' IN ERROR_MESSAGE ) <> 0

ROLLBACK;

SIGNAL ERROR_MESSAGE;

      END;

 

 


Conformance

 

SQL:2003 standard

-

Core SQL

 

© Nexus Database Systems Pty Ltd.

nexus_logo