> > I'm using ColdFusion 4.5.1 or 4.5.2. Please no CFMX
> > solutions unless they also work in ColdFusion 4.5.x.
>
> How about this... (it's a bit messy)
>
> <cfquery...>
> <cfsavecontent variable="myquery">
> SELECT *
> FROM myTable
> WHERE something = <cfqueryparam value="#myvalue#"...>
> </cfsavecontent>
> <cfoutput>#myquery#</cfoutput>
> </cfquery>
> <cfoutput>#myquery#</cfoutput>
A few notes on this. First, I think that CFSAVECONTENT was introduced in CF
5, so you'd need to use a custom tag instead in previous versions. That
custom tag might look something like this (absent error handling):
<cfif ThisTag.ExecutionMode is "end">
<cfset rs = SetVariable("Caller.#Attributes.variable#",
ThisTag.GeneratedContent)>
</cfif>
Second, I don't think you'll be able to effectively use CFQUERYPARAM within
CFSAVECONTENT. CFQUERYPARAM builds a prepared statement, which separates the
values within an SQL statement from the actual SQL statement itself. So,
where the CFQUERYPARAM tag now sits, you'd see a question mark in the actual
SQL statement.
Finally, you wouldn't use CFOUTPUT within CFQUERY; you could just reference
your variable directly.
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Your ad could be here. Monies from ads go to support these lists and provide more
resources for the community. http://www.fusionauthority.com/ads.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4