DB2 SQL Errors Codes and Error Messages and Warnings from Error -007 to -011

SQLServerF1

Error: DB2 SQL Error: SQLCODE=-007, SQLSTATE=42601, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
STATEMENT CONTAINS THE
ILLEGAL CHARACTER character
Explanation: The specified ‘character’ is not a valid
character in SQL statements.
System action: The statement cannot be executed.
Programmer response: Correct the syntax and
resubmit the statement. Refer to chapter 2 of SQL
Reference for information about the valid SQL character
set.
SQLSTATE: 42601

Error: DB2 SQL Error: SQLCODE=-010, SQLSTATE=42603, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE STRING CONSTANT
BEGINNING string IS NOT
TERMINATED
Explanation: The statement contains a string constant,
beginning with ‘string’, that is not terminated properly.
System action: The statement cannot be executed.
Programmer response: Examine the statement for
missing quotation marks or apostrophes in the
indicated string constant.
SQLSTATE: 42603

Error: DB2 SQL Error: SQLCODE=-011, SQLSTATE=42601, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
COMMENT NOT CLOSED
Explanation: A comment is not closed correctly with a
comment delimiter. The comment is treated as if it were
closed by the end of source file.
System action: The statement cannot be executed.
User response: Ensure that the comment delimiter is
specified properly. This error is likely to cause other
errors. Some statements might not have been processed
as a result of a missing comment delimiter.
SQLSTATE: 42601

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