# Use the list of field names you pulled from the dbf file... # Make the column list for the query... my $fields = join(",", @fieldnames); # Make a string consisting of ?'s joined by commas to be used as DBI # placeholders in the query, one ? for each column... my $placeholders = join(",", ('?') x scalar @fieldnames); # Build and prepare the query... my $insert_query = <<"__END_OF_SQL__"; INSERT INTO oracle_table ($fields) VALUES ( $placeholders ) __END_OF_SQL__ my $oracle_sth = $dbh->prepare($insert_query); # Loop over the rows from the .dbf and use the prepared statement to # insert them into the oracle DB. while (my $row = $dbf_sth->fetchrow_arrayref) { $oracle_sth->execute(@$row); }