Sponsored Links

Jumat, 08 Desember 2017

Sponsored Links

Db2 - IBM Data for developers
src: i.ytimg.com

SQL Return Codes are used on a day-to-day basis for the diagnosis of programming failures as a result of SQL calls by DB2 computer programs. An important feature of DB2 programs is the error processing. The error diagnostic containing the SQL Return Code is held in the field SQLCODE within the DB2 SQLCA block.

SQLCODE is no longer part of the SQL-standard. The SQL-standard replaced SQLCODE by the more detailed SQLSTATE.


Video DB2 SQL return codes



SQLCA

The SQL communications area (SQLCA) structure is used within the DB2 program to return error information to the application program. This information in the SQLCA and the SQLCODE field is updated after every API call for the SQL statement... SQLCA contains ERROR HANDLING data


Maps DB2 SQL return codes



SQLCODE

The SQLCODE field contains the SQL return code. The code can be zero (0), negative or positive:

  • 0 means that the execution was successful.
  • Negative values incidate an unsuccessful execution with an error.
    An example is -911, which means that a timeout has occurred with a rollback.
  • Positive value mean a successful execution with a warning.
    An example is +100, which means that no matching rows were found or that the cursor has reached the end of the table.

Here is a more comprehensive list of the SQLCODEs for DB2. Note that this list is not exhaustive. Also note that some SQLCODEs may only occur in specific DB2 products; e.g., only on DB2 z/OS, only on DB2 LUW, or only on DB2 iSeries (AS400).

Zero (Successful)

    0    Successful  

Negative values (Errors)

Positive Values (Warnings)


How to display Ref cursor output in Result/Grid Pane? ( SQL Nav ...
src: www.toadworld.com


References

  • "DB2 Version 9.1 for z/OS Codes" (PDF). September 2013. 
  • "DB2 SQL CODE Description and solutions". 
  • "SQL codes". September 2013. 

Source of the article : Wikipedia

Comments
0 Comments