Solution for importing TXT files to Oracle Control Files

Source: Internet
Author: User

D:/> sqlplus/nolog

SQL * Plus: Release 10.2.0.4.0-production on Thursday April 2 09:35:48 2009

Copyright (c) 1982,200 7, Oracle. All rights reserved.

Idle> conn Scott/Tiger
Connected.
Scott @ test> Create Table hra_read_card_day
2 (
3 emp_no varchar2 (8 ),
4 mac_no varchar2 (10 ),
5 work_date varchar2 (16 ),
6 rc_date varchar2 (16 ));

The table has been created.

Scott @ test> select * From hra_read_card_day;

Unselected row

Scott @ test> host
Microsoft Windows XP [version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

D:/> sqlldr Scott/tiger control = test. CTL

SQL * Loader: Release 10.2.0.4.0-production on Thursday April 2 09:36:39 2009

Copyright (c) 1982,200 7, Oracle. All rights reserved.

Submission point reached-logic record count 4

D:/> exit

Scott @ test> select * From hra_read_card_day;

Emp_no mac_no work_date rc_date
--------------------------------------------------
00049353 03 2009/02/28
00020434 03 2009/02/28
00026388 03 2009/02/28
00048085 03 2009/02/28

Scott @ test>

-- The following CTL is used:
Load data
Infile 'd:/20090302.txt'
Truncate
Into Table hra_read_card_day
(
Emp_no position (1-8 ),
Mac_no position (10-11 ),
Work_date position (13-22 ),
Rc_date position (24-28)
)

Reference the post of langcai1981:

Now there is such a CTL file imported from TXT to Oracle,
When reading data, the SQL * loader-350 syntax error is displayed in row 6th.
The expected value is a valid column description, "," or ")", and the actual value is "varchar2 ".
Emp_no postion (1-8) varchar2 (8)
The Code is as follows:
Load data
Infile 'C:/20090302.txt'
Truncate
Into Table hra_read_card_day
(
Emp_no position (1-8...

Summary of my last question: the difference between 'd:/20090302.txt and 'd:/20090302.txt is obvious. Therefore, when performing Oracle-related operations, symbol is a very critical factor, be sure not to have a careless, if it is difficult to find out the problem, in this post I: http://topic.csdn.net/u/20090401/12/ef307e4c-e7e0-492d-a7ba-163cc6e846b0.html in order to learn lessons, warn yourself not to have similar problems.

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.