Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re^3: Using multiple values in a SQL "in" statement

by sundialsvc4 (Abbot)
on May 02, 2013 at 12:17 UTC ( #1031743=note: print w/ replies, xml ) Need Help??

in reply to Re^2: Using multiple values in a SQL "in" statement
in thread Using multiple values in a SQL "in" statement

Notice how, in one of the examples above, a string is (easily ...) constructed that consists of one-or-more question marks separated by commas.   This string is inserted dynamically (and safely) into the SQL string.   A corresponding parameter is added to the list of parameters at the same time, and the two are provided together when the query is run.   This technique is suitably dynamic, yet safe from injection.

I will also endorse the notion of using DBIx::Class ... or SQL::Abstract if you have a lot of existing code to deal with.   They are solid and helpful.

Comment on Re^3: Using multiple values in a SQL "in" statement

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2015-10-07 21:16 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (200 votes), past polls