On 04/21/2005 10:11 AM, Robert said:

This was "a" solution:

my $insert_stmt = "Insert into TABLE (name, date, type, federal, active) values( :name, :date, :type, :federal, :active )";

my $sth = $dbh->prepare( $insert_stmt );

my $holidays;

foreach my $name ( keys %holidays ) {
$sth->bind_param( ':name', $name );
$sth->bind_param( ':'.$_, $holidays->{$name}->{$_} ) foreach keys %{$holidays->{$name}};
$sth->execute() or die "Cannot execute SQL statement: $DBI::errstr\n";
}

This may only work with DBD::Oracle. You also have to be very careful to have exactly the same hash keys as your bind variable names.


--
Mac :})
** I usually forward private questions to the appropriate mail list. **
Ask Smarter: http://www.catb.org/~esr/faqs/smart-questions.html
Give a hobbit a fish and he eats fish for a day.
Give a hobbit a ring and he eats fish for an age.

Reply via email to