有表A
port command表B
port command
12345 FG4
12343 FG6
12345 G表C现插入表C中的记录
insert into C (command) values ('FG47')表A中要出现
port command
12345 FG47也就是说,插入的字段大于B表中存在的字段,且不知道前面有几位相同,求教
port command表B
port command
12345 FG4
12343 FG6
12345 G表C现插入表C中的记录
insert into C (command) values ('FG47')表A中要出现
port command
12345 FG47也就是说,插入的字段大于B表中存在的字段,且不知道前面有几位相同,求教
AFTER insert on C
referencing old as old new as new
for each row
declare
vs_port varchar2(10) ;
begin
select port into vs_port from B where regexp_like(:new.command, B.command) and rownum = 1;
insert into A values (vs_port, :new.command);
end;
/
select port into vs_port from B where :NEW.mocentent like B.command ||'%' and rownum = 1;这样也是可以的