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: script , batch ..

Re: script , batch ..

From: Thomas Gaines <Thomas.Gaines_at_noaa.gov>
Date: Tue, 23 Apr 2002 16:12:38 -0600
Message-ID: <3CC5DC56.A52A819@noaa.gov>


Xavier -

Please don't write all of the individual insert statements; you'll kick yourself later.

You can
use the SQL*Loader executable on your local machine to load data contained in a local file into a distant database. I do it all the time.

Here is a dummy batch file that I created on my Win2000 machine: sqlldr userid=dummy/dummypw_at_servicename errors=50000 control="g:\precip_raw.ctl" log="g:\precip_raw.log"

And my control file was:
LOAD DATA
INFILE 'g:\v2.prcp'
BADFILE 'g:\v2.prcp.bad'
DISCARDFILE 'g:\v2.prcp.dsc'
INTO TABLE dummy.precip_raw2

  (id         position(1:11)      integer external,
   year       position(13:16)     integer external,
   jan        position(17:21)     decimal external,
   etc, etc, etc.)

It's a piece o' cake.

Tom

Xavier Barau wrote:

> Thanks a lot for your answer.
>
> Well the thing is , i cannot ask my customer to install sql*loader for the
> moment.
> So should i divide the request in several one?
> So that my script would look like this:
>
> Connect xx
> Insert el_1 Into table
> Insert el_2 Into table
> Insert el_3 Into table
> ...
> COMMIT
> Disconnect ..
>
> xavier
>
> "Daniel Morgan" <damorgan_at_exesolutions.com> a écrit dans le message news:
> 3CC57952.539FC3B2_at_exesolutions.com...
> > You need to use SQL*Loader which is the sqlldr executable in the
> ORACLE_HOME/bin
> > directory. To get information on using it go to http://technet.oracle.com
> and
> > search for 'SQL Loader'.
> >
> > Also, you will need to FTP the file to the local box to do this.
> >
> > Daniel Morgan
> >
> >
> > Xavier Barau wrote:
> >
> > > As i 'm quite beginer in Oracle, i have few basics questions.
> > > I have to generate scripts use to Insert 100 000 entries, from a text
> file,
> > > in a distant Oracle 8 database.
> > > Where could i find samples with all the connect procedure and insert
> > > request.
> > > Thanks a lot
> > > Xavier
> >
Received on Tue Apr 23 2002 - 17:12:38 CDT

Original text of this message

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