Home » Server Options » Text & interMedia » How to pass the value to a contains query using a parameter (10g)
How to pass the value to a contains query using a parameter [message #343277] Tue, 26 August 2008 17:44 Go to previous message
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


 
Read Message
Read Message
Read Message
Previous Topic: Multi Language in Oracle Text
Next Topic: Oracle Text added column name to tokens
Goto Forum:
  


Current Time: Thu Apr 25 07:17:13 CDT 2024