ORA-04091 错误,我换位思考的解决方法
2013-02-07 12:43
357 查看
table : id ,state ,update_date
当state修改时 修改当前的修改时间
网上大部分说什么记录到备份表,然后返写,感觉麻烦,还有什么自治事务 但是不能对当前表操作会造成死锁
红色部分为修改的解决方案.欢迎拍砖,
create or replace trigger service_order_update
after update on service_order
for each row
declare
begin
if updating then
if :new.state <> :old.state then
update service_order set update_date = sysdate where id =:old.id
end if;
end if;
end service_order_update;
create or replace trigger service_order_update
before update on service_order
for each row
declare
begin
if updating then
if :new.state <> :old.state then
:new.update_date := sysdate;
end if;
end if;
end service_order_update;
当state修改时 修改当前的修改时间
网上大部分说什么记录到备份表,然后返写,感觉麻烦,还有什么自治事务 但是不能对当前表操作会造成死锁
红色部分为修改的解决方案.欢迎拍砖,
create or replace trigger service_order_update
after update on service_order
for each row
declare
begin
if updating then
if :new.state <> :old.state then
update service_order set update_date = sysdate where id =:old.id
end if;
end if;
end service_order_update;
create or replace trigger service_order_update
before update on service_order
for each row
declare
begin
if updating then
if :new.state <> :old.state then
:new.update_date := sysdate;
end if;
end if;
end service_order_update;
相关文章推荐
- ORA-04091错误原因与解决方法
- 触发器中ORA-04091 变异表错误原因和一般解决方法
- ORA-04091错误原因与解决方法
- ORA-04091错误原因与解决方法
- ORA-04091错误原因与解决方法
- ORA-01589错误的解决方法
- 关于EXP-00056: 遇到 ORACLE 错误 1455 ORA-01455: 转换列溢出整数数据类型 EXP-00000: 导出终止失败 的问题解决方法整理
- oracle ORA-12899错误的解决方法
- Oracle的ORA-02063错误解决方法(Wallet相关?)
- 安装Oracle数据库时ORA-00604,ORA-06553错误的解决方法
- 【oracle常见错误】ora-00119和ora-00132问题的解决方法
- ORA-12547: TNS:lost contact错误解决方法
- 存档日志ORA-16032错误解决方法
- ORA-28547:连接服务器失败,可能是Net8管理错误----解决方法
- 高级复制添加主体站点的时候碰到ORA-23375错误的解决方法
- ORA-12505: TNS: 监听程序当前无法识别连接描述符中所给出的SID等错误解决方法
- 错误:ORA-28002: the password will expire within 7 days 解决方法
- ORA-28547:连接服务器失败,可能是Net8管理错误----解决方法
- Oracle 11g ORA-12560: TNS: 协议适配器错误!解决方法
- ORA-12520错误解决方法