Cursor Problem [message #472600] |
Sun, 22 August 2010 23:53 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
samit_gandhi
Messages: 226 Registered: July 2005 Location: Hong Kong
|
Senior Member |
![samit_gandhi](/forum/theme/orafaq/images/yahoo.png)
|
|
Hi
I want to fetch the data through the cursor and cursor is getting the value of group_code through the variable 'a'. but when i am writing the code like this it is not coming.
Please suggest
My code is like this :
declare
a varchar2(400):='';
cursor c1 is select ref_no,ref_code,company_id from stock_detail where company_id=:global.company_id
and group_code in (a);
begin
go_block('group_master');
first_record;
loop
if :group_master.select = 0 then
if a is null then
a:=:group_master.category_code;
else
a:=a||','||:group_master.category_code;
end if;
end if;
exit when :system.last_record='TRUE';
next_record;
end loop;
if a ='' then
null;
else
a:=a;
go_item('group_master.A');
end if;
go_block('stock_fare_detail');
open c1;
loop
fetch c1 into :stock_fare_detail.ref_no,:stock_fare_detail.ref_code,:stock_fare_detail.company_id;
exit when c1%notfound;
next_record;
end loop;
close c1;
end;
|
|
|
|
|