[SOLVED] Re: Specify an array in $sth->execute() ?

2009-08-06 Thread Denis BUCHER
Hello everyone, Thank to the help of everyone on the list, more especially the links you gave me, I found the solution. Having not done perl for a long time, I was doing the right logic but with the wrong notation. This is my final working code : $dbh_as400 = DBI->connect... (source) $dbh_pgsql

Re: Specify an array in $sth->execute() ?

2009-08-06 Thread Denis BUCHER
Hello, If I understand correctlyy execute_array is to do many INSERT at once AND to contain all colums ? It seem it could could what I want, then... Example from http://search.cpan.org/~timb/DBI/DBI.pm#bind_param_array $dbh->{RaiseError} = 1;# save having to check each method call $s

Re: Specify an array in $sth->execute() ?

2009-08-06 Thread John Scoles
I think you want is the |execute_array| <#___top> command however you can not use it like this. It would be more like this SQL='Insert into aTable (Y,X) values (?,?) my $tuples = $sth->execute_array( { ArrayTupleStatus => \my @tuple_status }, \...@y_values, \...@x_values ); In your case bel

Re: Specify an array in $sth->execute() ?

2009-08-06 Thread Martin Evans
John Scoles wrote: > Depends on the DBD driver. I'm not sure that is true John. I believe execute_array is implemented in DBI for drivers which don't have their own execute_array. It may not be as fast but it is there. > Which one are you using? > > cheers > Martin > > Denis BUCHER wrote: >

Re: Specify an array in $sth->execute() ?

2009-08-05 Thread Denis BUCHER
Tim Bunce a écrit : >> Does someone knows if it's possible to specify an array when executing a >> prepared statement ? > > The question seems confused... Yes was difficult to explain ;-) >> $sth->execute(%array_data) > > %array_data isn't an array, it's a hash. > See http://perldoc.perl.org/pe

Re: Specify an array in $sth->execute() ?

2009-08-05 Thread Denis BUCHER
I'm using postgresql (Pg) Denis John Scoles a écrit : > Depends on the DBD driver. > > Which one are you using? > > cheers > > > > Denis BUCHER wrote: >> Hello, >> >> Does someone knows if it's possible to specify an array when executing a >> prepared statement ? >> >> $sth->execute(%array_d

Re: Specify an array in $sth->execute() ?

2009-08-05 Thread Tim Bunce
On Wed, Aug 05, 2009 at 08:19:42PM +0200, Denis BUCHER wrote: > Hello, > > Does someone knows if it's possible to specify an array when executing a > prepared statement ? The question seems confused... > $sth->execute(%array_data) %array_data isn't an array, it's a hash. See http://perldoc.perl

Re: Specify an array in $sth->execute() ?

2009-08-05 Thread John Scoles
Depends on the DBD driver. Which one are you using? cheers Denis BUCHER wrote: Hello, Does someone knows if it's possible to specify an array when executing a prepared statement ? $sth->execute(%array_data) instead of : $sth->execute($array_data["firstname"],array_data["lastname"]) Than

Specify an array in $sth->execute() ?

2009-08-05 Thread Denis BUCHER
Hello, Does someone knows if it's possible to specify an array when executing a prepared statement ? $sth->execute(%array_data) instead of : $sth->execute($array_data["firstname"],array_data["lastname"]) Thanks a lot for any help ! Denis