|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Viewing query
Hi,
Is there a way to see what query was actually submitted to the database with CF? In other languages I'd build my query in a variable and then simply print my variable for debugging purposes, but CF seems to be set up do things a little differently. Any help appreciated, wdn2k |
|
#2
|
|||
|
|||
|
The full SQL for every query run during a request is available as part of the debugging output. You enable this in the CF administrator.
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian. How to Post a Question in the Forums |
|
#3
|
||||
|
||||
|
Thanks.
Unfortunetly I can't turn that on. wdn2k |
|
#4
|
|||
|
|||
|
In that case, you could make a copy of the SQL that is within your cfquery tag and wrap in in a cfsavecontent tag. This will capture the evaluated SQL to a variable which you can then output to see the SQL statement.
|
|
#5
|
||||
|
||||
|
Thanks for the idea, I'll give it a try.
wdn2k |
|
#6
|
|||
|
|||
|
Another approach, although much less elegant
![]() <!--- <cfquery ...> ---> <cfoutput> SELECT someField FROM someTable WHERE someID = #URL.someID# </cfoutput> <!--- </cfquery> ---> <cfabort> Hope that helps. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > Viewing query |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|