DB2 SQL Errors Codes and Error Messages and Warnings from Error -400 to -402

SQLServerF1

Error: DB2 SQL Error: SQLCODE=-400, SQLSTATE=54027, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE CATALOG HAS THE MAXIMUM
NUMBER OF USER DEFINED
INDEXES
Explanation: No more than 500 user-defined indexes
can be created in the catalog database.
System action: The statement cannot be executed.
Programmer response: If this index must be created,
another user-defined index on the catalog must be
dropped. After that index is dropped, this statement
can be executed.
SQLSTATE: 54027

Error: DB2 SQL Error: SQLCODE=-401, SQLSTATE=42818, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE OPERANDS OF AN
ARITHMETIC OR COMPARISON
OPERATION ARE NOT COMPARABLE
Explanation: An arithmetic operation appearing
within the SQL statement contains a mixture of
numeric and non-numeric operands, or the operands of
a comparison operation are not compatible.
One reason for this error is that a field procedure exists
on one of the columns. If one column of arithmetic or
comparison operation is defined with a field procedure,
other columns in the operation must be defined with
the same field procedure.
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: 42818

Error: DB2 SQL Error: SQLCODE=-402, SQLSTATE=42819, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
AN ARITHMETIC FUNCTION OR
OPERATOR function-operator IS
APPLIED TO CHARACTER OR
DATETIME DATA
Explanation: A nonnumeric operand has been
specified for the arithmetic function or operator.
function-operator
The name of the arithmetic function or
operator.
System action: The statement was not executed.
Programmer response: Examine and correct the syntax
of the SQL statement so that all operands of the
specified function or operator are numeric.
SQLSTATE: 42819

Above are list of DB2 SQL Errors and Warnings from Error -400 to -402 received while performing certain operation against DB2 Database or related products.

SQLCODE – Regardless of whether the application program provides an SQLCA or a stand-alone variable, SQLCODE is set by DB2 after each SQL statement is
executed. DB2 conforms to the ISO/ANSI SQL standard as follows:
If SQLCODE = 0, execution was successful.
If SQLCODE > 0, execution was successful with a warning.
If SQLCODE < 0, execution was not successful.
SQLCODE = 100, “no data” was found. For example, a FETCH statement returned no data because the cursor was positioned after the last row of the result table.

SQLSTATE – SQLSTATE is also set by DB2 after the execution of each SQL statement. Thus, application programs can check the execution of SQL statements by testing SQLSTATE instead of SQLCODE.

Hope this was helpful.

Thanks,
SQLServerF1 Team
Information about DB2 SQL Error Codes and Error Messages on Windows, Linux and Z/OS Operating Systems.

 

Leave a Reply

Your email address will not be published. Required fields are marked *