Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Rowcount in a cursor

19dd13e5-4c31-4e2b-ae8f-a2ff019b90d0Aug 14 2014 — edited Aug 14 2014

Have a cursor. I needed to count the rows returned. I needed to check the condition of 0 rows. But even when there are rows being returned the rowcount zero condition is being met. Please see below..

FOR r_emp  IN emp_cursor LOOP

     ........

END LOOP;

   

   OPEN emp_cursor ;

    IF (emp_cursor %ROWCOUNT = 0) THEN -- no rows found

    END IF;

    CLOSE emp_cursor ;

Appreciate any insights and ideas...

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 11 2014
Added on Aug 14 2014
5 comments
1,422 views