So a small change - but a nice one. If you dump a query in ColdFusion 8, you now get a set of additional information along with the data. You get...
- Whether or not the query was cached
- The execution time
- And best of all - the SQL!
- Lastly - if your SQL contained any cfqueryparam tags, there will be a SQLParameters key that is an array of the values used in the cfqueryparam tags.
Edited to add last bullet point.
Archived Comments
Ray,
Do you get the SQL with or without "?"s ?.
tof asked the same question I was about to ask! This SQL output will include variables passed through CFSQLPARAM or just "?"?
He he, "poo". :) I think this is a great update to the CFDump tag.
I'll test right now.
So it shows a ?. But, there is an additional value in the dump - SQL Parameters, that is an array of values for the ?.
FANTASTIC.
Can you post a print? :)
Thanks as ever Ray.
Well I'll be damned... Maybe there's some other way of doing this or I'm just stating the obvious, but to access that SQL value it seems you need to specify the "result" attribute in the CFQUERY tag and the structure it produces will have the SQL value. But you know what else? That's not new in Scorpio, it works in CF 7 MX too. And I never knew about it. I'm rather happy I just found out because I'm gonna need to use this, like, immediately for a project!
Btw Ray, am I correct in assuming that this could be used to update ColdFire, since right now if you use cfqueryparam ColdFire doesn't display the right values for the query.
ColdFire has an update for this - submitted by someone in the community. I just haven't had a chance to approve it. I'm still recovering from the week or so of going from PC to Mac.
You can go back to the old behaviour, if you like, by specifying false for metainfo attribute on the cfdump tag.
Thats nice. I assume it will be properly documented?
I really love this enhanced feature. Saves me from a lot of going back and forth.