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

Re: Can DBI modify queries on the fly?

by perrin (Chancellor)
on Feb 17, 2009 at 23:42 UTC ( #744594=note: print w/ replies, xml ) Need Help??

Comment on Re: Can DBI modify queries on the fly?
Re^2: Can DBI modify queries on the fly?
by kyle (Abbot) on Feb 18, 2009 at 02:07 UTC

    Wow, I wish that were more documented. I haven't tried it yet, but I suspect that will work great. My main concern comes from this line of the tests:

    is ref $attr, 'HASH', 'param modified by callback - not recommended!';

    Modifying params by callback is exactly what I want to do. So why is it not recommended? I'm guessing this means that the solution I eventually come up with will stop working at some point in the future, but I guess I'll curse that bridge when I come to it.

      That refers to modifying @_ only, not modifying copies of what's in @_ or SQL placeholders

        That's kind of the whole point, though, isn't it? The callback can't return any values. The only way to make any changes to what's going on is to modify the parameters directly. Or am I missing something?

        As such, you have to worry about changing the application's data under its nose. You also have to watch out for the case where you're passed a read-only value.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (10)
As of 2014-04-19 01:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (475 votes), past polls