DB2 SQL Errors Codes and Error Messages and Warnings from Error -102 to -104

SQLServerF1

Error: DB2 SQL Error: SQLCODE=-102, SQLSTATE=54002, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
STRING CONSTANT IS TOO LONG.
STRING BEGINS string
Explanation: The string constant beginning with string
has a length greater than the maximum allowed length.
Most strings have these limits:
v For a hexadecimal constant (X, GX, or UX), the
number of hexadecimal digits must not exceed 32704.
v Any other character string constant must be short
enough so that its UTF-8 representation requires no
more than 32704 bytes.
v Any other graphic string constant must be short
enough so that its UTF-8 representation requires no
more than 32704 bytes.
v The sum of the lengths of the UTF-8 representations
of the constant values in an ENDING AT clause must
not exceed 765 bytes. This clause applies to CREATE
TABLE, ALTER TABLE, CREATE INDEX, or ALTER
INDEX.
In some contexts, however, the limit is smaller; see the
SQL Reference for the specific cases.
For special registers, the allowable length depends on
the particular special register. A string that exceeds the
limit can be specified only through assignment from a
host variable.
Two consecutive string delimiters are used to represent
one string delimiter within the character string, but
these count as 2 bytes when calculating the lengths of
character string constants.
System action: The statement cannot be executed.
Programmer response: The requested function is not
available interactively. If the error occurred in the
context of an SQL statement embedded in an
application program, the desired result can be achieved
by assigning the long string to a host variable, and
substituting that variable for the string constant in the
SQL statement.
SQLSTATE: 54002

Error: DB2 SQL Error: SQLCODE=-103, SQLSTATE=42604, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
constant IS AN INVALID NUMERIC
CONSTANT
Explanation: The indicated constant begins with a
digit, but is not a valid integer, decimal, decimal
floating point, or float constant.
System action: The statement cannot be executed.
Programmer response: Correct the invalid constant.
SQLSTATE: 42604

Error: DB2 SQL Error: SQLCODE=-104, SQLSTATE=42601, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
ILLEGAL SYMBOL “token”. SOME
SYMBOLS THAT MIGHT BE LEGAL
ARE: token-list
Explanation: A syntax error was detected where the
symbol “token” occurs in the SQL statement. The list of
symbols that might be legal shows some alternate
symbols that could possibly be correct at that point, if
the preceding part of the statement is entirely correct.
However, the preceding part of the statement might be
incorrect. For example, if an important keyword is
omitted, DB2 detects the error later, and not always
immediately after the point where the keyword should
appear. The list of alternate symbols are only
suggestions. Some of those symbols might not even be
legal for statements to be executed by DB2. Those
symbols are possibly correct for statements sent to
other database management systems.
This SQLCODE will also be issued if the RELEASE TO
SAVEPOINT statement is specified without a savepoint
name.
System action: The statement cannot be executed.
Programmer response: Correct the statement and
execute it again.
SQLSTATE: 42601

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