Question: Create a stored procedure named prc_new_rental to insert new rows in the RENTAL table. The procedure should satisfy the following conditions. a. The membership number
a. The membership number will be provided as a parameter.
b. Use a Count() function to verify that the membership number exists in the MEMBERSHIP table. If it does not exist, then a message should be displayed stating that the membership does not exist and no data should be written to the database.
c. If the membership does exist, then retrieve the membership balance and display a message stating the balance amount as the previous balance. (For example, if the membership has a balance of $5.00, then display “Previous balance: $5.00”.)
d. Insert a new row in the rental table using the sequence created in #42 above to generate the value for RENT_NUM, the current system date for the value for RENT_DATE, and the membership number provided as the value for MEM_NUM.
Step by Step Solution
3.44 Rating (160 Votes )
There are 3 Steps involved in it
CREATE OR REPLACE PROCEDURE PRCNEWRENTAL MEMNUMTEMP IN ME... View full answer
Get step-by-step solutions from verified subject matter experts
Document Format (1 attachment)
358-CS-DB (740).docx
120 KBs Word File
