Oracle 警告:执行已完成,但有警告
我有两个表
Orders(ID,ORDERDATE,DELIVERYDATE,GOODID,QUANTITY,COLLECTIONFROM,DELIVERYTO,NOTES)
,并且
ROLLINGSTOCK_ORDER(ORDERID,ROLLINGSTOCKID,DEPARTUREDATE,DELIVERYDATE,ROUTEID)
创建了一个触发器,当在 Orders
中更新 DELIVERYDATE 时更新 ROLLINGSTOCK_ORDER
中的 DELIVERYDATE
CREATE OR REPLACE TRIGGER TRIGGER_UpdateDeliveryDate
BEFORE UPDATE OF DELIVERYDATE ON Orders
FOR EACH ROW
BEGIN
then
UPDATE LOCOMOTIVE_DRIVER ld
set ld.DELIVERYDATE = :new.DELIVERYDATE
where ld.orderid = :new.id
end if;
END;
当我运行它时,我收到以下消息
警告:执行完成 警告触发 TRIGGER_UpdateDeliveryDate 已编译。
该警告没有向我提供任何信息,因此
我如何查看警告的详细信息?
我觉得触发器没问题,你能发现问题吗?
谢谢
I have two tables
Orders(ID,ORDERDATE,DELIVERYDATE,GOODID,QUANTITY,COLLECTIONFROM,DELIVERYTO,NOTES)
and
ROLLINGSTOCK_ORDER(ORDERID,ROLLINGSTOCKID,DEPARTUREDATE,DELIVERYDATE,ROUTEID)
i have created a trigger to update the DELIVERYDATE in ROLLINGSTOCK_ORDER
when DELIVERYDATE is updated in Orders
CREATE OR REPLACE TRIGGER TRIGGER_UpdateDeliveryDate
BEFORE UPDATE OF DELIVERYDATE ON Orders
FOR EACH ROW
BEGIN
then
UPDATE LOCOMOTIVE_DRIVER ld
set ld.DELIVERYDATE = :new.DELIVERYDATE
where ld.orderid = :new.id
end if;
END;
When i run it i get the following message
Warning: execution completed with
warning TRIGGER
TRIGGER_UpdateDeliveryDate Compiled.
The warning does not give me any information so
How can i see the details of the warning?
The trigger seems ok to me can you spot the problem?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
本周早些时候,您提出了一个有关编写触发器来执行条件更新的问题。我发布了 两个如何实现这一目标的示例。您似乎所做的是将两个示例混合到一个无法编译的单一触发器中。
需要明确的是,您只需要以下之一。或者
如果
您只有一个要应用的逻辑,请使用第一个选项。如果您希望触发器也处理其他逻辑部分(通常是这种情况),请使用第二个版本。
Earlier this week you asked a question on writing a trigger to execute a conditional update. I posted two examples of how to achieve that end. What you appear to have done is mash the two examples into a single spavined trigger which doesn't compile.
To be clear you need just one of the following. Either
or
Use the first option if you just have the one piece of logic to apply. Use the second version if you want your trigger to handle other pieces of logic as well, which is usually the case.
你写的
语法不正确。您是否缺少
IF
?您在
UPDATE
之后还缺少一个分号 (;
)。您可能会收到错误
You write
which is incorrect syntax. Are you missing an
IF
?You are also missing a semicolon (
;
) after yourUPDATE
.You might get the error using