Tuesday, December 20, 2011

Look up DB2 error codes: the fast way

I have to admit that I’m not a big fan of DB2 although there is not much wrong with the database itself. I have more problems with the far-from-perfect tooling.

One of the things that keep annoying me are the cryptic error messages including an even more cryptic SQL error code that DB2 returns. Normally I look up the error code in the DB2 Information Center, but if you need a shorter and faster way to get at least a short explanation of what an error code means, you can use the following SQL query:

VALUES SQLERRM(-161)

Result:

1
------------------------------------------------------------------------------------------------------
SQL0161N The resulting row of the insert or update operation does not conform to the view definition.

No comments: