DB2 SQL Errors Codes and Error Messages and Warnings from Error -579 to -581

SQLServerF1

Error: DB2 SQL Error: SQLCODE=-582, SQLSTATE=42625, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE SEARCH-CONDITION IN A
SEARCHED-WHEN-CLAUSE CANNOT
BE A QUANTIFIED PREDICATE, IN
PREDICATE, OR AN EXISTS
PREDICATE.
Explanation: The search-condition in a
searched-when-clause specifies a quantified predicate, an
IN predicate, or an EXISTS predicate, but is not
allowed. However, an IN predicate is allowed within a
select list or VALUES clause if that IN predicate
explicitly includes a list of expressions.
System action: The statement cannot be processed.
Programmer response: Correct the search-condition.
SQLSTATE: 42625

Error: DB2 SQL Error: SQLCODE=-583, SQLSTATE=24520, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE USE OF FUNCTION OR
EXPRESSION name IS INVALID
BECAUSE IT IS NOT DETERMINISTIC
OR HAS AN EXTERNAL ACTION
Explanation: The function name is defined as a
non-deterministic function or a function with an
external action, or the expression name is defined as a
non-deterministic expression. This type of function or
expression is not supported in the context in which it is
used. The contexts in which these are not valid are:
v In the expression prior to the first WHEN keyword
in a simple-case-expression.
v In the WHERE clause of the subselect in a CREATE
VIEW statement if the WITH CHECK OPTION is
specified.
v in an expression of an ORDER BY clause
v in a key-expression of an index definition
v in an expression of a GROUP BY clause
System action: The statement cannot be executed.
Programmer response: If the use of a
non-deterministic or external action function or
expression was not intended, substitute a function or
expression without these characteristics. If the behavior
associated with the non-deterministic or external action
function or expression is intentional, use the alternate
form of the statements that make that intent explicit.
v Instead of a simple-when-clause, use the
corresponding searched-when-clause where the
function or expression would be specified in each
search-condition.
v Remove the WITH CHECK OPTION from the
CREATE VIEW statement.
v Remove the function or expression from the GROUP
BY clause.
v Remove the function or expression from the ORDER
BY clause. If the column is part of the result set of
the query, change the expression in the ORDER BY
clause to the simple-integer or simple-column-name
form of the sort key.
System action: The statement cannot be processed.
Programmer response: Issue a FETCH statement to
position the cursor on the desired rowset, and then
reissue the positioned DELETE or UPDATE statement.
If the cursor is not defined for rowset access, redefine
the cursor first.
SQLSTATE: 24520

Error: DB2 SQL Error: SQLCODE=-584, SQLSTATE=42608, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
INVALID USE OF NULL
Explanation: When the NULL keyword is provided in
the USING source-table clause of the MERGE statement,
it must be explicitly cast to a supported data type.
System action: The statement cannot be processed.
User response: Specify the NULL keyword within a
CAST expression when using NULL within the USING
VALUES clause of the MERGE statement.
SQLSTATE: 42608
Above are list of DB2 SQL Errors and Warnings from Error -582 to -584 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 *