create or replace procedure  test  is
cur_顺序 sys_refcursor;
cur_自然序列 sys_refcursor;
v_id_顺序 varchar2(32);
v_id_自然序列  varchar2(32);
begin
  open cur_自然序列 for
  select id  from tt;
  open cur_顺序 for
  select id  from tt order by id;
  loop
  fetch cur_顺序 into v_id_顺序;
  fetch cur_自然序列 into v_id_自然序列;
  exit when cur_顺序%notfound;
  update tt set tt.col2=v_id_顺序 where tt.id=v_id_自然序列;
  commit;
  end loop;
  close cur_顺序;
  close cur_自然序列;
end ;