fionbarr has asked for the wisdom of the Perl Monks concerning the following question:
print "\n\t\tdo you want to write out the table (Y/N) "; my $ans = (<STDIN>); if ($ans =~ /y/i) { # say "\n\t\tDeleting Current Week: $weeknumber from Server Patch +table"; my $sql = qq(DELETE FROM WFSServer_Patch WHERE weeknum = $weeknum +ber); my $rows = $dbh->do($sql); say "\n\t\tWriting Server Patch Table"; my $sth = $dbh->prepare(<<SQL); insert into WFSServer_Patch (weeknum, server, patch) values (?, ?, ?) SQL foreach my $server (sort keys %server_patch) { foreach my $desc (sort keys %{ $server_patch{$server}} ) { $sth->execute($weeknumber, $server, $desc) or die "can't e +xecute statement: $DBI::errstr\n"; } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: speedup sqlserver insert
by choroba (Cardinal) on Sep 12, 2014 at 13:23 UTC | |
by fionbarr (Friar) on Sep 12, 2014 at 13:27 UTC | |
by Corion (Patriarch) on Sep 12, 2014 at 13:29 UTC | |
by fionbarr (Friar) on Sep 12, 2014 at 13:44 UTC | |
by Corion (Patriarch) on Sep 12, 2014 at 13:59 UTC | |
| |
by mje (Curate) on Sep 12, 2014 at 16:17 UTC |