|
- sqlldr hr/oracle_4U control=prod.ctl data=prod_master.dat external_table=GENERATE_ONLY log=prod.sql
复制代码 bank.sql
- create table t_bank_invoice (
- account_number number ,
- sub_number number ,
- transac_date date ,
- transac_address varchar2(600),
- transac_comment varchar2(600),
- currency varchar2(100),
- remit varchar2(100),
- in_amount number(20,2) ,
- out_amount number(20,2),
- balance number(20,2),
- opposite_number number ,
- opposite_username varchar2(100),
- all_comment varchar2(2000)) ;
复制代码
ccb.ctl
- LOAD DATA
- characterset ZHS16GBK
- INFILE 'ccb.dat'
- DISCARDFILE 'ccb.dis'
- append
- INTO table t_bank_invoice
- TRAILING NULLCOLS
- (
- account_number "4367421823250099999",
- sub_number "00000",
- transac_date position(1:8) DATE(8) "YYYYMMDD" TERMINATED BY ',',
- transac_address position(10) char TERMINATED BY ',',
- out_amount decimal external TERMINATED BY ',' nullif out_amount=blanks,
- in_amount decimal external TERMINATED BY ',' nullif in_amount=blanks ,
- balance decimal external TERMINATED BY ',' nullif balance=blanks,
- opposite_number char TERMINATED BY ',',
- opposite_username char TERMINATED BY ',',
- currency char TERMINATED BY ',',
- transac_comment char TERMINATED BY whitespace
- )
复制代码
icbc.ctl
- LOAD DATA
- characterset ZHS16GBK
- INFILE 'icbc.dat'
- DISCARDFILE 'icbc.dis'
- append
- INTO table t_bank_invoice
- when (5) ='^'
- FIELDS TERMINATED BY '^'
- TRAILING NULLCOLS
- (
- account_number "1402029101000999999",
- sub_number "00000",
- transac_date position(6:15) DATE(10) "YYYY-MM-DD" TERMINATED BY WHITESPACE,
- transac_address TERMINATED BY WHITESPACE
- "substr(:transac_address,2)",
- transac_comment TERMINATED BY WHITESPACE
- "substr(:transac_comment,2)",
- currency TERMINATED BY WHITESPACE
- "substr(:currency,2)",
- remit TERMINATED BY WHITESPACE
- "substr(:remit,2)",
- in_amount TERMINATED BY WHITESPACE
- "TO_NUMBER(substr(:in_amount,2),'999,999,999,999.00')",
- out_amount TERMINATED BY WHITESPACE
- "TO_NUMBER(substr(:out_amount,2),'999,999,999,999.00')",
- balance TERMINATED BY WHITESPACE
- "TO_NUMBER(substr(:balance,2),'999,999,999,999.00')",
- all_comment TERMINATED BY WHITESPACE
- "substr(:all_comment,2)"
- )
复制代码
|
|