There are several commands that will automatically do things for you in regards with the cursor. One of them is EXIT WHEN..
Another one is the EXCEPTION clause.
BEGIN
FOR arrecr02_rec in arrecr02_cursor LOOP
EXIT WHEN arrecr02_cursor%NOTFOUND;
select contract_s.nextval, recurrent_s.nextval into
lv_contract, lv_recurrent from dual;
BEGIN
select class_code into lv_salesmn from classes
where class_code = arrecr02_rec.salesmn;
EXCEPTION
WHEN NO_DATA_FOUND THEN
lv_salesmn := 'NONE';
END;
Main Topics
Browse All Topics





by: johnsonePosted on 2007-07-10 at 13:36:47ID: 19457502
No, you cannot get the count before fetching records. Why do you need the count before fetching? If you need a count, you can count the records as you fetch them, which will prevent running the query twice.