top of page
CerebroSQL

MySQL: 

RESIGNAL

Syntax:
RESIGNAL [condition_value]
[SET signal_information_item
[, signal_information_item] ...]

condition_value: {
SQLSTATE [VALUE] sqlstate_value
| condition_name
}

signal_information_item:
condition_information_item_name = simple_value_specification

condition_information_item_name: {
CLASS_ORIGIN
| SUBCLASS_ORIGIN
| MESSAGE_TEXT
| MYSQL_ERRNO
| CONSTRAINT_CATALOG
| CONSTRAINT_SCHEMA
| CONSTRAINT_NAME
| CATALOG_NAME
| SCHEMA_NAME
| TABLE_NAME
| COLUMN_NAME
| CURSOR_NAME
}

condition_name, simple_value_specification:
(see following discussion)

RESIGNAL passes on the error condition information that is available
during execution of a condition handler within a compound statement
inside a stored procedure or function, trigger, or event. RESIGNAL may
change some or all information before passing it on. RESIGNAL is
related to SIGNAL, but instead of originating a condition as SIGNAL
does, RESIGNAL relays existing condition information, possibly after
modifying it.

RESIGNAL makes it possible to both handle an error and return the error
information. Otherwise, by executing an SQL statement within the
handler, information that caused the handler's activation is destroyed.
RESIGNAL also can make some procedures shorter if a given handler can
handle part of a situation, then pass the condition "up the line" to
another handler.

No privileges are required to execute the RESIGNAL statement.

All forms of RESIGNAL require that the current context be a condition
handler. Otherwise, RESIGNAL is illegal and a RESIGNAL when handler not
active error occurs.

To retrieve information from the diagnostics area, use the GET
DIAGNOSTICS statement (see [HELP GET DIAGNOSTICS]). For information
about the diagnostics area, see
https://dev.mysql.com/doc/refman/8.0/en/diagnostics-area.html.

URL: https://dev.mysql.com/doc/refman/8.0/en/resignal.html

Example

bottom of page