Dynamic where clause for static cursor [message #609941] |
Fri, 14 March 2014 06:19 |
![](//www.gravatar.com/avatar/8d5b41080283f5b209c8007e20b500b5?s=64&d=mm&r=g) |
shyam vyas
Messages: 1 Registered: March 2014 Location: India
|
Junior Member |
|
|
I have a requirement in which the system should pass a complete where clause at run time to a cursor created in the form.
Pasted below is the sample code. Please suggest.
begin
:text:=' DECODE(''13760'',h.M001,DECODE(''2'',h.LB001,1,0),0)';
for i in (select m001,lb001 from conf_head h where :text='1') loop
message(i.m001) ;
message(i.m001) ;
end loop ;
exception when others then
message(sqlerrm) ;message(sqlerrm) ;
end ;
|
|
|