近期工程上用到ORACLE的触发器, 以备后续查看语法。
实例如下:
CREATE OR REPLACE TRIGGER TRI_AFTER_INSERT
after insert
on t_table_item
for each row
declare
tmp_count number default 0;
begin
select count(1) into tmp_count from t_table_content tcc_c where tcc_c.assetname = :new.name and tcc_c.tvinfo is null;
if tmp_count >=1 then
update t_table_content tcc set tcc.tvinfo=:new.channel_code where tcc.assetname=:new.name;
end if;
end;