Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How do I load ASCII files into Oracle Tables
Andrew Booth <andrew.booth_at_handc.btinternet.com> wrote:
> Can anyone explain how I load plain ASCII files into an Oracle table?
Oracle provides a product called Sql*Loader explicity for this purpose. You basically define a control file which names the input dataset and describes its contents. Something like:
LOAD DATA
INFILE mydata.dat
INTO TABLE mytable
(my_key POSITION(01:09) CHAR, my_field POSITION(10:23) CHAR, my_number POSITION(24:36) DECIMAL EXTERNAL, ...)
Obviously, 'mytable' must be previously defined and 'mydata.dat' must contain the data in columnar format. If the control file is called 'myload.ctl', then you invoke Sql*Loader like this:
sqlload userid/password myload.ctl
...and it will produce a log file called 'myload.log' that you will probably want to review.
That's it in a nutshell. I hope this at least puts you on the right track.
Good Luck,
Lance Humpert
Thomas Jefferson University
Philadelphia, Pa.
Lance.Humpert_at_mail.tju.edu
Received on Fri May 02 1997 - 00:00:00 CDT