multiple parameter in declaration section [message #85960] |
Tue, 17 August 2004 07:14 |
fanni
Messages: 96 Registered: March 2004
|
Member |
|
|
hello
BACKGROUND
decalre
cursor c1 is
select * from emp
where hiredate = := :blockname.date;
begin
PROBLEM STATEMENT
I have to open write a cusor definition on the basis of the more than one dates selected via check box.
but when i write the above mentioned definition it compares only with the date selectd in last.
How can i do it
|
|
|
Re: multiple parameter in declaration section [message #85965 is a reply to message #85960] |
Tue, 17 August 2004 23:00 |
Himanshu
Messages: 457 Registered: December 2001
|
Senior Member |
|
|
Hi,
Whatever your query is doing , is correct as it will comapre the date with the date in which your Cursor currently is.
What over here you require is to Prepare a list of dates as follows and then use it in your cursor:
Declare
L_string varchar2(20000):=null;
cursor c1(l_string varchar2) is
select * from emp
where hiredate in (L_string);
Begin
Begin
Go_block('blockname');
first_record;
loop
If check_box='Checked' then
L_string:=L_string||''''||:blockname.date||'''';
end if;
if :system.last_record='TRUE' then
exit;
else
next_record;
end if;
end loop;
exception
When others then
message("error while preparing select string');
end;
For i in c1(L_string) loop
--------
exception
----
end;
HTH
Regards
Himanshu
|
|
|