Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

International Marketing And Export Management

Authors: Gerald Albaum , Alexander Josiassen , Edwin Duerr

8th Edition

1292016922, 978-1292016924

More Books

Students also viewed these Programming questions

Question

Given find the value of k. es 1 e kx dx = 1 4'

Answered: 1 week ago