-
I would like to know how do i proceed if i would get the NO_DATA_FOUND exception in Stored Procedure.
In my case i need to do some select, insert's if i got this
exception.
Thanks
-
hi,
Step 1:
DECLARE
lv_get_sal NUMBER;
BEGIN
EXCEPTION
WHEN NO_DATA_FOUND THEN
END;
in case 2 the foucus will goto the exception inside the block
Step 2:
DECLARE
lv_get_sal NUMBER;
BEGIN
BEGIN
SELECT COUNT(*) INTO lv_get_sal FROM emp
WHERE......;
EXCEPTION
WHEN NO_DATA_FOUND THEN
CONDITION......;
END;
END;
Cheers!
OraKid.
-
Beware, the given fragment have an error :
BEGIN
SELECT COUNT(*) INTO lv_get_sal FROM emp
WHERE......;
EXCEPTION
WHEN NO_DATA_FOUND THEN
CONDITION......;
END;
===>> the COUNT function NEVER fires a WHEN NO_DATA_FOUND, it only give you ZERO as result if any data was found, either in SQL or PL/SQL :
SQL> select count(*) from dual where 1=2;
COUNT(*)
---------
0
Regards,
Chiappa
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|