-->

DB2 SQL return codes Connect

- 12:20 PM

IBM Data Studio can't browse data on SAMPLE (DB2 Express-C ...
photo src: stackoverflow.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.


การใช้งาน DB2 - YouTube
photo src: www.youtube.com


Maps, Directions, and Place Reviews



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


IBM Data Studio can't browse data on SAMPLE (DB2 Express-C ...
photo src: stackoverflow.com


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)

Source of the article : Wikipedia



EmoticonEmoticon

 

Start typing and press Enter to search