Documente Academic
Documente Profesional
Documente Cultură
You have to submit the commented PL/SQL source code for your function . Make sure that your PL/SQL programs include appropriate error handling routines. You also have to submit the result sets computed by the function as detailed in questions above. Problem 2: PL/SQL Procedure (15 Points) You now have to write a PL/SQL procedure named shiptablell that takes as input, a parameter stating the type of items you are to consider (open - O, closed - C, both - B) and utilizes the function shipfunct programmed in problem 1. The procedure populates the SHIPPING table for items of type given as input (closed (C), open (O) or both (B)) assuming that every item with item number divisible by 5 uses ups shipping type (U) and all the other items are shipped by post oce shipping type (P). e.g. items with INO = 100, 105 were shipped using ups shipping type and INO = 1, 106 were shipped using post oce shipping type. First your procedure has to verify the validity of the input (C, O or B) and has to output a respective message in case the parameter is not valid. Then the procedure nds appropriate items for which tuples in the SHIPPING table have to be output (dbms output package). For each valid item based on the input, shipping type is determined by the procedure and corresponding ship price is calculated. Item number, ship type and ship price are recorded in the SHIPPING table. Note that open items have closetime greater than sysdate and closed items have closetime less than or equal to sysdate. You have to submit the commented PL/SQL source code for your procedure. Make sure that your PL/SQL program includes appropriate error handling routines. Problem 3: PL/SQL procedure and SQL queries (15 Points)
a. Use shiptablell(C) to create the shipping table with information about closed items. b. Report number of tuples created, total number of items using each ship type (ups, post oce) and total cost of shipping of all items of each ship type. c. Use shiptablell(O) to create the shipping table with information about open items. d. Report number of tuples created, total number of items using each ship type (ups, post oce) and total cost of shipping of all items of each ship type. e. Delete all tuples from SHIPPING table. Use shiptablell(B) to create the shipping table with information about all items. f. Report number of tuples created, total number of items using each ship type (ups, post oce) and total cost of shipping of all items of each ship type.