Watch SQL Execution

Discussion of testing theory and practice, including methodologies (such as TDD, BDD, DDD, Agile, XP) and software - anything to do with testing goes here. (Formerly "The Testing Side of Development")

Moderator: General Moderators

Post Reply
infamousjre
Forum Newbie
Posts: 2
Joined: Tue Mar 24, 2009 6:59 pm

Watch SQL Execution

Post by infamousjre »

Hey everyone, I am editing an existing page that does 5 or 6 SQL queries, but the queries exist inside some convoluted logic. I was wondering if anyone had any tricks to "watch" the SQL statements that get executed?

I can't echo because of how the page is set up. Right now I'm considering writing the queries to a file, but I'm not confident that I'll catch them all.
waylon999
Forum Commoner
Posts: 26
Joined: Mon Mar 23, 2009 5:29 pm

Re: Watch SQL Execution

Post by waylon999 »

I'm not sure what type of SQL you are working with, but in mysql you can turn on query logging to see what queries are being executed. There should be similar options for other databases.

This obviously works best in a controlled environment where there are not queries constantly being executed from other apps.

Here is a quick blurb about it, but you can find plenty more info online. If this is mysql and you need some help setting it up let me know.
infamousjre
Forum Newbie
Posts: 2
Joined: Tue Mar 24, 2009 6:59 pm

Re: Watch SQL Execution

Post by infamousjre »

mySQL that is...


Edit: you responded while I was elaborating. this post sounds very condescending now. haha...
Thanks, I'll check out the logging stuff. I've never heard of that, but looks like exactly what I wanted.
Post Reply