DB2 SQL Errors Codes and Error Messages and Warnings from Error -186 to -188

SQLServerF1

Error: DB2 SQL Error: SQLCODE=-186, SQLSTATE=22505, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE LOCAL DATE LENGTH OR
LOCAL TIME LENGTH HAS BEEN
INCREASED AND EXECUTING
PROGRAM RELIES ON THE OLD
LENGTH
Explanation: The local format option has been used
with a datetime value and DB2 has discovered that the
datetime exit routine has been changed to produce a
longer local format.
System action: The statement cannot be executed.
Programmer response: If the statement receiving this
error is embedded in the application program, then a
REBIND command must be issued for the application
plan. If the statement was dynamic SQL, then the
statement can be reentered.
SQLSTATE: 22505

Error: DB2 SQL Error: SQLCODE=-187, SQLSTATE=22506, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
A REFERENCE TO A CURRENT
DATETIME SPECIAL REGISTER IS
INVALID BECAUSE THE MVS TOD
CLOCK IS BAD OR THE MVS
PARMTZ IS OUT OF RANGE
Explanation: DB2 has encountered an invalid
time-of-day (TOD) clock. The user referenced one of the
special registers: CURRENT DATE, CURRENT TIME,
CURRENT TIMESTAMP, or CURRENT TIMEZONE. If
the user referenced CURRENT TIMEZONE, the MVS
parameter PARMTZ was out of range.
System action: The statement cannot be executed.
Programmer response: For CURRENT TIMEZONE,
check that the MVS parameter PARMTZ is between -24
and +24 hours. For the other CURRENT special
registers, check that the MVS TOD clock has been set
correctly.
SQLSTATE: 22506

Error: DB2 SQL Error: SQLCODE=-188, SQLSTATE=22503, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE STRING REPRESENTATION OF A
NAME IS INVALID
Explanation: The host variable referenced in the
DESCRIBE statement does not contain a valid string
representation of a name. One of the following error
conditions has occurred.
v The first byte of the variable is a period or a blank.
v The number of identifiers is greater than 3.
v An identifier is too long.
v A period not contained in a delimited identifier is
followed by a period or a blank.
v A delimited identifier is followed by a character
other than a period or a blank.
v A delimited identifier is not terminated by a
quotation mark.
System action: The statement cannot be executed.
Programmer response: Correct the value of the host
variable so that it is a valid string representation of a
name.
SQLSTATE: 22503

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