DB2 SQL Errors Codes and Error Messages and Warnings from Error -127 to -129

SQLServerF1

Error: DB2 SQL Error: SQLCODE=-127, SQLSTATE=42905, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
DISTINCT IS SPECIFIED MORE
THAN ONCE IN A SUBSELECT
Explanation: The DISTINCT qualifier can be used
only once in a SELECT statement or a subselect.
System action: The statement cannot be executed.
Programmer response: The implied function is not
supported by DB2. Refer to chapter 4 of SQL Reference
for information about restriction on the use of the
DISTINCT qualifier.
SQLSTATE: 42905

Error: DB2 SQL Error: SQLCODE=-128, SQLSTATE=42601, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
INVALID USE OF NULL IN A
PREDICATE
Explanation: The use of NULL in the search condition
does not conform to the rules of SQL syntax.
System action: The statement cannot be executed.
Programmer response: The implied function is not
supported by DB2. Refer to chapter 2 of SQL Reference
for information about the proper use of the NULL
operand.
SQLSTATE: 42601

Error: DB2 SQL Error: SQLCODE=-129, SQLSTATE=54004, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE STATEMENT CONTAINS TOO
MANY TABLE NAMES
Explanation: A subselect (including all subqueries) can
have a maximum of 225 references to table names.
System action: The statement cannot be executed.
Programmer response: Break the SQL statement into
two or more simpler statements with less than 225 table
references in each. The count will include the number
of base table occurrences from each table or view on
the FROM list. Refer to chapter 4 of SQL Reference for
the definition of a subselect.
SQLSTATE: 54004

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