Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^3: Flexible Update SQL

by roboticus (Chancellor)
on Dec 02, 2010 at 02:53 UTC ( #874807=note: print w/replies, xml ) Need Help??


in reply to Re^2: Flexible Update SQL
in thread Flexible Update SQL

bichonfrise74:

Actually, placeholders *do* handle the null parameter. Constructing the update statement can do the rest...

my @fields = qw(name phone city country); my $SQL = "update table set " . join(", ", map { "$_=?" } @fields) . "where ...."; my $ST=$DB->prepare($SQL); while (...) { my @values = (.....); $ST->execute(@values); }

...roboticus

When your only tool is a hammer, all problems look like your thumb.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2022-12-08 13:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?