Please let me know how to display the query written in cold fusion page on web browser.
I'm not entirely clear what you're asking. If you want to output the actual SQL statement, it's a property of the CFQUERY resultset, like so:
<cfquery name="sample" result="sampleResult" ...>
select * from tblSample
If on the other hand, you want to output the resultset itself, you use the QUERY attribute of CFOUTPUT:
<cfquery name="books" ...>
select bookId, name, author from tblBooks
Dave Watts, Eidolon LLC
ColdFusion comes with a built-in datasource called cfartgallery. So, if you open the following page, it will display the query in the browser.
<cfquery datasource="cfartgallery" name="testQuery"> select * from artists </cfquery> <cfdump var="#testQuery#">
Thank a lot BKBK and others for the solutions provided by you all. I am trying to print the dynamic query which i will writing in my .cfm page on to the browser. Will test the sample code provided by BKBK.