SQL Negative Return Codes

The SQL return codes are listed here numerically, you may browse through them or you may enter the code you are looking for and press the enter key to go directly to the return code description.

The codes are broken up into numeric ranges to make the HTML documents smaller and thus load faster. They are basically divided into the groups by the hundreds digit, (ie 0-99, 100-199 and etc.). However each section has the index for all the negative return codes.

-007 -010 -029 -060 -084 -101 -102 -103 -104 -105 -107 -109 -110 -111 -112 -113 -115 -117 -118 -119 -120 -121 -122 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -136 -137 -138 -144 -150 -151 -153 -154 -156 -157 -158 -159 -160 -161 -164 -170 -171 -180 -181 -182 -183 -184 -185 -186 -187 -188 -189 -191 -198 -199 -203 -204 -205 -206 -207 -208 -219 -220 -221 -250 -251 -301 -302 -303 -304 -305 -309 -311 -312 -313 -314 -330 -331 -332 -333 -401 -402 -404 -405 -406 -407 -408 -409 -410 -411 -412 -414 -415 -416 -417 -418 -419 -421 -426 -427 -501 -502 -503 -504 -507 -508 -509 -510 -511 -512 -513 -514 -516 -517 -518 -519 -525 -530 -531 -532 -533 -534 -535 -536 -537 -538 -539 -540 -542 -551 -552 -553 -554 -555 -556 -557 -558 -559 -567 -571 -601 -602 -603 -604 -607 -612 -613 -614 -615 -616 -618 -619 -620 -621 -622 -623 -624 -625 -626 -627 -628 -629 -631 -932 -633 -634 -635 -636 -637 -638 -639 -644 -646 -647 -652 -653 -660 -661 -662 -663 -665 -666 -667 -668 -669 -670 -671 -676 -677 -678 -679 -680 -681 -682 -683 -684 -685 -686 -687 -688 -689 -690 -691 -692 -693 -694 -715 -716 -717 -718 -719 -720 -721 -722 -726 -730 -731 -732 -733 -734 -735 -736 -737 -752 -802 -803 -804 -805 -807 -811 -812 -815 -817 -818 -819 -820 -822 -840 -900 -901 -902 -904 -905 -906 -907 -908 -909 -910 -911 -913 -917 -918 -922 -923 -924 -925 -926 -927 -950
-30000 -30020 -30021 -30030 -30040 -30041 -30050 -30051 -30052 -30053 -30060 -30061 -30070 -30071 -30072 -30073 -30074 -30080 -30090

SQL Code -203
A REFERENCE TO COLUMN column-name IS AMBIGUOUS

Explanation: Two or more of the tables specified in a FROM clause in the statement contain columns with the specified 'column-name'. The column name needs further qualification to establish which of the possible table-columns it is.

System Action: The statement cannot be executed.

Programmer Response: Qualify the ambiguous column name with a table name or correlation name.

SQLSTATE: 52002


SQL Code -204
name IS AN UNDEFINED NAME

Explanation: The object identified by 'name' is not defined in the DB2 subsystem. This return code can be generated for any type of DB2 object. This return code is issued when an alias is used and the table the alias is defined on does not exist. When you create an alias, you will get a warning message that the table does not exist. When you use the alias, you will see this message.

System Action: The statement cannot be executed.

Programmer Response: Determine that the object name was correctly specified in the SQL statement (including any required qualifiers). If so, ensure that the object exists in the system before resubmitting the statement.

SQLSTATE: 52004


SQL Code -205
column-name IS NOT A COLUMN OF TABLE table-name

Explanation: No column with the specified 'column-name' occurs in the table or view 'table-name'.

System Action: The statement cannot be executed.

Programmer Response: Verify that the column and table names are specified correctly (including any required qualifiers) in the SQL statement.

SQLSTATE: 52003


SQL Code -206
column-name IS NOT A COLUMN OF AN INSERTED TABLE, UPDATED TABLE, OR ANY TABLE IDENTIFIED IN A FROM CLAUSE

Explanation: This return code is used to report one of these errors:

  • In the case of an INSERT or UPDATE statement, the specified column is not a column of the table or view that was specified as the object of the insert or update.
  • In the case of a SELECT or DELETE statement, the specified column is not a column of any of the tables or views identified in a FROM clause in the statement.
  • There is a correlated reference in GROUP BY.
  • There is an unresolved qualified reference in HAVING.

System Action: The statement cannot be executed. No data was retrieved, inserted, or updated.

Programmer Response: Verify that the column and table names are specified correctly in the SQL statement. In the case of a SELECT statement, check to be sure that all of the required tables were named in the FROM clause.

SQLSTATE: 52003


SQL Code -207
THE ORDER BY CLAUSE IS INVALID BECAUSE IT INCLUDES A COLUMN NAME BUT IT APPLIES TO THE RESULT OF A UNION OR UNION ALL

Explanation: The ORDER BY clause in the statement is invalid because column names are specified in the ORDER BY list, and the statement contains a subselect with the UNION or UNION ALL operator.

If an ORDER BY clause applies to the result of a UNION or UNION ALL, integers (rather than column names) must be used in the ORDER BY list to identify the columns that are to be used in ordering the result table.

System Action: The statement cannot be executed.

Programmer Response: Correct the statement by replacing the column names in the ORDER BY list with numeric column identifiers. Refer to Chapter 5 of SQL Reference for information about restrictions on the syntax of ORDER BY clauses in statements that contain the UNION or UNION ALL operator.

SQLSTATE: 52006


SQL Code -208
THE ORDER BY CLAUSE IS INVALID BECAUSE COLUMN name IS NOT PART OF THE RESULT TABLE

Explanation: The statement is invalid because a column ('name') specified in the ORDER BY list does not appear in the result table (that is, is not specified in the SELECT-list). Only columns that are to appear in the result table can be used in ordering that result.

System Action: The statement cannot be executed.

Programmer Response: Correct the syntax of the statement, either by adding the specified column to the result table, or deleting it from the ORDER BY clause. Refer to Chapter 5 of SQL Reference for information about restrictions on the use of the ORDER BY clause to order the result of an SQL SELECT.

SQLSTATE: 52007


SQL Code -219
THE REQUIRED EXPLANATION TABLE table-name DOES NOT EXIST

Explanation: The EXPLAIN statement assumes the existence of the explanation table and it is not defined in the DB2 subsystem as a base table. Refer to SQL Reference for more information.

System Action: The statement cannot be executed.

Programmer Response: Determine whether the required explanation table does exist. If not, create the required table.

SQLSTATE: 52004


SQL Code -220
THE COLUMN column-name IN EXPLANATION TABLE table-name IS NOT DEFINED PROPERLY

Explanation: An error occurred during the insertion of a row into the explanation table. The table is improperly defined for the following reasons:

  • A column is missing.
  • Columns are defined in the wrong order.
  • The table contains an extra column.
  • A column description is invalid because of its name, data type, length, or null attributes.

System Action: The statement cannot be executed. The explanation information is not generated.

Programmer Response: Correct the definition of the required explanation table. Refer to Chapter 6 of SQL Reference for information on defining an explanation table.

SQLSTATE: 55002


SQL Code -221
"SET OF OPTIONAL COLUMNS" IN EXPLANATION TABLE table-name IS INCOMPLETE. OPTIONAL COLUMN column-name IS MISSING

Explanation: The EXPLAIN statement assumes the required explanation table is defined properly. The optional column indicated is not defined in the indicated explanation table. PLAN-TABLE can have none or all of the version 2 release 2 optional columns (PREFETCH, COLUMN-FN-EVAL, MIXOPSEQ). If the version 2 release 2 optional columns are present, it can also have all or none of the optional version 2 release 3 columns (VERSION,COLLID).

System Action: The explanation information is not generated.

Programmer Response: Correct the definition of the required explanation table to include all five optional columns, just the version 2 release 2 optional columns, or no optional columns. Refer to Chapter 6 of SQL Reference for information on defining an explanation table.

SQLSTATE: 55002


SQL Code -250
THE LOCAL LOCATION NAME IS NOT DEFINED WHEN PROCESSING A THREE-PART OBJECT NAME

Explanation: A three-part object name (table, view, or alias) cannot be used until the local location name is defined.

System Action: Install or reinstall the DB2 distributed data facility (DDF) with a registered location name for local DB2.

Programmer Response: Define the local location name and then retry the function.

SQLSTATE: 52018


SQL Code -251
TOKEN name IS NOT VALID

Explanation: A location name cannot contain alphabetic extenders. (The standard alphabetic extenders in the United States are #, @, $.)

System Action: The statement cannot be executed

Programmer Response: Correct the location name.

SQLSTATE: 37502