perlygapes has asked for the wisdom of the Perl Monks concerning the following question:
Greetings Brethren
I wish to brew a solution worthy of the Trappist Title,
however my Tithe has been found wanting.
When I make the following offering:
my $colnum = 21; my $sql_placeholders = '(?' . ',?' x $colnum . ')'; my $sql_insert_handle = $dbh->prepare_cached( 'INSERT INTO mytable ' . $sql_placeholders . ' VALUES ' . $sql_placeholders ); <...> # yada yada yada # generate comma-separated column names and values <...> $sql_insert_handle->execute($columns,$values);
I receive the following prophecy:
DBD::Pg::st execute failed: called with 2 bind variables when 44 are n +eeded at C:/Users/user/eclipse-workspace/project1/pgdb.pl line 134. at C:/Users/user/eclipse-workspace/project1/pgdb.pl line 134. main::ingest_file(undef) called at C:/user/user/eclipse-workspace/ +project1/pgdb.pl line 76
The error indicates the statement was understood
and a way prepared for my offering to be received,
but the error indicates I did not keep the 44 statutes
and strayed from the path by failing to interpolate properly.
What must I do for my data to be saved?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: DBD::Pg - $sth->execute($csv_var) ERROR
by roboticus (Chancellor) on Mar 11, 2020 at 20:08 UTC | |
by perlygapes (Beadle) on Mar 13, 2020 at 01:13 UTC | |
by perlygapes (Beadle) on Mar 16, 2020 at 03:53 UTC | |
by roboticus (Chancellor) on Mar 17, 2020 at 15:33 UTC | |
by perlygapes (Beadle) on Mar 18, 2020 at 03:54 UTC | |
|
Re: DBD::Pg - $sth->execute($csv_var) ERROR
by jo37 (Curate) on Mar 11, 2020 at 15:25 UTC | |
by Fletch (Bishop) on Mar 11, 2020 at 18:35 UTC | |
by perlygapes (Beadle) on Mar 13, 2020 at 00:54 UTC | |
by soonix (Chancellor) on Mar 13, 2020 at 08:01 UTC |