为什么sqlplus脚本中的execute immediate 'truncate table trade_economics';会给出以下错误?
BEGIN immediate 'truncate table trade_economics'; END;
*
ERROR at line 1:
ORA-06550: line 1, column 17:
PLS-00103: Encountered the symbol "truncate table trade_economics" when
expecting one of the following:
:= . ( @ % ;
The symbol ":=" was substituted for "truncate table trade_economics" to
continue.`发布于 2012-11-05 19:15:59
您需要在immediate之前添加execute才能使其工作。
类似于:
begin
execute immediate 'truncate table foo';
end;
/发布于 2014-04-25 18:04:52
截断是DDL (数据定义语言)。不能从PL/SQL中执行DDL。也就是说,您不能直接使用,但可以通过动态SQL实现。
所以
使用此命令:删除自
发布于 2018-04-18 20:45:43
此执行可以包含在过程中
EXECUTE IMMEDIATE ('truncate table name');
--next--
INSERT
/ * + append * /
INTO table ..https://stackoverflow.com/questions/13230941
复制相似问题