-20186   A CLAUSE SPECIFIED FOR THE DYNAMIC SQL STATEMENT BEING PROCESSED IS NOT VALID

Explanation

A clause was not valid for one of the following reasons:

On a PREPARE statement:
  • A FOR SINGLE ROW or FOR MULTIPLE ROWS clause was specified. However, the statement that was being prepared was not an INSERT with a multiple-row-insert clause or a MERGE statement.
  • An ATOMIC or NOT ATOMIC clause was specified. However, the statement that was being prepared was not an INSERT statement with a multiple-row-insert clause.
  • A rowset-positioning clause was specified. However, the statement that was being prepared was not a select-statement.
  • A SENSITIVE DYNAMIC clause and SCROLL clause were specified. However, the content of the query requires the use of a temporary table for processing.
  • A SENSITIVE DYNAMIC clause and a FETCH FIRST n ROWS ONLY clause were specified for the outermost subselect.
On an EXECUTE statement:
  • A source-row-data clause was specified. However, the statement that was being executed was not an INSERT with a multiple-row-insert clause or a MERGE statement.
  • A source-row-data clause was not specified. However, the statement that was being executed was an INSERT with a multiple-row-insert clause or MERGE statement and FOR MULTIPLE ROWS was specified as part of the ATTRIBUTES clause on the PREPARE statement.
  • A multiple-row-insert clause was specified. However, the statement that was being executed was not an INSERT statement with a multiple-row-insert clause.
  • A multiple-row-insert clause was specified. However, the statement that was being executed was not an INSERT statement with a multiple-row-insert clause that was prepared with FOR MULTIPLE ROWS specified as part of the ATTRIBUTES clause on the PREPARE statement.
  • A FOR n ROWS clause was specified. However, the INSERT statement or the MERGE statement that was being executed also contained a FOR n ROWS clause.
  • Host variable arrays were provided. However, the FOR n ROWS clause was not specified (on either the EXECUTE or INSERT or MERGE statement).

System action

The statement cannot be processed.

Programmer response

Remove the clause that was not valid in the context in which it was used.

SQLSTATE

07501