Create a stored procedure named prc_new_rental to insert new rows in the RENTAL table. The procedure should

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 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.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: