Wednesday, January 18, 2017

MySQL Error Handling


Three type of Handler_Action:

CONTINUE
EXIT
UNDO

Type of Condition Value:

mysql_error_code
sqlstate_value
SQLWarning
SQLException
NotFound



GET DIAGNOSTICS, you can get all of the error information, and you should, if not already.

If you were going to use GET DIAGNOSTICS from the command line, you could use something like this (immediately following your query):

GET DIAGNOSTICS CONDITION 1
 @errno = MYSQL_ERRNO, @text = MESSAGE_TEXT;
SELECT @sqlstate, @errno, @text;

No comments:

Post a Comment