create or replace trigger 触发器名
before INSERT ON 表
for each row
begin
SELECT a.name(表的字段)
INTO :new.vbdef1(要改变的字段)
from
ia_iabill iabill
left join (
select distinct flow.pk_org,flow.cmaterialvid,defdoc.name from ic_flow flow
left join bd_defdoc defdoc on flow.vfree1=defdoc.pk_defdoc) a
on iabill.cstockorgvid = a.pk_org
where a.CMATERIALVID=:new.cinventoryid and iabill.cbillid=:new.cbillid and rownum<=1;
exception when no_data_found then --如查询出null
:new.vbdef1:='~';
END modify_test;
ora利用触发器插入一条数据后,再查询出相关名称后修改新插入的数据create or replace trigger 触发器名before INSERT ON 表 for each row begin SELECT a.name(表的字段) INTO :new.vbdef1(要改变的字段) from ia_iabill iabill left join ( select distinct flow.pk_o