Requirements: Data migration, import the contents of TXT file into the table of Oracle database, the data format of the text file is as follows (data is separated by space)
1. Create a table that matches the text data format (created here under the Scott user)
Create Table Li_an ( varchar2(+), varchar2(), Number , varchar2 (+), varchar2 (+) );
2. Create a file with a. ctl suffix to load the data into the database
Load.ctl
Load'E:\DataMove\data.txt'appendintotable by whitespacetrailing nullcols ( BH, fylb, jfje, pjh, pjch)
Explanation of Contents See links
3. Place the data file Data.txt and the control file Load.ctl in the same directory
4. Open the command line in this directory and enter the following command
Sqlldr userid=Scott/1234@orcl Control=loadlog =log. Out Discard=discard.txt Errors=
5. Done.
SQLLDR Import TXT file contents into the database