NexusDB Manual V3 > SQL Reference > SQL Statements > Control Statements
Specify a TRY..CATCH block.
Syntax
<try statement> ::=
<protected statement block> ::= <SQL statement list>
<catch clause> ::= CATCH error-condition [ <catch statement block> ]
<catch statement block> ::= <SQL statement list>
Usage
The TRY statement is used to protect a block of SQL statements, and handle some or all of the possible errors that might occur during the execution, gracefully in SQL code. The concept is similar to TRY statements found in many programming languages.
Notes
Examples
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
|
© Nexus Database Systems Pty Ltd.