批量生成大数据的sql



方法一:
declare
cnt number(9);
begin
  cnt:=0;
  while cnt < 100
  loop
 
insert into ts_customs_fee_fin (ID, FEEDATE, PORT, IEFLAG, BIG_CUSTOM_DEPT, FEE_CODE, FEE_LEVEL, FEE_OCCUR_DATE, CREATEUSER, CREATEDATE, GENERATION_TYPE, LASTUPDATE, LASTUPUSER, CUSTOMS_CLEARANCE_TYPE, TRANSPORT_MODE, CUSTOMS_DATE, CUSBATCH, MAWB, FLIGHTNO, BNO, GATE_TYPE, CARGO_TYPE, LIMIT_TYPE_CODE, PRODUCT_CODE, FEE_SORT, CALCULATE_OBJECT2, ACCOUNT_RULES_ID, ACCOUNT_QUANTITY, FEE, DATA_SOURCE, REMARK, STATE, SUPPLIER_NAME, SRC_ADDR, DES_ADDR, OCCURRATE, CUSTYPE, TAXPAYMENTTYPE, RECON_ID, SERVICE_NAME, BIZ_ID, DEL_MARK, SUPPLIER_CODE, CALCULATE_OBJECT1, EXCEPT_ID, FEE_NAME, GJAHR_MONAT_STR, PROJT, CUSTM, GJAHR_MONAT)
values (SEQ_TS_CUSTOMS_FEE.Nextval, '201609', 'RIO', 'I', '海外', 911, '1', to_date('25-09-2016', 'dd-mm-yyyy'), '223192', to_date('27-09-2016 17:34:48', 'dd-mm-yyyy hh24:mi:ss'), 1, '', '', '', '', null, '', '', '', '6666', '', '', '', '', 'CNY', '200', 1982, null, 8000.00000, '8', ';根据{bno=''6666''}未找到口岸表{tm_pcustom_RIO_I}信息.;根据{bno=''6666''}未找到原始表信息.', '2', '上海亿通国际股份有限公司', '', '', '2', '', '', 2636, '411300100024', null, '0', '1001119604', 'POUND_WEIGHT', null, '系统维护费-进口', '', '', '', to_date('25-09-2016', 'dd-mm-yyyy'));

      cnt := cnt + 1;
     
      if MOD(cnt,100) = 0 then
         commit;
      end if;
  end loop;
COMMIT;
end;

----select systimestamp from dual;
----备注:SEQ_TS_CUSTOMS_FEE为表的序列函数


方法二:
批量造大数据量的匿名块
declare

  k number(20):=1186568;
begin

  for i in 1..80
  loop
   
insert into TM_EXP_HISTORY
 
values
  (k+1----这个字段为id,
   'CTRCV2016040514234401001890588.xml',
   'EXP310',
   '',
   'ADD',
   '20160512',
   '425997747419',
   'I',
   i------这个字段为运单号,
   '06',
   'CMSP CREATE',
   '扣留',
   '',
   '',
   '',
   '14-MAY-16 10.15.18.000000 AM',
   '14-MAY-16 10.15.00.000000 AM',
   '14-MAY-16 11.08.14.460000 AM',
   'system');
  
  k :=k+1;
  end loop;
end;
/

你可能感兴趣的:(sql)