freelanceprogrammers.org Forum Index » Cold Fusion

Parenthesis Problem


View user's profile Post To page top
mgann@... Posted: Thu Mar 23, 2000 5:37 am


Joined: 11 Mar 2000

Posts: 7
Parenthesis Problem
Hello to all.

I copied the search code from the Ben Forta book (page 524, and below).
When I run it, I get the following ODBC Error:

Invalid use of `.`, `!`, or `()`. in query expression `(GraphicID LIKE
`%14%`) AND (0=1 OR (0=0 AND KEYWORDS LIKE `%build%` AND KEYWORDS LIKE
`%japan%` `.

I`ve paren`d: (0=1), (0=0) (KEYWORDS LIKE %#word#%)...tried adding right
parens after </CFLOOP> and after </CFIF>.....I`ve paren`d till the cows
come home...the error changes - but it never looks like the right parens
show up on the right.

Help!

Thanks,
Melanie

<CFquery datasource="graphix" name="GetKeys" debug="Yes">
Select
ID, GraphicID, Title, Photographer, Filmtype, Keywords
From GraphicIndex
WHERE (GraphicID LIKE `%#Category#%`)
<CFIF search_for IS NOT "">
<!-- Dummy Clause for the First of the ORd clauses -->
AND (0=1
<!-- Loop through each line -->
<CFLOOP INDEX="line" LIST="#search_for#" DELIMITERS="#CRLF#">
OR (0=0
<CFLOOP INDEX="word" LIST="#search_for#" DELIMITERS=" ">
AND KEYWORDS LIKE `%#word#%`
</CFLOOP>

</CFLOOP>
)

</CFIF>
)
Order by Title
</CFQUERY>
Melanie Gann
Second Street Web Design
www.second-street.com
Reply with quote
Send private message
View user's profile Post To page top
jeffc@... Posted: Thu Mar 23, 2000 7:41 pm


Joined: 22 Mar 2000

Posts: 17
Parenthesis Problem
Have you tried leaving the ()`s out all together?

Jeff Cabell
jeffc@...

----------------
Never take life seriously, nobody gets out alive anyway.

> -----Original Message-----
> From: Melanie Gann [mailto:mgann@...]
> Sent: Wednesday, March 22, 2000 6:56 PM
> To: 00-cold-fusion-WACK4@onelist.com; cold_fusion@onelist.com
> Subject: [cold_fusion] Parenthesis Problem
>
>
> From: Melanie Gann <mgann@...>
>
> Hello to all.
>
> I copied the search code from the Ben Forta book (page 524,
> and below).
> When I run it, I get the following ODBC Error:
>
> Invalid use of `.`, `!`, or `()`. in query expression `(GraphicID LIKE
> `%14%`) AND (0=1 OR (0=0 AND KEYWORDS LIKE `%build%` AND KEYWORDS LIKE
> `%japan%` `.
>
> I`ve paren`d: (0=1), (0=0) (KEYWORDS LIKE %#word#%)...tried
> adding right
> parens after </CFLOOP> and after </CFIF>.....I`ve paren`d
> till the cows
> come home...the error changes - but it never looks like the
> right parens
> show up on the right.
>
> Help!
>
> Thanks,
> Melanie
>
> <CFquery datasource="graphix" name="GetKeys" debug="Yes">
> Select
> ID, GraphicID, Title, Photographer, Filmtype, Keywords
> From GraphicIndex
> WHERE (GraphicID LIKE `%#Category#%`)
> <CFIF search_for IS NOT "">
> <!-- Dummy Clause for the First of the ORd clauses -->
> AND (0=1
> <!-- Loop through each line -->
> <CFLOOP INDEX="line" LIST="#search_for#" DELIMITERS="#CRLF#">
> OR (0=0
> <CFLOOP INDEX="word" LIST="#search_for#" DELIMITERS=" ">
> AND KEYWORDS LIKE `%#word#%`
> </CFLOOP>
>
> </CFLOOP>
> )
>
> </CFIF>
> )
> Order by Title
> </CFQUERY>
> Melanie Gann
> Second Street Web Design
> www.second-street.com
>
>
> --------------------------------------------------------------
> ----------
> GET A NEXTCARD VISA, in 30 seconds! Get rates as low as 0.0%
> Intro or 9.9% Fixed APR and no hidden fees. Apply NOW!
> http://click.egroups.com/1/937/4/_/291057/_/953769154/
> --------------------------------------------------------------
> ----------
>
>
Reply with quote
Send private message
View user's profile Post To page top
mgann@... Posted: Thu Mar 23, 2000 8:19 pm


Joined: 11 Mar 2000

Posts: 7
Parenthesis Problem
Yes....it did not work either.

At 08:41 AM 3/23/00 -0500, you wrote:
>From: Jeff Cabell <jeffc@...>
>
>Have you tried leaving the ()`s out all together?
>
>Jeff Cabell
>jeffc@...
>
>----------------
>Never take life seriously, nobody gets out alive anyway.
>
>> -----Original Message-----
>> From: Melanie Gann [mailto:mgann@...]
>> Sent: Wednesday, March 22, 2000 6:56 PM
>> To: 00-cold-fusion-WACK4@onelist.com; cold_fusion@onelist.com
>> Subject: [cold_fusion] Parenthesis Problem
>>
>>
>> From: Melanie Gann <mgann@...>
>>
>> Hello to all.
>>
>> I copied the search code from the Ben Forta book (page 524,
>> and below).
>> When I run it, I get the following ODBC Error:
>>
>> Invalid use of `.`, `!`, or `()`. in query expression `(GraphicID LIKE
>> `%14%`) AND (0=1 OR (0=0 AND KEYWORDS LIKE `%build%` AND KEYWORDS LIKE
>> `%japan%` `.
>>
>> I`ve paren`d: (0=1), (0=0) (KEYWORDS LIKE %#word#%)...tried
>> adding right
>> parens after </CFLOOP> and after </CFIF>.....I`ve paren`d
>> till the cows
>> come home...the error changes - but it never looks like the
>> right parens
>> show up on the right.
>>
>> Help!
>>
>> Thanks,
>> Melanie
>>
>> <CFquery datasource="graphix" name="GetKeys" debug="Yes">
>> Select
>> ID, GraphicID, Title, Photographer, Filmtype, Keywords
>> From GraphicIndex
>> WHERE (GraphicID LIKE `%#Category#%`)
>> <CFIF search_for IS NOT "">
>> <!-- Dummy Clause for the First of the ORd clauses -->
>> AND (0=1
>> <!-- Loop through each line -->
>> <CFLOOP INDEX="line" LIST="#search_for#" DELIMITERS="#CRLF#">
>> OR (0=0
>> <CFLOOP INDEX="word" LIST="#search_for#" DELIMITERS=" ">
>> AND KEYWORDS LIKE `%#word#%`
>> </CFLOOP>
>>
>> </CFLOOP>
>> )
>>
>> </CFIF>
>> )
>> Order by Title
>> </CFQUERY>
>> Melanie Gann
>> Second Street Web Design
>> www.second-street.com
>>
>>
>> --------------------------------------------------------------
>> ----------
>> GET A NEXTCARD VISA, in 30 seconds! Get rates as low as 0.0%
>> Intro or 9.9% Fixed APR and no hidden fees. Apply NOW!
>> http://click.egroups.com/1/937/4/_/291057/_/953769154/
>> --------------------------------------------------------------
>> ----------
>>
>>
>
>------------------------------------------------------------------------
>GET A NEXTCARD VISA, in 30 seconds! Get rates
>as low as 0.0% Intro APR and no hidden fees.
>Apply NOW!
>http://click.egroups.com/1/975/4/_/291057/_/953818764/
>------------------------------------------------------------------------
>
>
>
Melanie Gann
Second Street Web Design
www.second-street.com
Reply with quote
Send private message
Post new topic Reply to topic
Display posts from previous:   
 

All times are GMT
Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Freelace Website Designer - Customer web design and software building.
China Wholesale - Electronics Products
Character Studio - Tutorials and Help