When you use the wildcard two queries happen. One to find the name of the
fields and another to actually do the query. If you are returning all 50
fields then you are using up server resources by storing more query results
in memory. It is best to be a specific as possible for each query. If you
want to use some kind of template to do a query you could do something like
this. This just keeps you from having to write the query 80 times.
In the calling template
<cfset fieldtoquery="a1,a2,a3...">
<cfinclude template="querytemplate.cfm">
______________________________
In your query template
<cfparam name="fieldtoquery" default="a1">
<Cfquery datasource...>
select #fieldtoquery#
</cfquery>
Byron
-----Original Message-----
From: Michel Gagnon [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 12, 2000 12:33 PM
To: [EMAIL PROTECTED]
Subject: To wildcard or not to wildcard (the SELECT statement)
When we query with a star (*) in the SELECT statement,
does MS-Access return all the fields, even if they are empty?
I have over 50 fields in a perticuar table, but some pages only
use 3 or 4 of them. The rest are empty.
For performances sake, am I better off using:
<CFQUERY DATASOURCE="CSM" NAME="Data">
SELECT a1,a2,a3
FROM test
</cfquery>
instead of:
<CFQUERY DATASOURCE="CSM" NAME="Data">
SELECT *
FROM test
</cfquery>
Will it make a difference in speed?
(It would be alot simpler to use the *
----------------------------------------------------------------------------
--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.