Oracle——trigger(触发器)before insert

代码如下,如果insert的physicalpath为空,那么就把physicalpath设置为XXX

create or replace trigger update_physicalpath      --创建触发器
  before insert                                    --insert 前
  on filetree                                      --insert into 表 filetree
  for each row
begin
  if (:new.physicalpath is null) then                --new表示要插入的新值
    :new.physicalpath := 'D:\档案系统附件\File\';     --赋值
  END if;
end update_physicalpath;

其他语法详情:https://www.cnblogs.com/sharpest/p/7764662.html

你可能感兴趣的:(ORACLE)