Obtaining the SQL Error

If a problem is occurring inside DB2 code, you will generally receive an SQL Error or SQL Warning when you perform an operation through a DB2 programming interface. SQL Errors and Warnings have two types of return codes. An SQLCode is returned, which is a DB2-specific code with DB2-specific details about the nature of the problem. An industry standard SQL State also gives a more general description of the error. We recommend always collecting the SQL Code for the error. You can then use the Messages Reference online book or the CLP to get details about the error, and corrective action. For example, let's say your application is receiving an SQL Code SQL1032. You can find out what this error means using the following command ...

Get DB2® Universal Database™ v8 Application Development Certification Guide, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.