Restricted Statements in Multistatement Prepared Objects

In addition to the statements listed as exceptions in Restricted Statements in Single-Statement Prepares, you cannot use the following statements in the text of a multiple-statement prepared object:
  • CLOSE DATABASE
  • CREATE DATABASE
  • DATABASE
  • DROP DATABASE
  • RENAME DATABASE
  • SELECT (with one exception)
The following types of statements are also not valid in a multistatement prepare:
  • Statements that can cause the current database to close during the execution of the multistatement sequence
  • Statements that include references to TEXT or BYTE host variables

In general, you cannot use the SELECT statement in a multistatement prepare. The only form of the SELECT statement allowed in a multistatement prepare is a SELECT statement with an INTO temporary table clause.