存储过程中运行alter table出现如下错误:
Compilation errors for PROCEDURE PDS.UNDOMERCHANTACCOUNT
Error: PLS-00103: Encountered the symbol "ALTER" when expecting one of the following:
begin case declare end exception exit for goto if loop mod
null pragma raise return select update while with
<an identifier> <a double-quoted delimited-identifier>
<a bind variable> << close current delete fetch lock insert
open rollback savepoint set sql execute commit forall merge
pipe
Line: 21
Text: alter table TBL_TEST storage(buffer_pool default);
Error: PLS-00103: Encountered the symbol "ALTER" when expecting one of the following:
begin case declare end exception exit for goto if loop mod
null pragma raise return select update while with
<an identifier> <a double-quoted delimited-identifier>
<a bind variable> << close current delete fetch lock insert
open rollback savepoint set sql execute commit forall merge
pipe
Line: 21
Text: alter table TBL_TEST storage(buffer_pool default);
解决方法:
动态SQL:
execute immediate 'alter table xxx';