Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

RE: DBI Quoting question

by lhoward (Vicar)
on May 10, 2000 at 21:03 UTC ( [id://11012]=note: print w/replies, xml ) Need Help??


in reply to DBI Quoting question

Placeholders are definitely the way to go. However there is another approach that can be useful for situations where you can't use palceholders. The only example that comes to mind of a time where you can't use placeholders is "selet * from foo where bar in (?)" where you want to specify a list with an unknown number of elements for ?.

The DBH quote function will quote a variable apropriately for the DB that your handle is connected to, escaping all necessary metacharacters, etc....

my $s=$dbh->quote($a);

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (1)
As of 2024-04-25 04:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found