Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Pretty printing the exact query (with bind variables) executed by DBI?

by erix (Parson)
on Dec 18, 2007 at 02:45 UTC ( #657590=note: print w/replies, xml ) Need Help??


in reply to Pretty printing the exact query (with bind variables) executed by DBI?

I find it handy (as a debug facility) to add the actual values out-commented behind the placeholders. This doesn't give you the exact statement but it makes it easy to reproduce them, or just to check the actual values that the statement was executed with:

select name, address, phone where name = ? -- 'Doe'

Another approach would be to let DBI trace produce its mess, and make your statements easy to parse out of the 'wealth of information' by a markup scheme, again SQL-outcommented, of course:

-----8<--------------- select name, address, phone where name = ? -----8<---------------

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2020-12-05 15:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you use taint mode?





    Results (64 votes). Check out past polls.

    Notices?