create or replace trigger "WWW"."TRIGGER_UPDATEJIVEUSER" AFTER
INSERT OR UPDATE OR DELETE ON "WORKER_MESSAGE" FOR EACH ROW
BEGIN
delete jiveuser where username = ld.work_id;
insert into jiveUser (
userID,name,username,passwordHash,email,emailVisible,
nameVisible,creationDate,modifiedDate,rewardPoints
)
select seqJiveUserId.nextval,work_name,work_id,pass_word,
'guest@chinamobile.com.cn',1,1,'0','0',0
from worker_message
where work_id = :new.work_id;
当执行delete worker_message where work_id = 'A00000';时错误如下:
END TRIGGER_UPDATEJIVEUSER;
ORA-04091: table WWW.WORKER_MESSAGE is mutating, trigger/function may not see
it
ORA-06512: at "WWW.TRIGGER_UPDATEJIVEUSER", line 6
ORA-04088: error during execution of trigger 'WWW.TRIGGER_UPDATEJIVEUSER'作者: zhhlv 时间: 2004-01-15 18:09 标题: 新手,请教一个触发器问题! insert into jiveUser (
userID,name,username,passwordHash,email,emailVisible,
nameVisible,creationDate,modifiedDate,rewardPoints
)
select seqJiveUserId.nextval,work_name,work_id,pass_word,
'guest@chinamobile.com.cn',1,1,'0','0',0
from worker_message
where work_id = :new.work_id;