Examples for business, study, careers, love, and more...
Examples :: MYSQL Examples :: Example of Signal MYSQL Statement

Example of Signal MYSQL Statement

SIGNAL condition_value
SET signal_information [, signal_information]

condition_value:
SQLSTATE [VALUE] sqlstate_value
| condition_name

signal_information:
condition_information_item = simple_value_specification


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

Example of Mysql Signal


CREATE PROCEDURE p (divisor INT)
BEGIN
IF divisor = 0 THEN
SIGNAL SQLSTATE '22012';
END IF;
END;