Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Bulk insert question
"Fredrik Wahlgren" <fredrik.p.wahlgren_at_mailbox.swipnet.se> wrote in message
news:LhJ9b.103646$zL.448_at_news1.bredband.com...
>
> "Sybrand Bakker" <postbus_at_sybrandb.nospam.demon.nl> wrote in message
> news:vmcc5rj73np81c_at_corp.supernews.com...
> >
> > "Fredrik Wahlgren" <fredrik.p.wahlgren_at_mailbox.swipnet.se> wrote in
> message
> > news:3vp9b.102808$zL.472_at_news1.bredband.com...
> > > Hi
> > >
> > > I have a server application in which I need to insert lots of rows
into
> a
> > > table. In SQL Server I use the BULK INSERT command. It looks like this
> > >
> > > BULK INSERT MyUser.[MyTable] FROM 'C:\MyFile.txt' WITH
(FIELDTERMINATOR
> =
> > > '|',ROWTERMINATOR = '\r\n')
> > > ¨
> > > This is much faster than having to do lots of INSERT statments. How
can
> I
> > do
> > > something similar in Oracle? I understand I can start SQL loader and
> have
> > it
> > > do the insert but that seems rather complicated. Surely there must be
a
> > > better way, right?
> > >
> > > My application is written in C++ and I use ADO. Would I be better off
> > using
> > > OCI?
> > >
> > > Thanks in advance,
> > > Fredrik
> > >
> > >
> >
> > Don't know why sqlloader is complicated. If you are prepared to do a
> little
> > reading, it is very easy to use, it does bulk inserts automatically, and
> it
> > can insert your data without transaction logging.
> > OTOH, in OCI you would have to program your bulk insert, called array
> insert
> > *yourself*
> > Talking about complicated.
> > BTW: You don't need to use OCI, you have Oracle Objects for OLE which is
> an
> > ADO like *native* interface to Oracle.
> > Please stop assuming Oracle is sqlserver sold by a different vendor. It
is
> > not, it is much more and it works.
> > You only need to do a little reading. Yeah I know Microsofties can only
> > click buttons.
> >
> >
> > --
> > Sybrand Bakker
> > Senior Oracle DBA
> >
> > to reply remove '-verwijderdit' from my e-mail address
> >
>
> Hi
>
> Well, I actually prefer Oracle over Sql Server. It's just that I have this
> test database on SQl Server and I have completed that part. I spent lot of
> time making a dynamic query and Oracle responds *much* better to it than
SQL
> Server.
>
> I don't think SQL Loader is complicated if you call it yourself. Calling
it
> from C++ is a different story. I guess this means I can't avoid the shell
> window from appearing, can I ? Do you know where I can find some piece of
> sample code?
>
> Regards,
>
> Fredrik
>
>
Why on earth would you call sql*loader from C++. Why is there *scripting*
Demo's come with every install, if you install sql*loader.
You will find them if you search for *.ctl files. Usually they are in the
'demo' directory.
Nowadays EVERYONE needs to be COMPLETELY SPOONFED. Guess your parents
spoiled you too much.
Sigh,
-- Sybrand Bakker Senior Oracle DBA to reply remove '-verwijderdit' from my e-mail addressReceived on Tue Sep 16 2003 - 15:42:16 CDT
![]() |
![]() |