create or replace trigger your_trigger_name
befor insert
on your_table_name
for each row
declare
tempid varchar(6);
tempinput varchar(60);
strsql varchar(4000);
begin
tempinput := :new.PRJ_DUTY_BRC_ID;
if length(trim(tempinput)) > 6 then
tempid := substr(tempinput,1,instr(tempinput,','));
:new.PRJ_DUTY_BRC_ID := tempid;
tempinput := substr(tempinput,instr(tempinput,',') + 1);
loop
tempid := substr(tempinput,1,instr(tempinput,','));
strsql := 'insert into your_table_name(PRJ_DUTY_BRC_ID,...) values(''' || trim(tempid) || ''',...)';
execute immediate strsql;
tempinput := substr(tempinput,instr(tempinput,',') + 1);
exit when instr(tempinput,',') = 0;
end loop;
end if;
end;
befor insert
on your_table_name
for each row
declare
tempid varchar(6);
tempinput varchar(60);
strsql varchar(4000);
begin
tempinput := :new.PRJ_DUTY_BRC_ID;
if length(trim(tempinput)) > 6 then
tempid := substr(tempinput,1,instr(tempinput,','));
:new.PRJ_DUTY_BRC_ID := tempid;
tempinput := substr(tempinput,instr(tempinput,',') + 1);
loop
tempid := substr(tempinput,1,instr(tempinput,','));
strsql := 'insert into your_table_name(PRJ_DUTY_BRC_ID,...) values(''' || trim(tempid) || ''',...)';
execute immediate strsql;
tempinput := substr(tempinput,instr(tempinput,',') + 1);
exit when instr(tempinput,',') = 0;
end loop;
end if;
end;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货