/ Published in: SQL
procedure to throw application defined error
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
DROP PROCEDURE IF EXISTS throw_error; delimiter $$ CREATE PROCEDURE throw_error (errno BIGINT UNSIGNED, message VARCHAR(256)) BEGIN SIGNAL SQLSTATE 'ERROR' SET MESSAGE_TEXT = message, MYSQL_ERRNO = errno; END $$ delimiter ;