Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: How do I load ASCII files into Oracle Tables

Re: How do I load ASCII files into Oracle Tables

From: Lance Humpert <Lance.Humpert_at_mail.tju.edu>
Date: 1997/05/02
Message-ID: <01bc5722$ca8e28b0$f0828c93@lhumpert>#1/1

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US