Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: newbie question: case problem

Re: newbie question: case problem

From: Daniel Morgan <damorgan_at_x.washington.edu>
Date: Fri, 16 Jan 2004 08:22:04 -0800
Message-ID: <1074270050.201193@yasure>


Galen Boyer wrote:

> On 16 Jan 2004, eliepins_at_nrcan.gc.ca wrote:
> 

>>I am working on a search function for a database using
>>ColdFusion - the database is Oracle. The first attempt at the
>>code worked until a user put in a given name without the
>>capital, then no results were generated. In order to address
>>this problem, I added lower to the code. Now I achieve no
>>results at all. Any suggestions?
>>
>>
>> <cfloop index="i" list=#form.keyword# delimiters=" ">
>> select * from archive
>> where lower(projectnum) like '%lower(#i#)%'
>> or lower(title) like '%lower(#i#)%'
>> or lower(keywords) like '%lower(#i#)%'
>> or lower(investigators) like '%lower(#i#)%'
>> or lower(location) like '%lower(#i#)%'
>> or lower(establishment) like '%lower(#i#)%'
>> or lower(maps) like '%lower(#i#)%'
>> or lower(complocation) like '%lower(#i#)%'
>> or lower(reference) like '%lower(#i#)%'
>> <cfif isnumeric(i)>
>> UNION
>> select * from archive
>> where boxnum = #i#
>> </cfif>
>> UNION
>> </cfloop>
>> select * from archive where 1=2
>>
>></cfquery>
> 
> 
> lower doesn't go inside the quotes.
> 
> I'd suggest first executing your SQL inside SQLPlus before you
> try to make some program execute their version of it.

And what is the point of: select * from archive where 1=2?

-- 
Daniel Morgan
http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp
http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp
damorgan_at_x.washington.edu
(replace 'x' with a 'u' to reply)
Received on Fri Jan 16 2004 - 10:22:04 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US