触发器无法触发

[复制链接]
查看11 | 回复4 | 2012-2-2 15:23:01 | 显示全部楼层 |阅读模式
1、create or replace trigger A after insert on B for each row
begin
end;
向B中插入值时报ORA 04098 trigger A is invalid and failed re-validation
2、create or replace trigger A after insert on B for each row
begin
dbms_output.put_line('a');
end;
向B中插入值时不报错
3、create or replace trigger A after insert on B for each row
begin
insert into C values(...)
end;
单独执行insert into C values(...)没问题,整段时又报ORA 04098 trigger A is invalid and failed re-validation
求解。

回复

使用道具 举报

千问 | 2012-2-2 15:23:01 | 显示全部楼层
换成before试试
回复

使用道具 举报

千问 | 2012-2-2 15:23:01 | 显示全部楼层
sheep_yang678 发表于 2012-2-27 11:30
换成before试试

还是一样
而且我的需求不能用before,因为我插入到C 中的值要用到B中的数据
回复

使用道具 举报

千问 | 2012-2-2 15:23:01 | 显示全部楼层

1. 编译的时候都会报错
2. trigger好比是 os的crontab的操作,output的信息是不会写到终端的
3. 检查 alert日志是否有异常,怀疑有做过类似更新数据字典的操作
回复

使用道具 举报

千问 | 2012-2-2 15:23:01 | 显示全部楼层
ahdong2007 发表于 2012-2-27 11:52
1. 编译的时候都会报错
2. trigger好比是 os的crontab的操作,output的信息是不会写到终端的

额, 说实在的,对你的第三点不是很明白
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行