Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Using Microsoft Excel and Access 2016 for Accounting

Authors: Glenn Owen

5th edition

1337109048, 1337109045, 1337342149, 9781337342148 , 978-1337109048

More Books

Students also viewed these Databases questions

Question

What are the three key comparison operators used in a query?

Answered: 1 week ago