Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Interpolate binds into SQL on error - DBI subclassing

by Corion (Patriarch)
on Oct 11, 2005 at 19:13 UTC ( [id://499257]=note: print w/replies, xml ) Need Help??


in reply to Interpolate binds into SQL on error - DBI subclassing

This snippet will fail if the interpolated values themselves contain question marks - I would go for an eval-replace in the inner loop:

for my $b(@binds) { $b=$sth->{Database}->quote($b) unless DBI::looks_like_number($b); }; $stmt =~ s/\?/shift @binds/eg;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2024-04-24 00:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found