-840   TOO MANY ITEMS RETURNED IN A SELECT OR INSERT LIST

Explanation

The number of items returned in the SELECT list or presented in an insert list exceeds the allowable maximum of 750.

System action

The statement cannot be processed.

Programmer response

Determine whether all the information is actually needed. For example, the number of items that are returned by the SQL statement SELECT * FROM A, B, C is the sum of the number of columns in all three tables. Not all column data might be needed.

Rewrite the SQL statement so that only the necessary items of information are returned, or break the SQL statement into two or more statements.

SQLSTATE

54004