How to pass the value to a contains query using a parameter [message #343277] |
Tue, 26 August 2008 17:44 |
formsdev
Messages: 6 Registered: June 2005
|
Junior Member |
|
|
Hi,
I am using the fuzzy operator. Here is my query which gives me correct results.
select * from detinfo_fuzzy_tbl
where CONTAINS(firstname, 'fuzzy(Sam, 60, 1, weight)')>0;
This returns the rows
Sam John
Sam Wayne
Sam Ko
I would like to pass Sam as a parameter value instead of hardcoding sam. How do I do that ?
I put this in a procedure as follows.
PROCEDURE FindDetInfo(pFirstname in varchar2,pLastname in varchar2) IS
c number;
n number;
v_indexscript varchar2(500);
v_count number ;
v_test varchar2(64);
cursor c1 is select * from detinfo_fuzzy_tbl
where CONTAINS(firstname, 'fuzzy(pFirstname, 60, 1, weight)')>0;
BEGIN
For Rec in c1 Loop
dbms_output.put_line(rec.id);
Insert into tab
( ......... end;
My cursor doesnthave any rows.
Also I noticed that if I changed the firstname of one of the rows to pFirstname it takes it.
So basically how can we pass the value to the fuzzy operator instead of hard coding it?
thank you
|
|
|