NexusDB Manual V3 > SQL Reference > SQL Statements > Control Statements
Signal an exception condition.
Syntax
<signal statement> ::= SIGNAL <character string literal>
Usage
The SIGNAL statement is used to throw an exception with the message specified by the character string literal.
Examples
SIGNAL 'Dummy Exception.';
DECLARE v1, v2 DOUBLE PRECISION; SET v1 = RAND; SET v2 = RAND; IF ( v1 = v2 ) THEN SIGNAL 'The values are equal.'; ELSE SIGNAL 'The values are different.'; END IF;
3) The following example shows the SIGNAL statement used in the CATCH clause of a TRY statement:
START TRANSACTION; TRY DROP TABLE garbage; COMMIT; CATCH POSITION( 'Unable to open table' IN ERROR_MESSAGE ) <> 0 ROLLBACK; SIGNAL 'The table couldn''t be dropped.' || CHR(13) || 'The transaction was rolled back.'; END;
Conformance
|
© Nexus Database Systems Pty Ltd.