一个触发器的问题,高手帮帮忙~

waitdream 2011-08-01 04:06:29

create or replace trigger TRI_w_user_AFR

  after insert or update or delete on sn_w_user

  for each row

  
begin

  if deleting then


  delete from w_user where USER_ID=:old.USER_ID;

  end if;

  if inserting then

  insert into w_user(USER_ID,USER_LOGIN_NAME,USER_NAME,USER_TYPE,PASSWORD,CA,DEPARTMENT_ID,IS_DELETE)

  values(:new.USER_ID,:new.USER_LOGIN_NAME,:new.USER_NAME,:new.USER_TYPE,:new.PASSWORD,:new.CA,:new.DEPARTMENT_ID,:new.IS_DELETE);

  end if;

  if updating then

  update w_user set USER_LOGIN_NAME=:new.USER_LOGIN_NAME,USER_NAME=:new.USER_NAME,USER_TYPE=:new.USER_TYPE,PASSWORD=:new.PASSWORD,CA=:new.CA,DEPARTMENT_ID=:new.DEPARTMENT_ID,IS_DELETE=:new.IS_DELETE where USER_ID=:old.USER_ID;

  end if;

end TRI_w_user_AFR;


如上代码,一个数据同步的触发器,可是用PLSQL编译的时候,走到if deleting then这一行当时候,提示错误信息:
TRIGGER DB_XYSI.TRI_W_USER_AFR 编译错误

错误:PLS-00103: 出现符号 ""在需要下列之一时:
begin case declare 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
行:3
文本:  after insert or update or delete on sn_w_user

求高手解决啊~
...全文
41 点赞 收藏 2
写回复
2 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
escmfack 2011-08-01
收分来了
回复
waitdream 2011-08-01
已经解决了~
回复
相关推荐
发帖
Oracle 高级技术
创建于2007-09-28

3427

社区成员

Oracle 高级技术相关讨论专区
申请成为版主
帖子事件
创建了帖子
2011-08-01 04:06
社区公告
暂无公告