Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^4: DBD::Pg - $sth->execute($csv_var) ERROR

by soonix (Canon)
on Mar 13, 2020 at 08:01 UTC ( [id://11114208]=note: print w/replies, xml ) Need Help??


in reply to Re^3: DBD::Pg - $sth->execute($csv_var) ERROR
in thread DBD::Pg - $sth->execute($csv_var) ERROR

You are on the right track with Re^2: DBD::Pg - $sth->execute($csv_var) ERROR, but to understand why this doesn't work
I thought $sth->execute($columns,$values); would be closer to passing the flat comma separated string Pg needs.
you need to be aware of the difference between
  • a string containing comma separated list of values (in Perl: a scalar)
  • a list of values (in Perl: a list or an array)
So, even DBI could use "placeholded" column names, you'd have to execute ( split(/,\s*/,$columns), split(/,\s*/, $values))

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11114208]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (5)
As of 2024-04-18 11:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found