DB2 SQL Errors Codes and Error Messages and Warnings from Error -419 to -421

SQLServerF1

Error: DB2 SQL Error: SQLCODE=-419, SQLSTATE=42911, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
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 chapter 3
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 might have participated in a
decimal division. Note that an integer or small integer
value might have been converted to decimal for this
calculation.
A value of YES for field MINIMUM DIVIDE SCALE on
installation panel DSNTIPF specifies that the scale of
the result of a decimal division is never less than 3.
SQLSTATE: 42911

Error: DB2 SQL Error: SQLCODE=-420, SQLSTATE=22018, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE VALUE OF A STRING
ARGUMENT WAS NOT ACCEPTABLE
TO THE function-name FUNCTION
Explanation: A string argument did not conform to
the requirements of the function. For example, a
character string passed to the DECIMAL function did
not conform to the rules for forming an SQL integer or
decimal constant.
System action: The statement cannot be processed.
Programmer response: Change the argument value so
that it conforms to the requirements of the function as
specified in SQL Reference.
SQLSTATE: 22018

Error: DB2 SQL Error: SQLCODE=-421, SQLSTATE=42826, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE OPERANDS OF A SET
OPERATOR DO NOT HAVE THE
SAME NUMBER OF COLUMNS
Explanation: The operands of a set operator, such as
UNION, EXCEPT, or INTERSECT, must have the same
number of columns.
System action: The statement cannot be processed.
Programmer response: Correct the SQL statement so
that there are exactly the same number of columns.
SQLSTATE: 42826

Above are list of DB2 SQL Errors and Warnings from Error -419 to -421 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 *