Are you selecting only the columns that you need to display? If you
select * and it's a large table it could take significantly longer than
if you select just the columns you need to display. Are all the tables
related? If so, what do you get if you join them all like this?
<cfquery name="1">
SELECT o.name, o.address, t2.column1, t3.column1, t4.column1,
t5.column1, t6.column1
FROM orders o, table2 t2, table3 t3, table4 t4, table5 t5,
table6 t6
WHERE o.customer_id = t2.customer_id
AND o.customer_id = t3.customer_id
AND o.customer_id = t4.customer_id
AND o.customer_id = t5.customer_id
AND o.customer_id = t6.customer_id
</cfquery>
<CFOUTPUT QUERY="1">
#NAME#, #ADDRESS#<br>
#t2.column1#<br>
#t3.column1#<br>
#t4.column1#<br>
#t5.column1#<br>
#t6.column1#
</CFOUTPUT>
Greg Luce
954-763-4504
-----Original Message-----
From: Kola Oyedeji [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 14, 2001 10:15 AM
To: CF-Talk
Subject: RE: CFOUTPUT Challenge
> To test the solution I only added one other query (so there's
> four more to
> go) and it slowed the process down considerably.... Do you
> see any way
> around this?
using stored procedures should improve the performance. Not sure if you
can
nest stored procedure calls, just a thought.
Kola Oyedeji
Web developer
Macromedia Certified Advanced ColdFusion 5 Developer
http://www.Alexandermark.com
(+44)020-8429-7300
> -----Original Message-----
> From: Janine Jakim [mailto:[EMAIL PROTECTED]]
> Sent: 14 September 2001 14:46
> To: CF-Talk
> Subject: RE: CFOUTPUT Challenge
>
>
> Thanks- that works. I had all my queries listed together on
> a separate
> page- I hate when I make those basic mistakes....
> However, this leads to another problem and I don't know if
> it's fixable.
> To test the solution I only added one other query (so there's
> four more to
> go) and it slowed the process down considerably.... Do you
> see any way
> around this?
>
> -----Original Message-----
> From: Greg Luce [mailto:[EMAIL PROTECTED]]
> Sent: Friday, September 14, 2001 9:36 AM
> To: CF-Talk
> Subject: RE: CFOUTPUT Challenge
>
>
> Janine,
> I don't know if I understand your situation completely, but if
> your main CFOUTPUT returns a resultset of "customers", then you want 5
> other queries regarding that customer, you can run those
> queries inside
> the main CFOUTPUT and loop over the results of each query. Something
> like this:
>
> <CFOUTPUT QUERY="1" GROUP="CustomerID">
> #NAME#, #ADDRESS#
> <CFQUERY name="2">
> SELECT *
> FROM orders
> WHERE customer_id = #1.customer_id#
> </cfquery>
> <CFLOOP query="2">
> #2.Order1# #Order2#
> </CFLOOP>
> <CFQUERY name="3">
> SELECT *
> FROM some_other_table
> WHERE customer_id = #1.customer_id#
> </cfquery>
> <CFLOOP query="3">
> #3.Order1# #Order2#
> </CFLOOP>
> </CFOUTPUT>
>
> Or it sounds like you possibly could join all 6 tables in a query. Let
> me know if the looping way works.
>
> Greg Luce
> 954-763-4504
>
>
> -----Original Message-----
> From: Janine Jakim [mailto:[EMAIL PROTECTED]]
> Sent: Friday, September 14, 2001 8:41 AM
> To: CF-Talk
> Subject: CFOUTPUT Challenge
>
> I have what I consider an interesting problem.
> I need to send the results of 6 queries out to make one form.
> (report/pdf
> style).
> My main query- person demographic query works great and opens up the
> correct
> number of reports (1 report per person). However, the other 5 queries
> only
> give the information for the 1st person. I realize this is because of
> the
> cfoutput of the main query vs subqueries.
> For example
> <CFOUTPUT QUERY="1" GROUP="CustomerID">
> #NAME#, #ADDRESS#
> <CFOUTPUT>
> #Orders.Order1# #Order2#
> </CFOUTPUT>
> </CFOUTPUT>
>
> I don't think qofq is the answer because of the amount of the queries
> (6)
> and the way they are handled. (Some of the queries do not
> have a direct
> link
> to the 1st query)
> I have tried:
> -Leaving out the 2nd cfoutput statement- that results in all the
> customers
> having the same orders.
> - Adding a <CFIF> statement for the 2nd output statement-
> <CFIF 1.CustomerID EQ Orders.CustomerID>
> <CFOUTPUT>- this results in only the 1st persons order information
> showing
> up.
> -<CFLOOP LIST> with and without the cfif statement. Same results as
> above..
>
> I can not change it to:
> <CFOUTPUT QUERY="1" GROUP="CustomerID">
> #NAME#, #ADDRESS#
> </CFOUTPUT>
> <CFOUTPUT>
> #Orders.Order1# #Order2#
> </CFOUTPUT>
> This causes only 1 form to show up.
> I'm stumped on how to do this....Does anyone have any
> ideas....certainly
> I
> am not going "where no man has ever gone before"
> Thanks in advance.
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists