Question: Create a procedure find_customer (customer_id IN NUMBER, found OUT NUMBER); This procedure has an input parameter to receive the customer ID and an output parameter
Create a procedure
find_customer (customer_id IN NUMBER, found OUT NUMBER);
This procedure has an input parameter to receive the customer ID and an output parameter named found.
This procedure looks for the given customer ID in the database. If the customer exists, it sets the variable found to 1. Otherwise, the found variable is set to 0.
To check if your query in the find_customer()procedure returns a row, you need to check the no_data_found exception in the EXCEPTION block.
EXCEPTION
WHEN no_data_found THEN
found := 0;
To check if your query in the find_customer()procedure returns multiple rows, you need to check the too_many_rows exception in the EXCEPTION block and display a proper message.
To catch any other errors, check the OTHERS exception in the EXCEPTION block and display a proper message.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
