cursor in the form [message #363370] |
Sat, 06 December 2008 05:10  |
laith
Messages: 41 Registered: December 2008 Location: U.A.E
|
Member |
|
|
i have form using 2 non database block and i want just to use the cursor to show data, and this is the cursor that i use:
PROCEDURE SHOW_ROWS IS
BEGIN
DECLARE
CURSOR PTI_CURSOR IS
SELECT PYPRCSD_ZONE_CODE , pubmast_type , COUNT(*)
from PYPRCSD, pubmast x
where PYPRCSD_ACADEMIC_YEAR = :acy_year
and PYPRCSD_ACTIVE_IND = 'Y'
AND PYPRCSD_sticker_no IS NOT NULL
and pubmast_pidm = pyprcsd_pidm
and pubmast_seq_no = pyprcsd_bene_seq_no
and nvl(pubmast_sys_update_date,'01-jan-1900') = (select max(nvl(pubmast_sys_update_date,'01-jan-1900'))
from pubmast
where pubmast_pidm = x.pubmast_pidm
and pubmast_seq_no = x.pubmast_seq_no)
and PYPRCSD_ZONE_CODE != 'EXPIRED'
and trunc(PYPRCSD_RENEWAL_DATE) >= (:renewal_date)
group by PYPRCSD_ZONE_CODE,pubmast_type
order by PYPRCSD_ZONE_CODE,pubmast_type;
BEGIN
OPEN PTI_CURSOR ;
loop
FETCH PTI_CURSOR INTO :PYPRCSD_ZONE_CODE , :ZONE_TYPE, :ZONE_COUNT;
next_record;
exit when PTI_CURSOR%notfound;
end loop;
close PTI_CURSOR;
END;
END;
the problem is the pointer going to the last row (after last record ) and give me error message :
FRM-40102: Record must be entered or deleted first , so please can you tell me how can i solve this problem. thank you
[EDITED by LF: applied [code] tags]
[Updated on: Sat, 06 December 2008 10:22] by Moderator Report message to a moderator
|
|
|
|
|