SQL Return Codes

SQL Return Codes

ambox


type=move
text=This article has now been successfully to Wikibooks. You can find it on Wikibooks under the name . If this page can be into an encyclopedic article, please do so and remove this message and/or add a link to the Wikibook using tl|wikibooks.

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.

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 Application programming interface
API
call for the SQL statement...

SQLCODE

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

0 means successful execution. Negative means unsuccessful with an error. An example is -911 which means a timeout has occurred with a rollback. Positive means successful execution with a warning. An example is +100 which means no rows found.

Here is a more comprehensive list of the SQLCODEs for DB2:

Zero (Successful)

0 Successful

Negative values (Errors)

-102 String constant is too long. -117 The number of values in the INSERT does not match the number of columns. -180 Bad data in Date/Time/Timestamp. -181 Bad data in Date/Time/Timestamp. -199 Illegal use of the specified keyword. -204 Object not defined to DB2. -205 Column name not in table. -206 Column does not exist in any table of the SELECT. -216 Not the same number of expressions on both sides of the comparison in a SELECT . -224 FETCH cannot make an INSENSITIVE cursor SENSITIVE. -229 The locale specified in a SET LOCALE statement was not found. -305 Null indicator needed. -311 Varchar, insert or update. -LEN field with the right data length not set. -482 The procedure returned no locators. -501 Cursor not open on FETCH. -502 Opening cursor that is already open. -503 Updating column needs to be specified. -530 Referential integrity preventing the INSERT/UPDATE -532 Referential integrity (DELETE RESTRICT rule) preventing the DELETE. -536 Referential integrity (DELETE RESTRICT rule) preventing the DELETE. -545 Check constraint preventing the INSERT/UPDATE. -747 The table is not available. -803 Duplicate key on insert or update. -805 DBRM or package not found in plan. -811 More than one row retrieved in SELECT INTO. -818 Plan and program: timestamp mismatch. -904 Unavailable resource. Someone else is locking your data. -911 Deadlock or timeout. Rollback has been done. -913 Deadlock or timeout. No rollback. -922 Authorization needed. -927 The language interface was called but no connection had been made.

Positive Values (Warnings)

+100 Row not found or end of cursor. +222 Trying to fetch a row within a DELETE statement. +223 Trying to fetch a row within an UPDATE statement. +231 FETCH after a BEFORE or AFTER but not on a valid row. +304 Value cannot be assigned to this host variable because it is out of range. +802 The null indicator was set to -2 as an arithmetic statement didn't work.


Wikimedia Foundation. 2010.

Игры ⚽ Поможем сделать НИР

Look at other dictionaries:

  • DB2 SQL return codes — 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… …   Wikipedia

  • SQuirreL SQL Client Plugin API — Plugin Basics Plugin Loading A plugin is made available to SQuirreL as a set of classes that are packaged into a jar file which is located in the plugins directory in the installation directory. SQuirrel uses a custom classloader to find and load …   Wikipedia

  • IBM DB2 — Developer(s) IBM Initial release 1983 (1983) …   Wikipedia

  • Cursor (databases) — In computer science and technology, a database cursor is a control structure that enables traversal over the records in a database. Cursors facilitate subsequent processing in conjunction with the traversal, such as retrieval, addition and… …   Wikipedia

  • DB2 Magazine — was a U.S. based magazine published by CMP Technology and sponsored by IBM Corp. In 2008, the magazine s name changed to IBM Database Magazine before later changing to IBM Data Management magazine in 2009 when it switched publishers. With a… …   Wikipedia

  • OpenLDAP — Software Developer(s) The OpenLDAP Project Stable release 2.4.26 / June 30, 2011; 4 months ago (2011 06 30) …   Wikipedia

  • Software quality — Contents 1 Motivation for Defining Software Quality 2 Definition 3 Alternative Approaches to Software Quality Defin …   Wikipedia

  • Defensive programming — is a form of defensive design intended to ensure the continuing function of a piece of software in spite of unforeseeable usage of said software. The idea can be viewed as reducing or eliminating the prospect of Murphy s Law having effect.… …   Wikipedia

  • ABAP — Infobox programming language name = ABAP/4 logo = paradigm = Object oriented, structured, imperative year = 1980s designer = SAP AG typing = Static, strong, safe, nominative implementations = SAP R/2,SAP R/3 dialects = influenced by = Objective C …   Wikipedia

  • computer programming language — Introduction       any of various languages for expressing a set of detailed instructions for a digital computer. Such instructions can be executed directly when they are in the computer manufacturer specific numerical form known as machine… …   Universalium

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”