How to Resolve -206 SQL Error Object-Not-Valid in DB2

In DB2, you will receive an error -206 during SELECT, INSERT, DELETE, UPDATE and MERGE SQL queries. The reason is the column name specified in the query not belongs to any Table. The SQLSTAE would be 42703.

Advertisements

This error you will also get during CREATE FUNCTION, ALTER FUNCTION, CREATE PROCEDURE or ALTER PROCEDURE.

Possible Reasons

  • The specified name is not a column of any of the source or target tables or views of the statement.
  • In a SELECT or DELETE statement, the specified name is not a column of any of the tables or views that are identified in a FROM clause in the statement.
  • In an INSERT, UPDATE, or MERGE statement, the specified name is not a column of the table, or view that was specified as the target of the data change statement.
  • A column list of an SQL data change statement specified a name that is not a column of the target table or view of the statement.

Resolution

  • Ensure that the Columns/Tables that mentioned the SQL query are available.
  • For a SELECT INTO statement, make sure that the index of an array element is not specified as a column in the INTO clause.

Related Posts

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.