Can I have some assistance with this problem? Create a PL/SQL block that contains PL/SQL- Exceptions as
Fantastic news! We've Found the answer you've been seeking!
Question:
Can I have some assistance with this problem?
Transcribed Image Text:
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 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
Expert Answer:
Answer rating: 100% (QA)
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... View the full answer
Related Book For
Fundamentals Of Database Systems
ISBN: 9780133970777
7th Edition
Authors: Ramez Elmasri, Shamkant Navathe
Posted Date:
Students also viewed these databases questions
-
define the following concepts Redundancy-Based Backup and Recovery using RAID Database Backups Application Backups
-
Case Study: Quick Fix Dental Practice Technology requirements Application must be built using Visual Studio 2019 or Visual Studio 2017, professional or enterprise. The community edition is not...
-
Write a project management plan. we have a template and project description. we need to edit the template(table of contents) with our own ideas. CPSC 8820-01 Project Management Plan Your Unique...
-
If M is the midpoint of XY, find the coordinates of Y when X and M have the following coordinates: X(-4,2), M(0,3) Please write formulas too
-
The space between two concentric metallic spheres is filled up with a uniform poorly conducting medium of resistivity p and permittivity e. At the moment t = 0 the inside sphere obtains a certain...
-
Why is the Geographic Adjustment Factor important when using conversion factors that convert RVUs into payments?
-
A large MNE in the cookware industry was having difficulties maintaining its market share due to a number of mergers among other competing firms in the industry. The MNE, with corporate headquarters...
-
The following letter was sent to the SEC and the FASB by leaders of the business community. Dear Sirs: The FASB has been struggling with accounting for derivatives and hedging for many years. The...
-
Image transcription text Engineering Feats and Disasters Presentation . 5 Minute Presentation (with Powerpoint and/or other visuals) . Capture the key information . What happened? . Why did happen? ....
-
The Genola Company manufactures insulated windows. Costs for March were as follows. Direct labor $53,000 Indirect labor 18,000 Salary of corporate vice president for advertising Direct materials...
-
You play a Retailer in the Beer Game. You receive orders directly from the Customer and place orders with the Wholesaler. When you place an order, it takes 2 weeks for the order to be received by the...
-
The three major inputs into the manufacturing process are direct materials, direct labour and factory overheads. If the costs of any of these are not controlled, they may inflate the cost of...
-
Table 9.13 shows the percent neonatal mortality rate in the United States in 1980, for babies grouped by birth weight (grams). a. Estimate a linear regression model. b. Which variable is your...
-
The 10 critical success factors have been applied in a variety of settings and project types. Consider a project with which you have been involved. Did any of these factors emerge clearly as being...
-
Which market structure best describes (a) mobile network operators in a country, (b) plumbers in a small town, (c) farms that grow mangoes, and (d) city waste management? Why?
-
As the aggregate profit of a cartel can exceed the combined profits of the same firms acting independently, firms have an incentive to form cartels and behave like a monopoly. However, cartels often...
-
Consider the following. Function f(x) 12 (x, y) = Line x+y=0 Find the slope of the given line. slope = Determine the slope of any line parallel to the given line. slope = Find f'(x). f'(x) = Find the...
-
The graph of an equation is given. (a) Find the intercepts. (b) Indicate whether the graph is symmetric with respect to the x-axis, the y-axis, or the origin. -3 6 -6 3 x
-
Give a general definition of information retrieval (IR). What does information retrieval involve when we consider information on the Web?
-
What are digital signatures? How do they work?
-
Discuss briefly the support offered by Oracle for homogeneous, heterogeneous, and client/server-based distributed database architectures.
-
Natasha Kingery is 30 years old and has a Bachelor of Science degree in computer science. She is currently employed as a Tier 2 field service representative for a telephony corporation located in...
-
This is your second interview with a prestigious brokerage firm for a job as an equity analyst. You survived the morning interviews with the department manager and the vice president of equity....
-
The following data from Lyre Ltd's accounts relates to two assets at 30 June 2023. At 30 June 2023 Lyre Ltd decides to adopt the revaluation model for both these assets. On this date land has a fair...
Study smarter with the SolutionInn App