PLSQL: EXCEPTION HANDLING: BASICS, EXCEPTION VARIABLES, RAISE_APPLICATION_ERROR, USER DEFINED EXCEPTION, RE-RAISE EXCEPTION
27 programming challenges to help you master the fundamentals of DATABASE MANAGEMENT SYSTEM USING ORACLE.
Write a PL/SQL block to handle NO_DATA_FOUND exception while fetching employee details.
(Exception Basics)
Write a PL/SQL block to display error code and message using SQLCODE and SQLERRM.
(Exception Variables)
Write a PL/SQL block to capture and display error details when division by zero occurs.
(SQLCODE, SQLERRM)
Write a PL/SQL block to log exception message into a variable and display it.
(Exception Variables)
Write a PL/SQL block to raise an error if salary is less than 2000 using RAISE_APPLICATION_ERROR.
(RAISE_APPLICATION_ERROR)
Write a PL/SQL block to validate employee age and raise custom error if age < 18.
(RAISE_APPLICATION_ERROR)
Write a PL/SQL block to restrict update operation using RAISE_APPLICATION_ERROR.
(Business Rule Validation)
Write a PL/SQL block to raise an error when invalid department number is entered.
(Validation Logic)
Write a PL/SQL block to declare and handle a user-defined exception.
(User Defined Exception)
Write a PL/SQL block to raise a custom exception when salary exceeds limit.
(User Defined Exception)
Write a PL/SQL block to validate input and raise user-defined exception for invalid data.
(Custom Validation)
Write a PL/SQL block to catch an exception and re-raise it using RAISE.
(Re-raise Exception)
Write a PL/SQL block where exception is handled in inner block and re-raised to outer block.
(Nested Blocks + Re-raise)
Write a PL/SQL block to fetch employee details and handle all possible exceptions.
(Combined Exception Handling)
Write a PL/SQL block using user-defined exception and RAISE_APPLICATION_ERROR together.
(Combined Concepts)
Write a PL/SQL block to validate salary and raise appropriate exception.
(Validation + Exception)
Write a PL/SQL block to perform division and handle exception using SQLCODE & SQLERRM.
(Combined Concepts)
Write a PL/SQL block to validate employee data and raise different exceptions for different errors.
(Multiple Exception Handling)
Write a PL/SQL block to log errors into a table using exception handling.
(Logging Errors)
Write a PL/SQL block to implement nested exception blocks with re-raise mechanism.
(Advanced Exception Handling)