logo  
Google
 

DB2 SQL-Error: -158

SQLState: 42811

Short Description: THE NUMBER OF COLUMNS SPECIFIED FOR THE VIEW OR TABLE IS NOT THE SAME AS THE NUMBER OF COLUMNS SPECIFIED BY THE FULLSELECT OR THE NUMBER OF COLUMNS SPECIFIED IN THE CORRELATION CLAUSE IN A FROM CLAUSE IS NOT THE SAME AS THE NUMBER OF COLUMNS IN THE CORRESPONDING TABLE VIEW TABLE EXPRESSION OR TABLE FUNCTION

There are three potential reasons for this SQL code: v The number of column names that are specified for a view in a CREATE VIEW statement must equal the number of elements that are specified in the SELECT clauses of the following fullselect. These elements may be column names, SQL functions, and expressions, for example. v The number of column names that are specified for a table in a CREATE TABLE statement must equal the number of columns in the result table of the following fullselect. v The number of column names that are specified in a correlation clause must equal the number of columns in the corresponding table, view, table expression or table function.System action: The statement cannot be executed. Programmer response: Correct the syntax of the statement to specify a column name for each column in the corresponding object (table, view, etc.). Refer to Chapter 5 of DB2 SQL Reference for information about the syntax of the statement.

 <-  BACK TO INDEX