67%(9)6 out of 9 people found this document helpful
This preview shows page 1 - 6 out of 17 pages.
Database Programming with PL/SQL 7-1: Handling ExceptionsPractice Activities Vocabulary Identify the vocabulary word for each definition below: Exception handler Code that defines the recovery actions to be performed when execution-time errors occur. Exception Occurs when an error is discovered during the execution of a program that disrupts the normal operation of the program. Try It / Solve It 1What happens when Oracle encounters a runtime problem while executing a PL/SQL block? 2What do you need to add to your PL/SQL block to address these problems? 3List three advantages of handling exceptions within a PL/SQL block. 4Run this PL/SQL code and then answer the questions that follow. DECLARE v_jobid employees.job_id%TYPE; BEGIN
What happens when you run the block? In your own words, explain what you can do to fix this problem. BModify the code to fix the problem. Use a TOO_MANY_ROWS exception handler. CRun your modified code. What happens this time? 5Run the following PL/SQL block, which tries to insert a new row (with department_id = 50) into the departments table. What happens and why?
BEGIN 6Enter the following PL/SQL block, which tries to SELECT all the employees in a specific department. Run it three times, using department_ids 10, 20, and 30. What happens and why?