Chapter 7 homework.docx - www.oracle.com\/academy Database Programming with PL\/SQL 7-1 Handling Exceptions Practice Activities Vocabulary Identify the

Chapter 7 homework.docx - www.oracle.com/academy Database...

This preview shows page 1 - 6 out of 17 pages.

Database Programming with PL/SQL 7-1: Handling Exceptions Practice 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 1 What 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. 4 Run this PL/SQL code and then answer the questions that follow. DECLARE v_jobid employees.job_id%TYPE; BEGIN
Image of page 1
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?
Image of page 2
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?
Image of page 3
Image of page 4
Image of page 5
Image of page 6

You've reached the end of your free preview.

Want to read all 17 pages?

  • Spring '16
  • Mary Gable
  • Error code

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture