create or replace trigger a_trigger
before insert on a for each row
declare
pragma autonomous_transaction; --自由实务处理,调用函数或存储过程触发器有问题的话最好加这句
i_xmpy char(6); --长度根据实际情况定,建议别用varchar2
begin
i_xmpy := F_TRANS_PINYIN_CAPITAL(:new.NAME);
update a set XMPY = i_xmpy
where ID = :new.ID; --ID字段用的是序列的话,“:new.ID”可换成“序列名.currval”
end;