oracle下批量增加序列值

renjixinchina發表於2012-12-25
declare
  VC_SQL   varchar2(200);
  N_NUM NUMBER;
begin
  FOR I IN 1 .. 100 LOOP
    for a in (select * from user_sequences) loop
      VC_SQL := 'select ' || a.sequence_name || '.NEXTVAL from dual ';
      execute immediate VC_SQL
        INTO N_NUM;
    end loop;
  END LOOP ;
  end;

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/15747463/viewspace-751593/,如需轉載,請註明出處,否則將追究法律責任。

相關文章