oracle添加触发器无效,Oracle触发器无效

我是SQL新手,我试图创建一个插入审计表的触发器。

create or replace trigger late_ship_insert

after insert on suborder

for each row

declare

employee int;

begin

select emp_id

into employee

from handles

where order_no = :new.order_no;

if :new.actual_ship_date > :new.req_ship_date then

insert into ship_audit

values (employee, :new.order_no, :new.suborder_no, :new.req_ship_date, :new.actual_ship_date);

end;错误:

Warning: execution completed with warning

trigger late_ship_insert Compiled.但是,一旦我尝试插入语句,它告诉我触发器没有工作它放弃它。

Error starting at line 1 in command:

insert into suborder

values ( 8, 3, '10-jun-2012', '12-jul-2012', 'CVS', 3)

Error at Command Line:1 Column:12

Error report:

SQL Error: ORA-04098: trigger 'COMPANY.LATE_SHIP_INSERT' is invalid and failed re-validation

04098. 00000 - "trigger '%s.%s' is invalid and failed re-validation"

*Cause: A trigger was attempted to be retrieved for execution and was

found to be invalid. This also means that compilation/authorization

failed for the trigger.

*Action: Options are to resolve the compilation/authorization errors,

disable the trigger, or drop the trigger.任何想法是什么导致这一点,任何帮助将不胜感激。谢谢!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值