in reply to Printing full SQL statement with placeholders

While not a strict perl solution: Nearly every SQL server that I've encountered keeps a log of SQL requests, whether from command line or from script. The full version of the SQL (with all placeholders filled) should be available here.

-----------------------------------------------------
Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain
"I can see my house from here!"
It's not what you know, but knowing how to find it if you don't know that's important

  • Comment on Re: Printing full SQL statement with placeholders

Replies are listed 'Best First'.
Re: Re: Printing full SQL statement with placeholders
by mpeppler (Vicar) on Oct 24, 2001 at 20:37 UTC
    Sybase will do this only with auditing turned on.

    DBI->trace is probably a better solution, although it's probably too heavy for general use.

    Maybe DBI's PrintError/RaiseError functionality should know about the parameters passed to execute() or bind_param(), and display/include them in the error message?

    Of course in the case of DBD::Sybase the error message is generated by the driver, so it might not be so easy to generalize, unfortunately...

    Michael