Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1 . A new part - time programming employee has been reviewing some PL / SQL code you devel - oped. The following two blocks

1. A new part-time programming employee has been reviewing some PL/SQL code you devel-
oped. The following two blocks contain a variety of exception handlers. Explain the different
types for the new employee.
Block 1:
DECLARE
ex_prod_update EXCEPTION;
BEGIN
UPDATE bb_product
SET description = 'Mill grinder with 5 grind settings!'
WHERE idProduct =30;
IF SQL%NOTFOUND THEN
RAISE ex_prod_update;
END IF;
EXCEPTION
WHEN ex_prod_update THEN
DBMS_OUTPUT.PUT_LINE('Invalid product ID entered');
END;
Block 2:
DECLARE
TYPE type_basket IS RECORD
(basket bb_basket.idBasket%TYPE,
created bb_basket.dtcreated%TYPE,
qty bb_basket.quantity%TYPE,
sub bb_basket.subtotal%TYPE);
rec_basket type_basket;
lv_days_num NUMBER(3);
lv_shopper_num NUMBER(3) :=26;
BEGIN
SELECT idBasket, dtcreated, quantity, subtotal
INTO rec_basket
FROM bb_basket
WHERE idShopper = lv_shopper_num
AND orderplaced =0;
lv_days_num := SYSDATE - rec_basket.created;
EXCEPTION
WHEN NO_DATA_FOUND THEN
DBMS_OUTPUT.PUT_LINE('You have no saved baskets!');
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE('A problem has occurred.');
DBMS_OUTPUT.PUT_LINE('Tech Support will be notified and
will contact you via e-mail.');
END;

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Analytics And Quality Management Fundamental Tools

Authors: Joseph Nguyen

1st Edition

B0CNGG3Y2W, 979-8862833232

More Books

Students also viewed these Databases questions