Home » SQL & PL/SQL » SQL & PL/SQL » Comma delimited flat file
Comma delimited flat file [message #19484] Thu, 21 March 2002 07:06 Go to next message
uma
Messages: 67
Registered: May 2001
Member
I have a comma delimited flat file. How to read this and load into a oracle table? Give me sample sql to do this. Appreciated your help.

Thanks in advance,

Uma
Re: Comma delimited flat file [message #19486 is a reply to message #19484] Thu, 21 March 2002 08:57 Go to previous message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
sample.ctl
----------
LOAD DATA
INFILE 'sample.dat'
INTO TABLE dept
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
(deptno, dname, loc)

sampele.dat
---------
ur comma delimited flat file.
for example,

10,"ACCOUNTING","NEWYORK" 20,"RESEARCH","DALLAS" 30,"SALES","CHICAGO" 40,"OPERATIONS","BOSTON"

invoke sqlloader
---------
sqlldr userid=scott/tiger@high9i control=sample.ctl
log=sample.log
--------------------------------------------------
u can get a log file, at the same directory.
sample.log
Previous Topic: Removing 0's from field
Next Topic: *Another* single quotes question
Goto Forum:
  


Current Time: Thu Apr 25 18:15:39 CDT 2024