首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

PLSQL(容易)

2012-08-24 
PLSQL(简单)create or replace procedure xxx ismaxrecords constant int : 2500000i int : 1beginfor

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;

热点排行