>
> If certain parameters are not met, that query named, for
> example, Query1 is used
>
> If the parameters are met, then a second query called Query2
> is ran and the contents of that Query are joined with a Union
> statement to the first query and Query3 is produced. (so
> there's more data on the page)
>
> So in effect, either Query1 or Query3 is going to be the
> query that will be used to produce the data on the page.
You should be able to just use the same name again if you need to:
<cfquery name="qFoo" ...>
...
</cfquery>
<cfif something_is_true>
<cfquery name="qBar" ...>
...
</cfquery>
<cfquery name="qBaz" dbtype="query">
SELECT * FROM qFoo
UNION
SELECT * FROM qBar
</cfquery>
<cfset qFoo = qBaz>
</cfif>
<cfoutput query="qFoo">...
But, honestly, there's probably a more efficient and simple way to do
whatever it is you're doing. Why not just run one query or another, rather
than one query and another, unless they're in different (unlinkable)
databases?
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
phone: 202-797-5496
fax: 202-797-5444
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

