Go Back   Velocity Reviews > Newsgroups > PERL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

PERL - bulk loading with DBI

 
Thread Tools Search this Thread
Old 07-17-2003, 06:57 AM   #1
Default bulk loading with DBI


Hi,

I'm just wondering if anyone has experience with bulk loading data into an
Oracle database with DBI.

My options are to use DBI or Oracle's sqlloader. I'd rather do it using DBI,
but I'm not sure what kind of perfomance hit I'll incur. I need to load 2
tables on a daily basis (~50MB).

Any comments?

- Greg.





Greg H
  Reply With Quote
Old 07-17-2003, 03:52 PM   #2
AdrianK
 
Posts: n/a
Default Re: bulk loading with DBI

SQLLoader will generally be faster.

Pretty much trial an error really

For bulk inserts you should use DBI with placeholders.

Bit of pseudo code, might help...

my $sth = $dbh->prepare (SQL insert aram1, aram2 etc)
my $count = 0;

loop
$sth->bind_param("aram1", $param1);
$sth->bind_param("aram2", $param2);
...
...
eval { $sth->execute() };
if ($@) {
print "Error.......";
};
...
...
if ($count>50) { # Change this value depending on threshold,
rollback segment size etc
$self->doCommit($dbh);
$count=0;
}
$count++;

end loop

$dbh->commit



HTH
AdrianK

"Greg H" <> wrote in message news:<eVqRa.1340$>. ..
> Hi,
>
> I'm just wondering if anyone has experience with bulk loading data into an
> Oracle database with DBI.
>
> My options are to use DBI or Oracle's sqlloader. I'd rather do it using DBI,
> but I'm not sure what kind of perfomance hit I'll incur. I need to load 2
> tables on a daily basis (~50MB).
>
> Any comments?
>
> - Greg.

  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump