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!

When No_Data_Found Exception

SamFisherApr 27 2012 — edited Apr 28 2012
Hello All,
I have a scenario where I'm using sum() function.

This works fine
DECLARE
   v_sal emp.sal%type;
BEGIN
   SELECT sal INTO v_sal FROM emp WHERE empno = 50;
EXCEPTION
WHEN NO_DATA_FOUND THEN
...
END;
But I can't use NO_DATA_FOUND in the case that I've mentioned below. Is there a way that I can catch here.
SELECT sum(sal) INTO v_sal FROM emp WHERE empno = 50;

Thx
Shank.
This post has been answered by Frank Kulash on Apr 27 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 26 2012
Added on Apr 27 2012
9 comments
8,421 views