要保证delete的行与UPDATE的行不冲突。
解决方案 »
- Oracle存储过程-出错,急
- 查询连续为空的记录
- 我在erp里执行一个查询,可是在v$sql里监控不到语句
- oracle 数据库的小问题
- oracle8i16总安装失败
- JOB调用报错,请大家帮我看看,分数不是问题。
- orcle 用户数的问题
- 请问在一条SQL语句中可以完成吗!!!!!
- Oracle listener中 ipc性能问题
- Oracle数据库,select某些表超级慢
- select seq_aa.nextval from dual;我在jdbc里如何把该直取回并变成long型?
- 抢分了 ! 如何通过SQL语句得到类似于Listener.log文件中的信息 , 包括登入用户名, 登入program ,ip , pc机器名 , 登入时间 ,所做的动作(s
2 before update or delete on a
3 for each row
4 begin
5 if updating then
6 delete from a where id=:new.id;
7 else
8 null;
9 end if;
10 end;
11 /Trigger createdSQL> update a set name='ddd';update a set name='ddd'ORA-04091: 表 ECSQUERY.A 发生了变化,触发器/函数不能读
ORA-06512: 在"ECSQUERY.A_TRI", line 3
ORA-04088: 触发器 'ECSQUERY.A_TRI' 执行过程中出错
SQL> insert into t values(3);
commitcreate or replace trigger t_t before update on t for each row
declare
pragma autonomous_transaction;
begin
if :new.n=2 then
delete from t where n=1;
end if;
commit;
end;
/
触发器已创建SQL> update t set n=2 where n=3;已更新 1 行。SQL> select * from t; N
----------
2