I found following description in
IBM DB2 9.7 for LUW SQL Reference, Volume 2 ---> SQL statements ---> Compound SQL (compiled) ---> Description --->
SQL-statement
Quote:
The following executable statements are not supported in stand-alone
compound SQL (compiled) statements, but are supported in compound
SQL (compiled) statements used within an SQL function, SQL procedure,
or trigger:
v CREATE of an index, table, or view
v DROP of an index, table, or view
v GRANT
v ROLLBACK
|
So, you can't execute the code as stand-alone SQL statements.
Put the code in an SQL function or SQL procedure.