Yeah..maybe a little m ore clarification would have helped...but certainly
to not use it all would be a tad harsh ;-)



-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: 20 July 2005 16:23
To: CF-Talk
Subject: RE: CFQuery and SQLBase - alternative to using asterisk

I think the point is that if you do not need ALL fields of a table, then you
should specify the fields you DO need instead of using the all generic *.
Say you have a table with several text, blob or other big fields, but you
only need to check 3 fields in a query...using * uses alot of server
overhead when unnecessary.  It is generally considered 'sloppy' programming,
and does have an impact on applications depending on the # of fields and
field types in their databases.  

To say it should never be used should be replaced with "it should never be
used unless you are retrieving all fields from  a table" and even then,
specifying the field names will be more helpful to anyone else who may come
back to your code after 2 years (including yourself!) and is trying to
figuer out what fields the query is pulling.  

Generally speaking, it is best practice to designate your fields in the
SELECT statement for ease of code reading and maximum efficiency.

*Whew*

Dave

-----Original Message-----
From: Robertson-Ravo, Neil (RX)
[mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 20, 2005 11:04 AM
To: CF-Talk
Subject: RE: CFQuery and SQLBase - alternative to using asterisk


That is a fairly loose statement... "your shouldn't ever...."  what if there
is a need? There is not founding in you stating you shouldn't ever use it.



-----Original Message-----
From: Al Everett [mailto:[EMAIL PROTECTED] 
Sent: 20 July 2005 15:50
To: CF-Talk
Subject: Re: CFQuery and SQLBase - alternative to using asterisk

You shouldn't ever use SELECT *. Name the columns you want.

For the other, try PHONE##.

On 7/20/05, Perez, Percy <[EMAIL PROTECTED]> wrote:
> Hello,
> 
> I am having problems doing a simple SQL select.
> 
> When I enter: SELECT * from TABLE1, I get an error message that the
> asterisk is an invalid character.  However, if I used  dreamweaver to
> view data, I get all the columns and records.  If I do a select listing
> some of the fields it works.
> 
> Also, the original database creators added a "PHONE#" field.  Of course
> the # sign is not well liked by coldfusion.  I trying using a bracket to
> escape the special character but no go.
> 
> Unfortunately, I can not alter the table since it is provided by ADP
> (Payroll Company) and there is a GUI interface provided by them.
> 
> Any suggestions?
> 
> Thank you in advanced.
> 
> Percy
> 
> Systems Administrator
> Versa Products Company Inc
> 22 Spring Valley Road
> Paramus NJ 07652
> Ph:201.843.2400
> Fx: 201.843.2931
> 
> 
> 







~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:212320
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to