--2. 创建function create or replace type tabs as table of varchar2(200); create or replace function splitStr(spStr varchar2, splitor varchar2) return tabs is tab tabs := tabs(); pos number; str varchar(2000); begin str := rtrim(ltrim(spStr),splitor); if spStr is null then return null; end if; if splitor is null then return null; end if; loop pos:=instr(str,splitor); exit when pos=0 or pos is null; tab.extend; tab(tab.last):=substr(str,1,pos-1); str := rtrim(ltrim(substr(str,pos+1,length(str)),splitor),splitor); end loop; if pos=0 or pos is null then tab.extend; tab(tab.last):=str; end if; return tab; end; / --3. declare t1 tabs; t2 tabs; begin for a in (select User_fee_Prope from tableA) loop t1 := splitStr(a.User_fee_Prope,'||'); for r in t1.first..t1.count loop t2 := splitStr(t1(r),'>'); insert into tableB values(t2(1),t2(2),t2(3),t2(4),t2(5),t2(6)); end loop; end loop; commit; end;