SQLLDR Import TXT file contents into the database

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.