create or replace procedure p_olddic_newdic is
cursor commons is select t1.name codename from n_code t1, o_dictable t2
where t1.name = t2.dic_name; oldcode varchar2(50);
oldname varchar2(200);
newid varchar2(50);
newtext varchar2(200);
begin
for common in commons loop
begin
dbms_output.put_line(common.codename);
insert into old_new_dic_compare(OLDCODE,OLDNAME,NEWID,NEWTEXT)
select t1.ocode, t1.oname, t2.nid, t2.ntext
from
(
select e.code ocode,e.name oname from o_dic_columns e
where e.dic_id = (select t.dic_id from o_dictable t where t.dic_name=common.codename)
) t1
full outer join
(
select e.id nid, e.text ntext from n_codeitem e
where e.codeid = (select t.id from n_code t where t.name=common.codename)
) t2
on t1.oname = t2.ntext;
commit;
dbms_output.put_line('de');
end;
end loop;
end;
cursor commons is select t1.name codename from n_code t1, o_dictable t2
where t1.name = t2.dic_name; oldcode varchar2(50);
oldname varchar2(200);
newid varchar2(50);
newtext varchar2(200);
begin
for common in commons loop
begin
dbms_output.put_line(common.codename);
insert into old_new_dic_compare(OLDCODE,OLDNAME,NEWID,NEWTEXT)
select t1.ocode, t1.oname, t2.nid, t2.ntext
from
(
select e.code ocode,e.name oname from o_dic_columns e
where e.dic_id = (select t.dic_id from o_dictable t where t.dic_name=common.codename)
) t1
full outer join
(
select e.id nid, e.text ntext from n_codeitem e
where e.codeid = (select t.id from n_code t where t.name=common.codename)
) t2
on t1.oname = t2.ntext;
commit;
dbms_output.put_line('de');
end;
end loop;
end;
(select t.id from n_code t where t.name=common.codename)
你看看这两个是不是返回了多条记录。