Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a named stored procedure that attempts to delete all the rows from order_details and orders tables when you pass it an order number.
Write a named stored procedure that attempts to delete all the rows from order_details and orders tables when you pass it an order number. If you enter an invalid order_number and no rows were deleted, the system does not consider that to be an error. To check if a row is indeed deleted, use SQL%ROWCOUNT to return number of rows deleted. If the value of SQL%ROWCOUNT is zero, output a message stating that "No order rows were deleted. May not be a valid order_number". Otherwise, if the value is greater than zero, output a message that says "Order has been fully deleted.". Then, perform a commit. Once your procedure compiles correctly, test it with the following calls. --First Call-- CALL delete_detail_ID (10000); Sample Output: Order 10000 has been fully deleted. --Second and Third Calls-- CALL delete_detail_ID (10000); BEGIN END: / delete_detail_ID (11111); Sample Outputs: No order rows were deleted. May not be a valid order number
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started