大佬教程收集整理的这篇文章主要介绍了为 ship_status_af_update 创建 Oracle TRIGGERS,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我需要创建一个名为“shipment_status_af_update”的触发器,每当shipment_status 表更新时就会触发它。 该触发器将在shipment_status 细节更新后将名称和动作插入到表'status_log_history' 中。 受影响的日志表 status_log_history 中的操作名称是“After_update_Shipment_Status”。
Hints:
trigger name : shipment_status_af_update
table name : status_log_history
FIEld names :name,action
Action : 'After_update_Shipment_Status'.
Hint: Add / after the end statement
我的代码是:
CREATE or replaCE trigGER shipment_status_af_update
AFTER updatE on shipment_status FOR EACH ROW declare
BEGIN
insert into status_log_history (name,action)
values(:new.name,'After_update_Shipment_Status');
END;
/
结果: 警告:触发器创建时有编译错误。
如果两个表都存在并且包含您在触发器中使用的名称,则代码编译:
SQL> create table shipment_status (name VARCHAR2(20));
Table created.
SQL> create table status_log_history(name VARCHAR2(20),action varchar2(30));
Table created.
SQL> create or replace trigger shipment_status_af_update
2 after update on shipment_status
3 for each row
4 declare
5 begin
6 insert into status_log_history (name,action)
7 values (:new.name,'After_update_Shipment_Status');
8 end;
9 /
trigger created.
SQL>
以上是大佬教程为你收集整理的为 ship_status_af_update 创建 Oracle TRIGGERS全部内容,希望文章能够帮你解决为 ship_status_af_update 创建 Oracle TRIGGERS所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。