Load: oracle tool: sqlldr consists of four steps: creating a table with a source data file (test.txt) and creating a control file (test. ctl), create a bat file (or shell file) focuses on: If the table has the number type, or the date data type can also load the number, the key point is in step 3. The procedure is as follows: 1. Create a table (SCRIPT ):
-- Create tablecreate table TBL_TEST1 (NAME VARCHAR2 (50), PASSWORD VARCHAR2 (10), CREATE_DT DATE, age number (3 )) tablespace USERS pctfree 10 initrans 1 maxtrans 255 storage (initial 64 K minextents 1 maxextents unlimited );
2. source data file: test.txt
Ttt, test, 20120302, 80aaa, bbb, 20130506, 90
3. Create a control file: test. ctl
Load datainto table TBL_TEST1REPLACEFIELDS terminated by ', 'trailing NULLCOLS (NAME "TRIM (: NAME)", PASSWORD "TRIM (: PASSWORD)", CREATE_DT "TO_DATE (: CREATE_DT, 'yyyymmdd') ", AGE" TO_NUMBER (: AGE )")
4. create a bat file (or shell file) or directly run the content in the file in the command line (sqlldr must be configured to the environment variable E: \ oracle \ product \ 10.2.0 \ db_1 \ bin) sqlldr test/litao data = C: \ test.txt control = C: \ test. ctl log = test. log bad = test. bad