Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: question about a search
>Matt wrote:
>
>> I'm creating PSP pages.
>>
>> I have a page where a user can enter a search term, and two radio buttons to
>> select whether they would like to search the name field, or the description
>> field.
>>
>> So, I created a cursor like this:
>>
>> <%!cursor game_cursor is
>> select *
>> from video_game
>> where search_area LIKE '%&search_terms%';%>
You have to concatenate the variable into a longer string, otherwise you are just searching for something that actually contains the string 'search terms':
where search_area LIKE '%' || search_terms || '%';%>
& is meaningless in this context. Maybe you're thinking of the substitution character in SQL*Plus?
John
-- Photo gallery: http://www.pbase.com/john_russell/Received on Sat May 01 2004 - 13:24:22 CDT