Create a procedure find_customer (customer_id IN NUMBER, found OUT NUMBER); This procedure has an input parameter to
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 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.
Using Microsoft Excel and Access 2016 for Accounting
ISBN: 978-1337109048
5th edition
Authors: Glenn Owen