what type of errors can we handle using system define unnamed exception in sqlplus?
- by Aspirant
I have been trying to access the below code
DECLARE
N_DEPTNO DEPT.DEPTNO %TYPE :=&DEPT_NUM;
V_DNAME DEPT.DNAME %TYPE;
NOT_ENOUGH_VALUES EXCEPTION;
PRAGMA
EXCEPTION_INIT(NOT_ENOUGH_VALUES,-06502);
BEGIN
SELECT DNAME,LOC INTO DNAME FROM DEPT
WHERE DEPTNO = N_DEPTNO;
DBMS_OUTPUT.PUT_LINE('Successfully Fetched !!');
EXCEPTION
WHEN NOT_ENOUGH_VALUES THEN
DBMS_OUTPUT.PUT_LINE('No Enough Values ... ');
END;
It is still showing error message after specified it in EXCEPTION block.
Can i handle these type of errors using PRAGMA EXCEPTION_INIT
i.e not providing enough values in the select statement...
If not what type of errors can be handled in System Defined Unnamed Exception
using PRAGMA EXCEPTION_INIT.