Re: How to dump a sql query to text
I am not sure if this solves your problem, but if you have debugging turned on the server, you can get several information from the servicefactory debugging object. Here is a UDF that I wrote a while back which return true if the query ran was a cached one. http://www.cflib.org/udf.cfm?ID=1202 Thanks, Qasim On 1/22/07, Christopher Jordan <[EMAIL PROTECTED]> wrote: > > Yeah, but you'd still have a problem when using s. :o' > > Chris > > Scott Weikert wrote: > > Well, you could start by throwing the SQL query code into a var to begin > > with: > > > > > > > > Or build it up as you would build it within the tags. > > > > Then execute it: > > > > > > #SQLVar# > > > > > > And since it's already in a var, you can write it to your DB as you see > fit. > > > > > > ~| Upgrade to Adobe ColdFusion MX7 Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs http:http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:267223 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: How to dump a sql query to text
Yeah, but you'd still have a problem when using s. :o' Chris Scott Weikert wrote: > Well, you could start by throwing the SQL query code into a var to begin > with: > > > > Or build it up as you would build it within the tags. > > Then execute it: > > > #SQLVar# > > > And since it's already in a var, you can write it to your DB as you see fit. > > ~| Upgrade to Adobe ColdFusion MX7 Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs http:http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:267189 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: How to dump a sql query to text
Dude! That's cool. Now I *really* wish I was running on CF7. :o) Rick, I probably should have stated that my way is what I do in CFMX6.1 Chris Andy Matthews wrote: > CF7 has a built in variable that gets returned with every query. It contains > the actual final query language. It's [query_name].sql. > > > http://www.cfquickdocs.com/?getDoc=cfquery > > -Original Message- > From: Richard Colman [mailto:[EMAIL PROTECTED] > Sent: Monday, January 22, 2007 1:33 PM > To: CF-Talk > Subject: How to dump a sql query to text > > I wish to store the actual text of a SQL query to a logfile. > > At the risk of belaboring the obvious, from: > > > Select * from blah > > > I wish to actual put "select * from blah" into a text variable and write it > to a logfile or data table. > > Can someone suggest an easy way to do this? > > TNX. > > Rick Colman > > > > ~| Upgrade to Adobe ColdFusion MX7 Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs http:http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:267188 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: How to dump a sql query to text
The only way I've done that before is to do something like: Select * from blah Select * from blah Basically writing the query twice. It kinda sucks, but that's the only way I've thought of. Also, if your real sql contains cfqueryparams, then you have to get rid of those in the version that goes to the log file. If anyones got a better idea, I'd like to hear it too. :o) Cheers, Chris Richard Colman wrote: > I wish to store the actual text of a SQL query to a logfile. > > At the risk of belaboring the obvious, from: > > > Select * from blah > > > I wish to actual put "select * from blah" into a text variable and write > it to a logfile or data table. > > Can someone suggest an easy way to do this? > > TNX. > > Rick Colman > > ~| Upgrade to Adobe ColdFusion MX7 Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs http:http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:267186 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: How to dump a sql query to text
Well, you could start by throwing the SQL query code into a var to begin with: Or build it up as you would build it within the tags. Then execute it: #SQLVar# And since it's already in a var, you can write it to your DB as you see fit. ~| Upgrade to Adobe ColdFusion MX7 Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs http:http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:267185 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: How to dump a sql query to text
CF7 has a built in variable that gets returned with every query. It contains the actual final query language. It's [query_name].sql. http://www.cfquickdocs.com/?getDoc=cfquery -Original Message- From: Richard Colman [mailto:[EMAIL PROTECTED] Sent: Monday, January 22, 2007 1:33 PM To: CF-Talk Subject: How to dump a sql query to text I wish to store the actual text of a SQL query to a logfile. At the risk of belaboring the obvious, from: Select * from blah I wish to actual put "select * from blah" into a text variable and write it to a logfile or data table. Can someone suggest an easy way to do this? TNX. Rick Colman ~| Upgrade to Adobe ColdFusion MX7 Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs http:http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:267183 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
How to dump a sql query to text
I wish to store the actual text of a SQL query to a logfile. At the risk of belaboring the obvious, from: Select * from blah I wish to actual put "select * from blah" into a text variable and write it to a logfile or data table. Can someone suggest an easy way to do this? TNX. Rick Colman ~| Upgrade to Adobe ColdFusion MX7 Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs http:http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:267179 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4