in reply to Re: DBD::Pg - $sth->execute($csv_var) ERROR
in thread DBD::Pg - $sth->execute($csv_var) ERROR
Just to (maybe, hopefully) clarify: if $columns contains an array ref with your 22 column names and $values the 22 corresponding values you need to call $sth->execute( @{$columns}, @{$values} ) because it expects to get a flat list of parameters (not references to arrays with them). You're giving it the first below; it wants the second:
$sth->execute( [ "col1", "col2", ... ], [ "val1", "val2", ... ] ); ## + not working $sth->execute( "col1", "col2", ..., "col22", "val1", "val2", ... ); ## + what it expects
The cake is a lie.
The cake is a lie.
The cake is a lie.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: DBD::Pg - $sth->execute($csv_var) ERROR
by perlygapes (Beadle) on Mar 13, 2020 at 00:54 UTC | |
by soonix (Chancellor) on Mar 13, 2020 at 08:01 UTC |