> I have a program that I have been asked to modify and enhance.
> 
> This is easily done (well relatively easy) but I would like 
> to get some feedback re the way the program is currently structured.
> 
> The application uses a MSSQL database to store information.  
> Currently Stored Procedures are not used at all in the entire 
> application.  The application runs on a CF7 standard platform 
> and IIS.  There are no CFCs used in the application.  All 
> queries are used "inline"
> 
> Now for the interesting part.
> 
> Lets say the program is supposed to display a list of 
> salesmen and their sales for Jan, Feb & Mar
> 
> So in the program there is a header line to list what each 
> column of the display is.
> 
> Then the detail lines there are
> 
> <tr>
> <td>query get salesman</td>
> <td>query get salesman and jan figures</td> <td>query get 
> salesman and feb figures</td> <td>query get salesman and mar 
> figures</td> </tr>
> 
> then a total line
> 
> So basically everytime a line is produced for a salesman then 
> the queries are run.  This to me seems would be one reason 
> why the program takes a long period of time to run.
> 
> Queries are being run multiple times which seems very inefficient.
> 
> Just wondering what others think.

I think you should fetch this in a single query (or stored procedure, it
doesn't really matter for this) and use the GROUP attribute of CFOUTPUT to
arrange your data the way you want.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Get the answers you are looking for on the ColdFusion Labs
Forum direct from active programmers and developers.
http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid-72&catid=648

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:287482
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to