Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^2: Answer: What are placeholders in DBI, and why would I want to use them?

by BrowserUk (Pope)
on Dec 30, 2015 at 12:39 UTC ( #1151502=note: print w/replies, xml ) Need Help??


in reply to Re: Answer: What are placeholders in DBI, and why would I want to use them?
in thread What are placeholders in DBI, and why would I want to use them?

You can, however, do something along the lines of: 01 my $sql = '... WHERE foo IN (' . join(',', ('?') x scalar( @values )) . ') ...'; in order to generate the proper placeholder-based statement that you can then pass your parameters into.

Only if you will have the same number of parameters for each binding; and know that number a priori when you prepare the statement.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
In the absence of evidence, opinion is indistinguishable from prejudice.
  • Comment on Re^2: Answer: What are placeholders in DBI, and why would I want to use them?

Replies are listed 'Best First'.
Re^3: Answer: What are placeholders in DBI, and why would I want to use them?
by MidLifeXis (Monsignor) on Dec 30, 2015 at 12:43 UTC

    Yes, absolutely. I made the assumption (probably poor) that this was not for performance, but to use placeholders in the SQL. Update to my response is in order done.

    --MidLifeXis

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2021-08-02 00:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My primary motivation for participating at PerlMonks is: (Choices in context)








    Results (16 votes). Check out past polls.

    Notices?