• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2967
  • Last Modified:

SQL Loader - Tab delimited


I want to use sql loader to load a tab delimited files. How do I specify "TAB" in the sql loader control file? What do I put in the "???" in the line below?

FIELDS TERMINATED BY "???" OPTIONALLY ENCLOSED BY '"'

Thanks.
0
jyhuang
Asked:
jyhuang
1 Solution
 
myerpzCommented:
While editing the control file, I entered a tab
between the quotes after 'terminated by' and
that worked for me.

Hope this helps.
0
 
dbrowerCommented:
One of these should work

FIELDS TERMINATED BY WHITESPACE


FIELDS TERMINATED BY '    '
where the space between the quotes is a Tab

Good luck
0
 
bkmCommented:
Hope this helps!!

LOAD DATA
INFILE 'files.txt'
INTO TABLE files
INSERT
FIELDS TERMINATED BY X'09' TRAILING NULLCOLS
(ID_FILE,
NATION,
PATENT,
TITLE,
HKEY)

Another Eg:

LOAD DATA

   INFILE 'FILENAME.TXT'

   INTO TABLE t1

   FIELDS DELIMITED BY x'09'

   TRAILING NULLCOLS

     ( column 1....

     )

0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Mark GeerlingsDatabase AdministratorCommented:
Since "chr(09)" works to insert a tab character, it may work in SQL*Loader as well (but I haven't tried it) like this:
FIELDS TERMINATED BY chr(09)
0
 
jaramillCommented:
Also add after each column

(column_name1   datatype TERMINATED BY X'09',
 column_name2   datatype TERMINATED BY X'09')

Gio
0
 
jyhuangAuthor Commented:
Thank you all for your responses. Almost all your suggestions are working. I can use space, tab, or X'09'. But since myerpz is the first one who gave the correct answer, I am giving the points to him/her.
0

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now