trigger问题

stckiss 2007-01-15 04:44:33
reate or replace trigger trg_task
after before delete or update on tasktab
for each row

begin
if deleting then --删除工单

dbms_output.put_line('deltering'||:new.taskid);

-- commit;
elsif updating then --更新工单

dbms_output.put_line('updating'||:new.taskid);
insert into histasktab(taskid,taskname,orgtime)values(:new.taskid,:new.taskname,:new.orgtime);
-- commit;
else
raise_application_error(-20001,'You should never ever get this error.');
end if;
这样写什么会有问题!~用before可以,但是取得是以前的老记录,我要取更新之后的记录!~

end tri_task;
...全文
160 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
stckiss 2007-01-15
  • 打赏
  • 举报
回复
不明白触发机制,表级触发还会有这样的限制?

17,377

社区成员

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

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