Re: [Help] Import data from text file thru sqlplus

From: Mike Kohut, NorthwesTel <mkohutnw_at_yknet.yk.ca>
Date: 1995/06/05
Message-ID: <3qtlvh$2iu_at_spot.YKnet.yk.ca>#1/1


cs_sng_at_ug.cs.ust.hk (Ng Sze Ho Stephen) wrote:
> I can extract data from Sybase server by "bcp" command into text files,
> delimited by "," or space. Assuming the table definitions are the same
> in the Sybase server and Oracle server, how can I import the data into
> the Oracle server through sqlplus? Or any other means?
>
Two ways that I know of are as follows:

  1. Use ORACLE SQL*Loader package. It is easy to use and very powerful for loading text files into database fields. If you have not used it before, get the user manual. This is the best way of getting external data into ORACLE.
  2. If your text file from Sybase looks something like this:

    1, 2, 'John Smith', 34.56
    5, 6, 'Jane Doe', 56.78

Then you could use a text editor or word processing program to convert the text file into this format:

    insert into my_table values(1, 2, 'John Smith', 34.56);     insert into my_table values(5, 6, 'Jane Doe', 56.78);

This would result in an SQL script that would allow you to load the data through SQL*Plus. Received on Mon Jun 05 1995 - 00:00:00 CEST

Original text of this message