in reply to Re: DBI - Handling NULL values
in thread DBI - Handling NULL values

An alternative to the join's and building the multiple ?'s is using SQL::Abstract:
use SQL::Abstract; my $SA = SQL::Abstract->new; while (my @row = $dbq->fetchrow_array) { my %fields; @fields{@fields} = ( $site_hostname, $site_id, @row ); # hash slic +e to set %fields my ($sql, @bind) = $SA->insert( $thisTable, \%fields ); push @central_insert, [ $sql, \@bind ]; } ... $dbh->do( $_->[0], {}, @{$_->[1]} ) for @central_insert;
In this case, you lose the ability to prepare the statement, but in general SQL::Abstract can be very handy... Good example is with dynamic where clauses.

(i'm also not sure why OP needs to queue up the insert's for later and just doesn't do it in the main loop...)