Hello Folks,
I have written the below mentioned search() function which takes a 'one word' as an input parameter and searches a couple of CLOB datatype columns in my product table and returns the name and id of the corresponding product.
--- SEARCH FUNCTION ----
--- THE USER ENTERED KEYWORD IS SEARCHED IN THE PRODUCT DESCRIPTION COLUMN AND PRODUCT TAGS COLUMN
function search (search_string varchar) return datacursor as dataset datacursor;
begin
open dataset for
select prod_key,prod_name from dim_product
where contains (prod_keyword, concat(concat('%',search_string),'%')) >0 or contains (prod_desc, concat(concat('%',search_string),'%')) >0;
return dataset;
end search;
note :
type datacursor is ref cursor;
The code is working fine. Now I want to expand this function from one word search to many words that the user passes into the function to search the table. How can I achieve that?
Thanks!
Arun