Batch import TXT files

Source: Internet
Author: User
Tags sql loader

Method 1. Import text files to ORACLE

Create table hkh_August not dial
(
PHONE_NUM VARCHAR2 (11)
)
ORGANIZATION EXTERNAL
(TYPE ORACLE_LOADER
DEFAULT DIRECTORY TEMP
Access parameters (records delimited by newline fields terminated ',')
LOCATION ('hkh _ 181. TXT ')
);


Method 2 SQL LOADER command Application

1. Create a table structure

Create table HKH_LM
(
ACCT_MONTH VARCHAR2 (8 ),
PHONE_NUM VARCHAR2 (11 ),
PLAN_PRODUCT VARCHAR2 (20)
)

2. Write Control Files
Load data
Infile 'd: \ TEMP \ invalid contact number 9.8. CSV'
Append into table hkh_lm
Fields terminated ","
(ACCT_MONTH, PHONE_NUM, PLAN_PRODUCT)

3. Use the SQLLDR command to import


Error Analysis
ORA-29913: error in executing ODCIEXTTABLEOPEN callout

Solution: create a DIRECTORY object named TEMP in your database and grant the user the read and write permissions.

Author "John Xu"
 

Related Article

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.