I am running a log parser to find SQL errors in my log files. If the search string (regular expression) is evaluated to true, the line will be marked. So far I used the search expression "SQL0", which was given to me by our DBAs. However, I recently discovered that there are noteworthy SQL Errors that start with "SQL1".
I found some references, that negative SQL error codes mean that the statement was unsuccessful. So my current idea is to search for "SQL[0-9]+N" (SQL error messages were the number ends with an N). Will this find all SQL error codes?
Update: I am running automated scripts on a DB2 database. I need to parse the logs of these scripts to verify if errors occurred during execution.
Finally I found what I was looking for:
see: http://publib.boulder.ibm.com/infocenter/db2luw/v9r5/topic/com.ibm.db2.luw.messages.doc/doc/c0052007.html
If I understand what I found in Google correctly, your error messages look like this:
It seems that the number is the error code and I would guess that the leading 0 indicates that this example is negative error code 204. A leading 1 in the number will be for positive error codes so 1204 is +204 and 0204 is -204.
Grepping for
"SQL[0-9]+N"
will find all error messages that match that pattern, however I can't verify that DB2 will not produce other types of errors.