Question: Fix the store procedure so that it is able to display that execution result similar to the photo Create or Replace PROCEDURE Insurance_Grouping IS v_Customer_type

Fix the store procedure so that it is able to display that execution result similar to the photo

CUSTOMER_TYPE Retail Corporate Retail Retail Corporate Retail INSURANCE_OPTION_DESC Additional Driver Bodily Injury

Create or Replace PROCEDURE Insurance_Grouping IS

v_Customer_type VARCHAR2 (10);
v_Insurance_option_desc VARCHAR2(25) ;
v_Insurance_Option_ID Number(1);

CURSOR Insurance_group IS

SELECT
Customer.Customer_type,
Insurance_Option.Insurance_option_desc,
Count (Insurance_option.Insurance_option_ID) as "Numer of Rentals"
FROM Customer
JOIN Rental
ON Customer. Customer_id = Rental.Rental_Customer_ID
JOIN Insurance_Option
ON Insurance_option.Insurance_option_ID = Rental.Insurance_option_ID
where Customer.Customer_type = customer_type group by Customer.Customer_type, Insurance_Option.Insurance_option_desc;

BEGIN

OPEN Insurance_group;
LOOP
FETCH Insurance_group INTO v_Customer_type, v_Insurance_option_desc, v_Insurance_Option_ID;
EXIT WHEN Insurance_group%NOTFOUND;
DBMS_OUTPUT.PUT_LINE('Insurance group info ' ||v_Customer_type|| ' | ' ||v_Insurance_option_desc|| ' | ' ||v_Insurance_Option_ID);
END LOOP;
CLOSE Insurance_group;
END Insurance_Grouping;
 

CUSTOMER_TYPE Retail Corporate Retail Retail Corporate Retail INSURANCE_OPTION_DESC Additional Driver Bodily Injury No Insurance Bodily Injury No Insurance Physical Damage Numer of Rentals 1 2 1 2 2 2

Step by Step Solution

3.43 Rating (162 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To display the execution result of the stored procedure you can use th... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!