Perl script to pull SQL statements from CommLog
am 12.06.2007 20:56:09 von David GardnerThought this might be usefull to others. Every once and a while I start won=
dering what MS Access is doing to my queries, and want to get an idea if th=
e client app is actually using my indexes. I wrote a little Perl script to =
extract the SQL statements from the CommLog output to make it easy for me t=
o copy-paste statements into pgAdmin3. It takes the log file in as a comma=
nd line parameter, and spits the SQL statements to standard out, so running=
it looks like this:
getSQLfromLog.pl psqlodbc_4364.log > output2.sql
Feel free to use/modify whatever. I'm not much of a Perl guy, so I won't be=
offended if you point out any errors/bugs.
---
David Gardner, IT
The Yucaipa Companies
(310) 228-2855
--------------------------- getSQLfromLog.pl ---------------------
#! /usr/bin/perl
# Author: David Gardner davidgardner28@gmail.com
if ($#ARGV == -1 ) {
print ("Usage: getSQLfromLog.pl