出现符号"INSERT"在需要下列之一时

yongchaochu 2012-04-13 01:12:26
存储过程脚本代码如下:

create or replace procedure "bak_Info_Pro"
is
/*--str_sql varchar2(500);*/
begin
insert into t_hp_tips_bak select * from t_hp_tips t where t.invalid_date<sysdate;

/*判断是否插入备份表成功,若成功则删除原表中过期记录
--execurte immediate str_sql;*/

delete from t_hp_tips t where t.invalid_date<sysdate;
commit;
Exception
when others then
rollback;
end bak_Info_Pro;



错误提示如下:PROCEDURE HUIFU2.BAK_INFO_PRO 编译错误

错误:PLS-00103: 出现符号 "INSERT"在需要下列之一时:
( ; is with authid as
cluster compress order using compiled wrapped external
deterministic parallel_enable pipelined
行:5
文本:str_sql:='insert into t_hp_tips_bak select * from t_hp_tips t where t.invalid_date<sysdate';
...全文
266 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
forgetsam 2012-04-14
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 的回复:]

我是刚学oracle的菜鸟。我想问下:insert into 关键字不需要 values关键字的吗?
[/Quote]

多行插入不需要
C____1988 2012-04-13
  • 打赏
  • 举报
回复
我是刚学oracle的菜鸟。我想问下:insert into 关键字不需要 values关键字的吗?
啊彪123 2012-04-13
  • 打赏
  • 举报
回复
弄的我有个错误的保存了,删都删不了!
ssqtjffcu 2012-04-13
  • 打赏
  • 举报
回复
create or replace procedure bak_Info_Pro is --过程名不需要用分号引住
/*--str_sql varchar2(500);*/
begin
insert into t_hp_tips_bak
select * from t_hp_tips t where t.invalid_date < sysdate;


/*判断是否插入备份表成功,若成功则删除原表中过期记录
--execurte immediate str_sql;*/

delete from t_hp_tips t where t.invalid_date < sysdate;
commit;
Exception
when others then
rollback;
end bak_Info_Pro;
forgetsam 2012-04-13
  • 打赏
  • 举报
回复
你贴的代码和你报错的代码在两个不同的存储过程中,你找对了地方再说。

17,382

社区成员

发帖
与我相关
我的任务
社区描述
Oracle 基础和管理
社区管理员
  • 基础和管理社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧