1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| CREATE OR REPLACE PROCEDURE CREATE_VIEW(acton in varchar2,acton2 in varchar2,acton3 in varchar2) as CURSOR cur_netnode(Aacton in varchar2,Aacton3 in varchar2) IS SELECT * FROM tmp_fetch_data where no1 =Aacton and no2 in (select regexp_substr(Aacton3, '[^,]+', 1, level) as split_result from dual connect by level <= length(Aacton3) -length(replace(Aacton3, ',')) + 1;)WHERE code IS NOT NULL; v_user cur_netnode%rowtype; BEGIN OPEN cur_netnode(acton,acton3); loop fetch cur_netnode into v_user; exit when cur_netnode%notfound; insert into tmp_data2('id','name','age') values((sysdate -to_date('1970-01-01 08:00:00', 'yyyy-mm-dd hh24:mi:ss')) * 86400000 + substr(v_user.id,10),v_user.name,v_user.age); END loop; close cur_netnode; END;
|