执行oracle存储过程,总是出现Warning: Procedure created with compilation errors错误,求高手指点

存储过程
create or replace procedure deleteData
AS
begin
TRUNCATE TABLE TEMP;
COMMIT;
end deleteData;
执行后报错:
Warning: Procedure created with compilation errors
show error显示:
LINE/COL ERROR
-------- ------------------------------------------------------------------------------------------------------------------------------------------------------------
4/11 PLS-00103: Encountered the symbol "TABLE" when expecting one of the following: := . ( @ % ; The symbol ":= was inserted before "TABLE" to continue.
求大神指点!!!!急急急!!!!

这个存储过程有问题,TRUNCATE TABLE不能这样在存储过程里面执行,可以写成:

 EXECUTE IMMEDIATE TRUNCATE TABLE TEMP;

才能执行.

温馨提示:答案为网友推荐,仅供参考
相似回答