Yep, key is reserved.

http://livedocs.macromedia.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=ColdFusion_Documentation&file=00000189.htm

On 6/21/05, Ian Skinner <[EMAIL PROTECTED]> wrote:
> Is "Key" possible a reserved word that would need to be escaped?  I believe 
> the common way to escape column names in SQL is ["Key"], but have only had to 
> do this a couple times in my career.
> 
> Example:
> SELECT
>    ["Key"] AS FooBar, ...
> FROM ..>
> 
> Just a wild assed suggestion, HTH.
> 
> 
> --------------
> Ian Skinner
> Web Programmer
> BloodSource
> www.BloodSource.org
> Sacramento, CA
> 
> "C code. C code run. Run code run. Please!"
> - Cynthia Dunning
> 
> ....-----Original Message-----
> ....From: Pete Ruckelshaus [mailto:[EMAIL PROTECTED]
> ....Sent: Tuesday, June 21, 2005 10:01 AM
> ....To: CF-Talk
> ....Subject: CFSEARCH query object frustration
> ....
> ....I am adding search functionality to the application that I am
> ....building.  The wrinkle is that I wrote a function that determines if
> ....the "inbound" search string is a complex (Verity) search or a simple
> ....(SQL) search; if it's Verity, I include one file, if SQL, I include
> ....the other.  The main reason for this is to allow users to perform
> ....simple searches against new data rather than having to constantly
> ....refresh the Verity collection.
> ....
> ....So, I have 2 possible "queries" and one set of display code (for
> ....simplicity and consistency).  Because I want to allow users to sort
> ....some of the result columns, I am doing a Query of a Query against the
> ....query object that CFSEARCH returns.  The problem is this.  As you may
> ....know, the developer has no real control over the column names that
> ....Verity returns, i.e. it returns key, rank, custom1, custom2, etc.
> ....rather than meaningful column names.  Since I am doing a QoQ against
> ....the cfsearch query object, I just figured that I would alias the query
> ....object "column names" to those names that I am using from the SQL
> ....query.  Well, the custom1, custom2, etc. column names have no problems
> ....with having aliases assigned, but when I try to  even select "key" in
> ....my statement (without aliasing it), the query bombs with this error:
> ...."Query Of Queries syntax error. Encountered "key. Incorrect Select
> ....List, Incorrect select column, "
> ....
> ....This is really weird, since when I do a cfdump of the returned query
> ....object, I see the "key" column.  Is this a bug?
> ....
> ....Other than assigning the value I need to one of the custom fields
> ....(which I can't, I've used all 4), is there a solution to my problem?
> ....
> ....Thanks,
> ....
> ....Pete
> ....
> ....
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:210156
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=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to