Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Can I have some assistance with this problem? Create a PL/SQL block that contains PL/SQL- Exceptions as show in the examples. The Exceptions blocks should
Can I have some assistance with this problem?
Create a PL/SQL block that contains "PL/SQL- Exceptions" as show in the examples. The Exceptions blocks should be able to handle the following SQL statements: Insert into Project Values (Data Mining', '99', 'Southaven','55'); Insert into department values ('MIS','1','888665555',to_date(06/19/2000', 'mm/dd/yyyy')); Update Works on Set PNO=23 Where ESSN = 123456789; Update Project Set Dnum - 7 Where Pnumber - 30; Delete From project Where Pnumber = 10; Delete From Department Where Dnumber = 5; Note, to run each exception, comment on the ones that you are not testing. Example: SET SERVEROUTPUT ON; DECLARE ex_employee_fk EXCEPTION; PRAGMA EXCEPTION_INIT(ex_employee_fk, -2291); ex_department_pk EXCEPTION; PRAGMA EXCEPTION_INIT (ex_department_pk, -2292); ex_project_values EXCEPTION; BEGIN UPDATE Employee SET Dno - 7 WHERE Ssn - 123456789; --DELETE FROM Department WHERE Dnumber = 5; -- INSERT INTO Project VALUES ('Computer Software', '1', 'Tupelo', '17'); -- INSERT INTO Employee VALUES ('Laura', 'B', 'Jackson', '123456789', to date('01/09/1955, 'mm/dd/yyyy'), '731 Lamar, Oxford, MS', 'M', 30000.00, 333445555', '9'); EXCEPTION WHEN ex_employee_fk THEN DBMS_OUTPUT.PUT_LINE(Foreign key value entered has no corresponding primary key value."); WHEN ex department_pk THEN
Step by Step Solution
★★★★★
3.38 Rating (148 Votes )
There are 3 Steps involved in it
Step: 1
The images you provided show an example of a PLSQL block that uses exception handling in Oracle Database The code illustrated in the example declares several exceptions associates them with error numb...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started