mysql procedure throw_error


/ Published in: SQL
Save to your folder(s)

procedure to throw application defined error


Copy this code and paste it in your HTML
  1. DROP PROCEDURE IF EXISTS throw_error;
  2. delimiter $$
  3. CREATE PROCEDURE throw_error (errno BIGINT UNSIGNED, message VARCHAR(256))
  4. BEGIN
  5. SIGNAL SQLSTATE 'ERROR'
  6. SET
  7. MESSAGE_TEXT = message,
  8. MYSQL_ERRNO = errno;
  9. END $$
  10. delimiter ;

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.