in reply to Re^2: How to Do multiples SQL Insert at one time?
in thread How to Do multiples SQL Insert at one time?
I hope you don't really use code like this. In case to have DBI do bulkloading faster, you should also write faster code. That prepare should be outside the loop
open my $log, "<", $logfile or die "$logfile: $!"; my $sth = $dbh->prepare ("insert into foo values (?,?,?)"; while (<$log>) { chomp; $sth->execute (split m/:/, $_); } $sth->finish; $dbh->commit;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: How to Do multiples SQL Insert at one time?
by Juerd (Abbot) on Jan 08, 2008 at 19:54 UTC |