QUESTION

Text
Image

pl/sql queries

oracle
Exercise 11 write a PL/SQL block that declares an exception for the Oracle Server error ORA-02292(integrity constraint violated - child record found). The block tests for the exception and outputs the error message. In the executable section, display "You are not allowed to delete department number 60. " Include a DELETE statement to delete the department with department_id 60.

Exercise 12: Write an exception for the following code, that will display a message "Employee is not exist" if the user entered an employee id that is not exist. DECLARE I_name employees.LAST_NAME\%TYPE; emp_id employees.employee_id $\$ T Y P E=$ \&employee_id; BEGIN - get the employee name by id SELECT last_name INTO __name FROM employees WHERE employee_id $=\mathrm{emp} i d$; - show the employee name dbms_output.put_line('Employee name is ' / I Lname); END; Exercise 13 Give 4 oracle pre-defined errors

Public Answer

DNDSGA The First Answerer