Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

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

by pfaut (Priest)
on Dec 18, 2007 at 02:11 UTC ( #657587=note: print w/replies, xml ) Need Help??

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

That information may not be available. Oracle's OCI supports parameterized queries. The prepare step sends the statement with placeholders to the server for parsing and generation of an execution plan. The data is plugged in on the server at the time of execution. The full statement with data plugged into placeholders is never available to DBI or DBD::Oracle.

There may be other ways to find out, though. I know PostgreSQL can be told to keep a log of the statements it executes. If we knew what database you were working with, maybe someone who knows that database could tell you how to trace at the database.

90% of every Perl application is already written.
  • Comment on Re: Pretty printing the exact query (with bind variables) executed by DBI?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://657587]
[Corion]: ambrus: Oh - that one would be much harder to automate... The SYNOPSIS section should mostly be a runnable program IMO, but I write only small snippets in my documentation for single functions/methods, and creating the appropriate environment for ...
[Corion]: ... those in an automated fashion seems somewhat hard to me. Although it should do wonders for the test coverage ;)
[haukex]: Corion: I once wrote an automated thingy for that here
[haukex]: here's the code that uses it
[Corion]: haukex: Hmm - maybe I can reuse that. I see that it uses Pod::Parser, which I think was one of the more fragile parsers. But if I'm statically (re)generating the tests instead of doing that "live" on the client/tester machines, that's a much smaller...
[Corion]: ... problem space than trying to cater to all versions of Pod::Parser(s)

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (10)
As of 2017-02-27 12:20 GMT
Find Nodes?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?

    Results (385 votes). Check out past polls.