Oracle触发器使用简述

阿里云国内75折 回扣 微信号:monov8
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6

直接上代码吧

create or replace trigger user_acct_ai_trg
  ---在user_acct表insert之后执行
  after insert on user_acct
  for each row
---定义变量 没有可以省略declare
declare  
  v_count integer;
begin
  ---:new 表示user_acct表当前行的数据
  select count(1) into v_count from para_dict t where t.key_cd = 'use_new' and t.key1 = :new.channel;
  if v_count > 0 then
    insert into white_list
      (list_code, list_type, list_key,state)
    values
      ('NEW_LIST',
       '1',
       :new.acct_id,
       '1');
   end if;
end user_acct_ai_trg;
阿里云国内75折 回扣 微信号:monov8
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6
标签: oracle

“Oracle触发器使用简述” 的相关文章