当前位置: 代码迷 >> SQL >> PLSQL(容易)
  详细解决方案

PLSQL(容易)

热度:75   发布时间:2016-05-05 14:08:20.0
PLSQL(简单)
create or replace procedure xxx is

  maxrecords constant int := 2500000;
  i int := 1;
begin
  for i in 1 .. maxrecords loop
    insert into LOYALTY_ACCOUNT
      (LOYALTY_ACCOUNT_NBR,
       ACCOUNT_OWNER,
       LOYALTY_PROGRAM_ID,
       ENTITY_ID,
       SETTLEMENT_FLAG_OUTG,
       INTERNAL_POINT,
       AFFILIATE_POINT,
       NONAFFILIATE_POINT,
       CURRENT_MONTH_INTERNAL_POINT)
    values
      (lpad('L_ACT' || i, 10, '0'),
       'CH',
       'LPID01',
       'ENT_ID' || i,
       TO_CHAR(mod(i, 10)),
       i,
       i + 1,
       i + 2,
       i + 3
     
       );
  commit;
  end loop;
  end xxx;
  相关解决方案