Seems like you would just select them all and do a QoQ... probably the
fastest way to do it but, that may not be true depending on the number
of records you are returning.
So query for all and then go check out QoQ
http://livedocs.macromedia.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=ColdFusion_Documentation&file=00001265.htm
snippet from livedocs referenced above:
To use the results of a query in a query:
1. Create a ColdFusion page with the following content:
<h1>Employee List</h1>
<!--- LastNameSearch (normally generated interactively) --->
<cfset LastNameSearch="Doe">
<!--- Master Query --->
<cfquery datasource="cfdocexamples" name="master"
cachedwithin=#CreateTimeSpan(0,1,0,0)#>
SELECT * from Employee
</cfquery>
<!--- Detail Query (dbtype=query, no data source) --->
<cfquery dbtype="query" name="detail">
SELECT Emp_ID, FirstName, LastName
FROM master
WHERE LastName=<cfqueryparam value="#LastNameSearch#"
cfsqltype="cf_sql_char" maxLength="20"></cfquery>
<!--- output the detail query results --->
<p>Output using a query of query:</p>
<cfoutput query=detail>
#Emp_ID#: #FirstName# #LastName#<br>
</cfoutput>
<p>Columns in the master query:</p>
<cfoutput>
#master.columnlist#<br>
</cfoutput>
<p>Columns in the detail query:</p>
<cfoutput>
#detail.columnlist#<br>
</cfoutput>
2. Save the page as query_of_query.cfm in the myapps directory
under the web_root.
3. Display query_of_query.cfm in your browser
On 2/2/07, Anthony Mathis <[EMAIL PROTECTED]> wrote:
Let me try to explain what I trying to accomplish a little bit better.
I'm not sure if cfcs can do this. Documentation seems to make me think
that they can.
In my test.cfm I have the following:
<cfoutput>#qryWINDOWS.recordcount#</cfoutput>
<cfoutput>#qryLINUX.recordcount#</cfoutput>
I'm using the following query from a cfinclude action.cfm (contains
multiple queries).
<!---Query for Windows OS--->
<cfquery datasource="#APPLICATION.dsn#" name="qryWINDOWS">
SELECT *
FROM stats
WHERE os = 'WINDOWS'
</cfquery>
<!---Query for Linux OS--->
<cfquery datasource="#APPLICATION.dsn#" name="qryLINUX">
SELECT *
FROM stats
WHERE os = 'LINUX'
</cfquery>
How can I accomplish this without using mulitiple queries for LINUX,
MAC, UNIX, etc.., using a cfc? I'm new to the cfcs and after reading
the documentation, It looks like the above is possible, plus I can cut
down on my code.
I would assume I could use variable(s) as follows:
<cfquery datasource="#APPLICATION.dsn#" name="qryOS">
SELECT *
FROM stats
WHERE #var1# = #var2#
</cfquery>
How would I pass #var1# and #var2# from my cfm to the cfc? Any examples
would be great.
How I display the return recordcount would be great as well. By the
way, the output takes place on the same cfm (test.cfm).
-------------------------------------------------------------
To unsubscribe from this list, manage your profile @
http://www.acfug.org?fa=login.edituserform
For more info, see http://www.acfug.org/mailinglists
Archive @ http://www.mail-archive.com/discussion%40acfug.org/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------
--
Steven Ross
web application & interface developer
http://www.zerium.com
[mobile] 404-488-4364
[fax] 267-482-4364
-------------------------------------------------------------
To unsubscribe from this list, manage your profile @
http://www.acfug.org?fa=login.edituserform
For more info, see http://www.acfug.org/mailinglists
Archive @ http://www.mail-archive.com/discussion%40acfug.org/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------