DB2 SQL Errors Codes and Error Messages and Warnings from Error -153 to -156

SQLServerF1

Error: DB2 SQL Error: SQLCODE=-153, SQLSTATE=42908, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE STATEMENT IS INVALID
BECAUSE THE VIEW OR TABLE
DEFINITION DOES NOT INCLUDE A
UNIQUE NAME FOR EACH COLUMN
Explanation: You must specify a list of column names
if the result table of the fullselect that is specified in the
CREATE VIEW, CREATE TABLE, or DECLARE
GLOBAL TEMPORARY TABLE statement has duplicate
column names or an unnamed column (a column from
a constant, function, or expression).
System action: The statement cannot be executed. The
specified view or table was not created, or the declared
temporary table was not declared.
Programmer response: Correct the statement by
providing a list of names for the columns of the view
or table. Refer to chapter 2 of SQL Reference for
information about the syntax of the CREATE VIEW
statement, the CREATE TABLE statement, or the
DECLARE GLOBAL TEMPORARY TABLE statement.
SQLSTATE: 42908

Error: DB2 SQL Error: SQLCODE=-154, SQLSTATE=42909, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE STATEMENT FAILED BECAUSE
VIEW OR TABLE DEFINITION IS NOT
VALID
Explanation: The view defined in the CREATE VIEW
statement, the table defined in the CREATE TABLE
statement, or the table declared in the DECLARE
GLOBAL TEMPORARY TABLE statement is not valid
because the view or table definition references a remote
object.
System action: The statement cannot be executed. The
specified object is not defined.
Programmer response: Refer to Chapter 3 of SQL
Reference for information about restrictions on the
definitions for views, materialized query tables, or
declared temporary tables.
SQLSTATE: 42909

Error: DB2 SQL Error: SQLCODE=-156, SQLSTATE=42809, SQLERRMC=TBSPACEID=, TABLEID=, COLNO=, DRIVER=
THE STATEMENT DOES NOT
IDENTIFY A TABLE
Explanation: The statements ALTER TABLE, DROP
TABLE, LOCK TABLE, CREATE INDEX, and CREATE
TRIGGER apply only to tables. Indexes and triggers
can be defined only on tables. Additionally, a DROP
TABLE SQL statement cannot be used to drop a clone
table.
System action: The statement cannot be executed. The
specified view or remote object was not altered,
dropped, or locked, or the index or trigger was not
created.
Programmer response: Verify that the proper name
was specified in the statement.
SQLSTATE: 42809

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