shree has asked for the wisdom of the Perl Monks concerning the following question:
Hi All, Can any one help me out by providing some examples for Batch upload/Insert row-wise
For example
$sth = $dbh->prepare(“insert into table values (?, ?, ?)”); @array1 = ( 1, 2, 3 ) # array that contains the values of column1 acro +ss all the rows. @array2 = ( 1, 2, 3 ) # array that contains the values of column2 acro +ss all the rows. @array3 = ( 1, 2, 3 ) # array that contains the values of column3 acro +ss all the rows. $sth->execute_array({}, \@array1, \@array2, \@array3);
This code will do the batch load column-wise it will insert all records in the array to the DB.
Any idea on how can I do the batch load row-wise insted of column-wise...?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Batch Upload/Insert – Row wise with Perl DBI
by morgon (Priest) on Sep 27, 2011 at 16:18 UTC | |
|
Re: Batch Upload/Insert – Row wise with Perl DBI
by runrig (Abbot) on Sep 27, 2011 at 16:33 UTC | |
by mje (Curate) on Sep 28, 2011 at 07:56 UTC | |
|
Re: Batch Upload/Insert – Row wise with Perl DBI
by Marshall (Canon) on Sep 28, 2011 at 14:26 UTC | |
by APerlPro (Initiate) on Mar 22, 2012 at 23:11 UTC | |
by Marshall (Canon) on Mar 23, 2012 at 01:45 UTC |