Cursor 's WHERE Clause [message #41097] |
Fri, 22 November 2002 19:51 |
Suddha Satta Ray
Messages: 5 Registered: February 2002
|
Junior Member |
|
|
This does not work ........ (i.e, cursor fetches nothing)
PROCEDURE process_names(IP_STRING IN VARCHAR, OP_MESSAGE OUT VARCHAR)
IS
V_TEMP VARCHAR2(100) := IP_STRING;
CURSOR C IS SELECT EMPNAME , BASIC
FROM EMP
WHERE EMPNAME LIKE '%V_TEMP%';
..
How do I solve the above problem ?
I want to fetch the result set of a query like above in a cursor for furthur processing inside the procedure.But the cursor does not work ?
No error message is received.
Also, can I construct cursors with dictionary tables ?
|
|
|
Re: Cursor 's WHERE Clause [message #41099 is a reply to message #41097] |
Fri, 22 November 2002 23:19 |
Balamurugan.R
Messages: 91 Registered: March 2001
|
Member |
|
|
Hai,
In your cursor declaration, there is some error ,
instead of empname like '%V_temp%', u should write it
as '%'||v_temp||'%'. You will get the result.
You can use dictionary tables in cursor.
Hope this would help u.
With Regards,
Balamurugan.R
|
|
|
Re: Cursor 's WHERE Clause [message #41101 is a reply to message #41097] |
Sat, 23 November 2002 06:14 |
F. Tollenaar
Messages: 64 Registered: November 2002
|
Member |
|
|
Also possible:
procedure process_names( ip_string in varchar
, op_message out varchar)
is
v_temp varchar2(100) := ip_string;
cursor c (t_temp in varchar2)
is
select empname
, basic
from emp
where empname like '%'||t_temp||'%';
begin
for r in c(v_temp)
loop
blabla
end loop;
end;
|
|
|