|
|
|
|
|
|
Re: alternate to like operator [message #579809 is a reply to message #579808] |
Fri, 15 March 2013 09:45   |
 |
sss111ind
Messages: 636 Registered: April 2012 Location: India
|
Senior Member |

|
|
Thanks All..I changed to code like but still it's using like operator decreasing the performance.
PROCEDURE get_emp_list(
p_ename IN VARCHAR2,
rec_emp_list OUT sys_refcursor)
IS
l_main_str VARCHAR2(2000):='SELECT * FROM EMP';
l_str VARCHAR2(200);
l_ename varchar2(20);
BEGIN
IF p_ename IS NOT NULL THEN
l_ename :=REPLACE(p_ename,'*','%');
l_str :=' where upper(ename) like upper('''||l_ename||''')';
l_main_str :=l_main_str||l_str;
END IF;
OPEN rec_emp_list FOR l_main_str;
dbms_output.put_line(l_main_str);
END get_emp_list;
Regards,
Nathan
[Updated on: Fri, 15 March 2013 09:46] Report message to a moderator
|
|
|
Re: alternate to like operator [message #579810 is a reply to message #579809] |
Fri, 15 March 2013 10:15   |
_jum
Messages: 577 Registered: February 2008
|
Senior Member |
|
|
What has this procedure to do with your question?
Quote:select * from emp where ename like upper(NVL('%mi%',ename));
BTW the whole design is decreasing the performance, not the LIKE operator.
Why do you use a PROCEDURE with a SYS_REFCURSOR as argument to do thinks, that can be done with pure SQL.
I can't see any reason in your post.
|
|
|
|
Re: alternate to like operator [message #579814 is a reply to message #579810] |
Fri, 15 March 2013 11:31   |
 |
sss111ind
Messages: 636 Registered: April 2012 Location: India
|
Senior Member |

|
|
Actually _jum,The procedure is going to be called by java application.And what the cursor will return based on they will be showing there.They are not allowing direct select statement there.And it's not related with the question from what I started.I thought of using that but I changed the requirement.
And Michel,I never used Text.Why it is separate from oracle.What is the conditions to fullfill to use it.
Regards,
Nathan
[Updated on: Fri, 15 March 2013 11:35] Report message to a moderator
|
|
|
|
|