http://qs321.pair.com?node_id=743082

plendid has asked for the wisdom of the Perl Monks concerning the following question:

Hello,

I'm attempting to insert thousands of rows into a database table. Each row consists of one field. I believe that the fastest way to do this is with the DBI/execute_array function. But try as i might i can't seem to comprehend what it is that the DBI module expects.

I've attempted numerous coding permutations, googling perl execute_array, reading through the CPAN DBI documentation, Safari and ASPN. No luck. Can someone explain to me how to format the information in the following code to yield the desired result?

my @books = qw(1 2 3 4 5); my $sql = qq(insert into temp_selectedTitles values (?)); my $sh = $pics->prepare($sql); $sh->bind_param_array(1, [@books]); #this returns no rows my $tuples = $sh->execute_array({}, \@books); #this returns the error 'DBD::Oracle::st execute_array failed: 0 bind +values supplied but 1 expected...' my $tuples = $sh->execute_array({\ArrayTupleFetch=>$sh});

The desired result is five new database records,

table temp_selectedTitles book =========== 1 2 3 4 5

Thanks.