DB2 SQL Errors Codes and Error Messages and Warnings from Error -130 to -132

SQLServerF1

Error: DB2 SQL Error: SQLCODE=-130, SQLSTATE=22019, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE ESCAPE CLAUSE CONSISTS OF
MORE THAN ONE CHARACTER, OR
THE STRING PATTERN CONTAINS
AN INVALID OCCURRENCE OF THE
ESCAPE CHARACTER
Explanation: The ESCAPE character must be a single
character, either SBCS or DBCS as appropriate. For
‘column-name LIKE pattern’, the ESCAPE character can
only appear in the character string if it is followed by
itself, %, or _ (underscore). The Escape Clause cannot
be specified if the column name at the left of the LIKE
or NOT LIKE has the MIXED subtype.
System action: The statement cannot be executed.
Programmer response: Correct the string pattern, or
choose a different ESCAPE character and change the
pattern accordingly, or eliminate the use of the Escape
Clause on the LIKE or NOT LIKE predicate where the
column name to the left has the MIXED subtype.
SQLSTATE: 22019 if other than invalid ESCAPE
pattern. 22025 if invalid ESCAPE pattern.

Error: DB2 SQL Error: SQLCODE=-131, SQLSTATE=42818, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
STATEMENT WITH LIKE PREDICATE
HAS INCOMPATIBLE DATA TYPES
Explanation: If the column name at the left of LIKE or
NOT LIKE is of type character, the expression at the
right and the ESCAPE character must be of type
character. If the column name is of type graphic, the
expression at the right and the ESCAPE character must
be of type graphic. If the column data type is binary
string, the expression on the right and the ESCAPE
character must be binary strings.
System action: The statement cannot be executed.
Programmer response: Check the data type of every
operand.
SQLSTATE: 42818

Error: DB2 SQL Error: SQLCODE=-132, SQLSTATE=42824, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
AN OPERAND OF value IS NOT VALID
Explanation: The operation value can be the LIKE
predicate, the ESCAPE clause, the LOCATE scalar
function, the LOCATE_IN_STRING scalar function, the
POSITION scalar function, or the POSSTR scalar
function. The operand or argument of value was not
valid for one of the following reasons:
v The match-expression operand of a LIKE or NOT
LIKE predicate must be a string expression.
v The pattern-expression operand of the LIKE or NOT
LIKE predicate, or search-string argument of the
LOCATE, LOCATE_IN_STRING, POSITION, or
POSSTR function must be a string expression that
can be specified by any one of the following:
– A constant
– A special register
– A host variable (including a LOB locator variable)
– A scalar function whose arguments are any of the
above (though nested function invocations cannot
be used)
– A CAST specification whose arguments are any of
the above
– An expression that concatenates (using CONCAT
or ||) any of the above
v The source-string argument of the LOCATE,
LOCATE_IN_STRING, POSITION, or POSSTR
function must be a string expression that can be
specified by any of the following:
– A constant
– A special register
– A host variable (including a LOB locator variable)
– A scalar function whose arguments are any of the
above (though nested function invocations cannot
be used)
– A CAST specification whose arguments are any of
the above
– A column name
– An expression that concatenates (using CONCAT
or ||) any of the above
v The escape-expression operand of the LIKE or NOT
LIKE predicate must be a string expression that can
be specified by any of the following:
– A constant
– A host variable (including a LOB locator variable)
– A scalar function whose arguments are any of the
above (though nested function invocations cannot
be used)
– A CAST specification whose arguments are any of
the above
See the SQL Reference for the rules of what can be
specified in each context.
A LIKE predicate, ESCAPE clause, LOCATE scalar
function, LOCATE_IN_STRING scalar function,
POSITION scalar function, or POSSTR scalar function
cannot be used with DATE, TIME, or TIMESTAMP.
System action: The statement cannot be processed.
Programmer response: Check and correct the syntax
of the LIKE predicate, or LOCATE,
LOCATE_IN_STRING, POSITION, or POSSTR scalar
function.
SQLSTATE: 42824

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