?
Solved

How does SQL Loader distinguish between a tab and a space ?

Posted on 2006-07-19
4
Medium Priority
?
1,400 Views
Last Modified: 2012-08-14
I'm trying to load an Oracle table with data from a data file that has tab delimited data using SQL Loader. The table description is as follows :

 Name                                      Null?    Type
 ----------------------------------------- -------- --------------
 EMP_NO                                             NUMBER(3)
 EMP_NAME                                           VARCHAR2(11)
 EMP_JOB                                            VARCHAR2(5)


The control file is as follows :

LOAD DATA
APPEND INTO TABLE EMP
TRAILING NULLCOLS
(
emp_no   CHAR
   TERMINATED BY X'09' OPTIONALLY ENCLOSED BY '"',
emp_name CHAR
   TERMINATED BY X'09' OPTIONALLY ENCLOSED BY '"',
emp_job CHAR
   TERMINATED BY X'09' OPTIONALLY ENCLOSED BY '"'
)

The data file is as follows :

123      "Su Ann"      DBA
234      Benjamin      ABC
321      Alex      WEX

Well, it is loading the 2nd and 3rd rows but not the first. The space between Su and Ann is the reason. The SQL Loader is taking that space as a tab and hence giving an error.

So, how do I tell the loader that there can be spaces in the data that need to be included  ? How would it distinguish between the space and a tab ?

I need an answer. There is no way I can work around this. I tried giving "\t", '     ',where the space is a tab instead of X'09' in the control file. Nothing worked.

I would really appreciate any help.

Thanks in advance.
0
Comment
Question by:Yashwi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 35

Accepted Solution

by:
Raynard7 earned 1000 total points
ID: 17141990
You are on the right track - I think that you need to escape the characterts - but add the line ESCAPED BY '\\' and then make the unwanted tabs \t
0
 
LVL 14

Assisted Solution

by:sathyagiri
sathyagiri earned 1000 total points
ID: 17150855
LOAD DATA
APPEND INTO TABLE EMP

FIELDS TERMINATED BY X'9' TRAILING NULLCOLS
(
emp_no   CHAR,
emp_name CHAR,
emp_job CHAR
)
0

Featured Post

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question