<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://ideawaza.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=217.52.250.0%2F24</id>
	<title>IdeaWazaWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://ideawaza.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=217.52.250.0%2F24"/>
	<link rel="alternate" type="text/html" href="https://ideawaza.com/wiki/Special:Contributions/217.52.250.0/24"/>
	<updated>2026-09-29T13:58:14Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.46.0</generator>
	<entry>
		<id>https://ideawaza.com/index.php?title=SQL_return_codes&amp;diff=52421</id>
		<title>SQL return codes</title>
		<link rel="alternate" type="text/html" href="https://ideawaza.com/index.php?title=SQL_return_codes&amp;diff=52421"/>
		<updated>2008-05-11T08:28:20Z</updated>

		<summary type="html">&lt;p&gt;217.52.250.50: /* Negative values (Errors) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;SQL return codes&#039;&#039;&#039; are used for the diagnosis of programming failures as a result of SQL calls by [[w:en:IBM DB2|DB2]] [[w:en:computer program|programs]]. An important feature of DB2 programs is the error processing. The error diagnostic containing the SQL return code is held in the field &#039;&#039;&#039;SQLCODE&#039;&#039;&#039; within the DB2 [[w:en:SQLCA|SQLCA]] block.&lt;br /&gt;
&lt;br /&gt;
== SQLCA == &lt;br /&gt;
The SQL communications area (SQLCA) structure is used within the DB2 program to return error information to the [[w:en:application program|application program]]. This information in the SQLCA and the SQLCODE field is updated after every [[w:en:Application programming interface|&lt;br /&gt;
API]] call for the SQL statement. &lt;br /&gt;
&lt;br /&gt;
== SQLCODE ==&lt;br /&gt;
The SQLCODE field contains the SQL return code. The code can be zero (0), negative or positive.&lt;br /&gt;
&lt;br /&gt;
   0 means successful execution.&lt;br /&gt;
    &lt;br /&gt;
   Negative means unsuccessful with an error. &lt;br /&gt;
   An example is -911 which means a timeout has occured with a rollback.&lt;br /&gt;
 &lt;br /&gt;
   Positive means successful execution with a warning. &lt;br /&gt;
   An example is +100 which means no rows found.&lt;br /&gt;
&lt;br /&gt;
Here is a more comprehensive list of the SQLCODEs for DB2:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Zero (Successful) ===&lt;br /&gt;
   0    Successful      &lt;br /&gt;
&lt;br /&gt;
=== Negative values (Errors) ===&lt;br /&gt;
 &lt;br /&gt;
  -102  String constant is too long.&lt;br /&gt;
  -117  The number of values in the INSERT does not match the number of columns.&lt;br /&gt;
  -180  Bad data in Date/Time/Timestamp.&lt;br /&gt;
  -181  Bad data in Date/Time/Timestamp.&lt;br /&gt;
  -199  Illegal use of the specified keyword.&lt;br /&gt;
 &lt;br /&gt;
  -204  Object not defined to DB2.&lt;br /&gt;
  -205  Column name not in table.&lt;br /&gt;
  -206  Column does not exist in any table of the SELECT.&lt;br /&gt;
  -216  Not the same number of expressions on both sides of the comparison in a SELECT . &lt;br /&gt;
  -224  FETCH cannot make an INSENSITIVE cursor SENSITIVE.&lt;br /&gt;
  -229  The locale specified in a SET LOCALE statement was not found.&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;  -305  Null&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;Bold text&#039;&#039;&#039;&#039;&#039;&#039; indicator needed.&lt;br /&gt;
  -311  Varchar, insert or update. -LEN field with the right data length not set.&lt;br /&gt;
 &lt;br /&gt;
  -482  The procedure returned no locators.&lt;br /&gt;
 &lt;br /&gt;
  -501  Cursor not open on FETCH.&lt;br /&gt;
  -502  Opening cursor that is already open.&lt;br /&gt;
  -503  Updating column needs to be specified. &lt;br /&gt;
  -530  Referential integrity preventing the INSERT/UPDATE&lt;br /&gt;
  -532  Referential integrity (DELETE RESTRICT rule) preventing the DELETE.&lt;br /&gt;
  -536  Referential integrity (DELETE RESTRICT rule) preventing the DELETE.&lt;br /&gt;
  -545  Check constraint preventing the INSERT/UPDATE.&lt;br /&gt;
 &lt;br /&gt;
  -747  The table is not available.&lt;br /&gt;
 &lt;br /&gt;
  -803  Duplicate key on insert or update.&lt;br /&gt;
  -805  DBRM or package not found in plan.&lt;br /&gt;
  -811  More than one row retrieved in SELECT INTO.&lt;br /&gt;
  -818  Plan and program: timestamp mismatch.&lt;br /&gt;
 &lt;br /&gt;
  -904  Unavailable resource. Someone else is locking your data.&lt;br /&gt;
  -911  Deadlock or timeout. Rollback has been done.&lt;br /&gt;
  -913  Deadlock or timeout. No rollback.&lt;br /&gt;
  -922  Authorization needed.&lt;br /&gt;
  -927  The language interface was called but no connection had been made.&lt;br /&gt;
&lt;br /&gt;
=== Positive Values (Warnings) ===&lt;br /&gt;
  +100  Row not found or end of cursor.&lt;br /&gt;
  +222  Trying to fetch a row within a DELETE statement.&lt;br /&gt;
  +223  Trying to fetch a row within an UPDATE statement.&lt;br /&gt;
  +231  FETCH after a BEFORE or AFTER but not on a valid row. &lt;br /&gt;
  +304  Value cannot be assigned to this host variable because it is out of range.&lt;br /&gt;
  +802  The null indicator was set to -2 as an arithmetic statement didn&#039;t work.&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
* A [http://www.theamericanprogrammer.com/programming/sqlcodes.shtml more extensive list] of the codes&lt;br /&gt;
&lt;br /&gt;
[[category:SQL]]&lt;/div&gt;</summary>
		<author><name>217.52.250.50</name></author>
	</entry>
</feed>