Explain user defined exceptions in oracle.
User defined exception in oracle are defined by the user. They need to be explicitly raised by the user using the RAISE statement. Oracle is not aware of these exceptions unless declared.
Example:DECLARE
Trans EXCEPTION;
BEGIN
IF TO_CHAR(SYSDATE, ‘DY’)= ‘SUN’ THEN
RAISE Trans;
END IF
EXCEPTION
WHEN trans THEN
DBMS_OUTPUT.PUT_LINE(‘No transactions today’);
END;