Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: how to search multiple columns?
jimi_xyz_at_hotmail.com wrote:
> I have four columns. OBJECTIVES, APPROACH, SCOPE and a TITLE column. I
> want the user to be able to pick where he/she wants to search, and to
> be able to search two or more of these columns. Example the user checks
> off that he/she wants to search the OBJECTIVE and the TITLE column, but
> im having difficulty trying to figure out how to do this. I know you
> can't create a index on multiple columns, with Oracle fullText. I need
> ideas on how to conqueror this task, examples or links work to.
>
> Thanks in advance,
> Jimmie
>
You can construct the SQL dynamically based on what the user has
checked. After you have the final SQL, just execute it using a
REF Cursor.
The syntax might look this way:
cur_opp_ref_cursor := open_cursor();
LOOP
FETCH cur_opp_rec_cursor INTO recCur; EXIT WHEN cur_opp_rec_cursor%NOTFOUND; ....
END LOOP; FUNCTION open_task_cursor( ) RETURN a_ref_cursor IS
cur_opp a_ref_cursor;
BEGIN
OPEN cur_opp FOR "your constructed SQL!"
END;
Received on Tue Jul 26 2005 - 04:44:32 CDT