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 -401
THE OPERANDS OF AN ARITHMETIC OR COMPARISON OPERATION ARE NOT COMPARABLE

Explanation: An arithmetic operation appearing within the SQL statement has a mixture of numeric and nonnumeric operands, or the operands of a comparison operation are not compatible.

System Action: The statement cannot be executed.

Programmer Response: Check the data types of all operands to ensure that their data types are comparable and compatible with their usage in the statement.

If all the operands of the SQL statement are correct, then, if a view is being accessed, check the data types of all the operands in the view definition.

SQLSTATE: 53018


SQL Code -402
AN ARITHMETIC FUNCTION OR OPERATOR arith-fop IS APPLIED TO CHARACTER OR DATETIME DATA

Explanation: A nonnumeric operand has been specified for the arithmetic function or operator 'arith-fop'.

System Action: The statement cannot be executed.

Programmer Response: Examine and correct the syntax of the SQL statement such that all operands of the specified function or operator are numeric.

SQLSTATE: 53019


SQL Code -404 THE UPDATE OR INSERT STATEMENT SPECIFIES A STRING THAT IS TOO LONG column-name

Explanation: An INSERT or UPDATE statement specifies a value that is longer than the maximum-length string that can be stored in the indicated column.

System Action: The statement cannot be executed.

Note: 'column-name' may or may not be returned in SQLCA, depending on the syntax of the INSERT or UPDATE statement.

Programmer Response: Check the length of the object column, and correct the program or SQL statement so that the length of the insert or update string does not exceed that maximum.

SQLSTATE: 22001


SQL Code -405
THE NUMERIC LITERAL literal CANNOT BE USED AS SPECIFIED BECAUSE IT IS OUT OF RANGE

Explanation: The specified numeric literal is not in the proper range.

The proper ranges for SQL values are as follows:

  • 5.4E-79 to 7.2E+75 for FLOAT values
  • -(10°° -1) to +(10°° -1) for DECIMAL values
  • -2147483648 to 2147483647 for INTEGER values
  • -32768 to +32767 for small integer (SMALLINT) values.

System Action: The statement cannot be executed.

Programmer Response: The value of the literal should be reduced to the appropriate size for this data type.

SQLSTATE: 53020


SQL Code -406
A CALCULATED OR DERIVED NUMERIC VALUE IS NOT WITHIN THE RANGE OF ITS OBJECT COLUMN

Explanation: A value derived or calculated during processing of the SQL statement was outside the range of the data type of its object column. This problem might have arisen because either the values occurring in the object column were out of range, or the SQL operation performed was not appropriate for the values in the object column.

System Action: The statement cannot be executed.

Programmer Response: See the explanation of SQLCODE -405 for allowed ranges for numeric data types.

SQLSTATE: 22003


SQL Code -407
AN UPDATE OR INSERT VALUE IS NULL, BUT THE OBJECT COLUMN column-name CANNOT CONTAIN NULL VALUES

Explanation: The update or insert value was NULL, but the object column was declared as NOT NULL in the table definition.

Consequently:

  • Null values cannot be inserted into that column.
  • Values in that column cannot be set to NULL by an update.

System Action: The statement cannot be executed.

Note: 'column-name' may or may not be returned in SQLCA, depending on the syntax of the SQL statement in which the error was detected.

Programmer Response: Examine the definition of the object table to determine which columns of the table have the NOT NULL attribute, and correct the SQL statement accordingly.

SQLSTATE: 23502


SQL Code -408
AN UPDATE OR INSERT VALUE IS NOT COMPARABLE WITH THE DATA TYPE OF ITS OBJECT COLUMN column-name

Explanation: The data type of the value to be inserted into or set in the column 'column-name' by an INSERT or UPDATE statement is incompatible with the declared data type of that column. Both must be numeric or both must be graphic string; or both must be either:

  • Dates or character
  • Times or character
  • Timestamps or character.

However, dates, times, or timestamps cannot be assigned to a character column that has a field procedure.

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

Programmer Response: Examine the current definition for the object table, and ensure that the host variable or literal value assigned to the specified column has the proper data type.

SQLSTATE: 53021


SQL Code -409
INVALID OPERAND OF A COUNT FUNCTION

Explanation: The operand of the COUNT function in the statement violates SQL syntax. A common error is a column name or other expression without DISTINCT.

System Action: The statement cannot be executed.

Programmer Response: Correct the syntax and resubmit the statement. Refer to Chapter 4 of SQL Reference for information about the proper form for the operands of a COUNT function.

SQLSTATE: 37507


SQL Code -410
THE FLOATING POINT LITERAL literal CONTAINS MORE THAN 30 CHARACTERS

Explanation: The specified floating-point literal is more than 30 characters in length. A floating-point literal has a maximum length of 30 characters.

System Action: The statement cannot be executed.

Programmer Response: Correct the indicated literal.

SQLSTATE: 53020


SQL Code -411
CURRENT SQLID CANNOT BE USED IN A STATEMENT THAT REFERENCES REMOTE OBJECTS

Explanation: A reference to the CURRENT SQLID special register is invalid in a statement that contains the three-part name or alias of an object that is remote to the remote server.

System Action: The statement cannot be executed.

Programmer Response: Either remove the reference to CURRENT SQLID or the reference to the remote object.

SQLSTATE: 56040


SQL Code -412
THE SELECT CLAUSE OF A SUBQUERY SPECIFIES MULTIPLE COLUMNS

Explanation: In the context in which it was used in the SQL statement, the subquery can have only one column specified in its SELECT clause.

System Action: The statement cannot be executed.

Programmer Response: Correct the syntax of the SQL statement. Refer to SQL Reference for information about restrictions on the syntax for subqueries.

SQLSTATE: 53023


SQL Code -414
A LIKE PREDICATE IS INVALID BECAUSE THE FIRST OPERAND IS NOT A STRING

Explanation: The data type of the first operand of the LIKE predicate must be a character string or graphic string.

System Action: The statement cannot be executed.

Programmer Response: Respecify the predicate so that the data type of each operand is a character string or a graphic string.

SQLSTATE: 53024


SQL Code -415
THE CORRESPONDING COLUMNS, column-number, OF THE OPERANDS OF A UNION OR A UNION ALL DO NOT HAVE COMPARABLE COLUMN DESCRIPTIONS UNION OR A UNION ALL DO NOT HAVE COMPARABLE COLUMN DESCRIPTIONS

Explanation: The column descriptions of corresponding columns of the operands of a UNION or UNION ALL must be comparable. The columns of ordinality 'column-number' of the operands in this UNION or UNION ALL do not satisfy this requirement. For columns to be comparable, they must both be either numeric, character, graphic, date, time, or timestamp. They cannot be a mixture of these groups. If corresponding columns have field procedures, they must both have the same field procedure.

System Action: The statement cannot be executed.

Programmer Response: Check the data types of the specified columns and correct the UNION or UNION ALL statement so that all corresponding columns have comparable column descriptions.

SQLSTATE: 53025


SQL Code -416
AN OPERAND OF A UNION CONTAINS A LONG STRING COLUMN

Explanation: The UNION specified in the SQL statement could not be performed because one of the tables participating in the union contains a long string column (for example, a VARCHAR column with length greater than 254). The operands of a UNION cannot contain long string columns.

System Action: The statement cannot be executed.

Programmer Response: The implied function is not supported by DB2. Refer to Chapter 3 of SQL Reference for information about restrictions on the manipulation of long string columns.

SQLSTATE: 56007


SQL Code -417
A STATEMENT STRING TO BE PREPARED INCLUDES PARAMETER MARKERS AS THE OPERANDS OF THE SAME OPERATOR

Explanation: The statement string specified as the object of a PREPARE contains a predicate or expression where parameter markers have been used as operands of the same operator--for example:
? > ?
This syntax is not permitted.

System Action: The statement cannot be executed.

Programmer Response: Correct the logic of the application program so that this syntax error does not occur. Refer to Chapter 6 of SQL Reference for information about the proper usage of parameter markers within SQL statements to be prepared.

SQLSTATE: 37509


SQL Code -418
A STATEMENT STRING TO BE PREPARED CONTAINS AN INVALID USE OF PARAMETER MARKERS

Explanation: Parameter markers cannot be used in the SELECT list, as the sole argument of a scalar function, or in a concatenation operation. Parameter markers cannot be used in the string expression of an EXECUTE IMMEDIATE SQL statement.

System Action: The statement cannot be executed.

Programmer Response: Correct the logic of the application program so that this error does not occur. Refer to Chapter 6 of SQL Reference for information about the proper usage of parameter markers within SQL statements and for EXECUTE IMMEDIATE SQL statement restrictions.

SQLSTATE: 37510


SQL Code -419
THE DECIMAL DIVIDE OPERATION IS INVALID BECAUSE THE RESULT WOULD HAVE A NEGATIVE SCALE

Explanation: The decimal division is invalid because it will result in a negative scale.

The formula used internally to calculate the scale of the result for decimal division is explained in SQL Reference.

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

Programmer Response: Examine the precision and scale of all columns that may have participated in a decimal division. Note that an integer or small integer value may have been converted to decimal for this calculation.

SQLSTATE: 56011


SQL Code -421
THE OPERANDS OF A UNION OR UNION ALL DO NOT HAVE THE SAME NUMBER OF COLUMNS

Explanation: The operands of a UNION or UNION ALL must have the same number of columns.

System Action: The statement cannot be executed.

Programmer Response: Correct the SQL statement so that there are exactly the same number of columns in each operand.

SQLSTATE: 53026


SQL Code -426
DYNAMIC COMMIT NOT VALID AT AN APPLICATION SERVER WHERE UPDATES ARE NOT ALLOWED

Explanation: An application executing using DRDA protocols has attempted to issue a dynamic COMMIT statement while connected to a location at which updates are not allowed. A dynamic COMMIT may be issued only while connected to a location at which updates are allowed.

System Action: The statement cannot be executed. No COMMIT is performed.

Programmer Response: The IMS/VS or CICS protocols should be used to commit work in these environments.

SQLSTATE: 56028


SQL Code -427
DYNAMIC ROLLBACK NOT VALID AT AN APPLICATION SERVER WHERE UPDATES ARE NOT ALLOWED

Explanation: An application executing using DRDA protocols has attempted to issue a dynamic ROLLBACK statement while connected to a location at which updates are not allowed. A dynamic ROLLBACK may be issued only while connected to a location at which updates are allowed.

System Action: The statement cannot be executed. No ROLLBACK is performed.

Programmer Response: The IMS/VS or CICS protocols should be used to rollback work in these environments.

SQLSTATE: 56029