in reply to Re: DBI - Handling NULL values
in thread DBI - Handling NULL values
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.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;
|
|---|