SixFive...

cfqueryparam debug replace question marks

I was getting pretty unhappy with the whole question mark situation today whilst trying to debug a query. As a standard we use cfqueryparam all the time and if you get a large query with lots of variables then it can be a nightmare if you need to run it Query Analyzer. So I fiddled […]
July 26, 2006 7:12 pm

cfqueryparam debug replace question marks

I was getting pretty unhappy with the whole question mark situation today whilst trying to debug a query. As a standard we use cfqueryparam all the time and if you get a large query with lots of variables then it can be a nightmare if you need to run it Query Analyzer. So I fiddled around for a while and started to try and get the debugging to replace the question marks with the proper values. Heres what I came up with: The debug file that produces the debugging is in the {cfroot}\wwroot\WEB-INF\debug at least on a single server install. We run multiserver in production but we never have debiug on over there, so theres no point in putting it up. Before we start copy the classic.cfm and call it queryParam.cfm just in case we bugger it up – also its copyright Adobe etc etc. download the completed file here. Near the top of the queryParam.cfm (line 59 for me) there is a query:

Could not embed GitHub Gist 2012575.js?file=queryParam.cfm: Not Found

Now a word of dislaimer – this is only done for SQL server, and I havent tested it massively. If you find that a var doesnt have the single quotes around it then add the cf_sql_vtypename to this line:

Save it and go to your cfadministrator – open the debugging settings section and change the debug template to queryParam.cfm. Save and try it out. Any comments or improvements I would love to hear them! This only works on CF 7.0 and above.

Leave a Comment