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!

how to trap the exception in cursors

cubeguySep 27 2010 — edited Sep 27 2010
Hi

How to trap the exception NO DATA FOUND/other exceptions with the cursor
DECLARE
CURSOR c1 IS SELECT * FROM EMP WHERE empno = 1234;
BEGIN
FOR i IN c1 LOOP
DBMS_OUTPUT.PUT_LINE(i.ename);
END LOOP;
END;
so 1234 is not in my table, how to trap this.could some one help me please

Edited by: user4587979 on Sep 27, 2010 3:46 AM
This post has been answered by Karthick2003 on Sep 27 2010
Jump to Answer

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Oct 25 2010
Added on Sep 27 2010
7 comments
2,188 views