Question: PROJECT # 3 : CREATE THE FOLLOWING STORED PROCEDURE THAT WILL DISPLAY A CUSTOMER. First, we declare variables to store customer ID , customer
PROJECT #: CREATE THE FOLLOWING STORED PROCEDURE
THAT WILL DISPLAY A CUSTOMER.
First, we declare variables to store customer ID customer name, and email. Then, we retrieve customer information using a SELECT statement into the respective variables. The SELECT statement has a WHERE clause to filter based on a specific customer ID You can replace with the desired customer ID
Next, we display the retrieved customer information using DBMSOUTPUT.PUTLINE statements.
After that, we update the email address for the customer using an UPDATE statement. You can modify vemail with the new email address you want to set.
Then, we retrieve the updated customer information again and display it using DBMSOUTPUT.PUTLINE statements.
CREATE OR REPLACE PROCEDURE GetCustomerInfo
IS
Declare variables to store customer details
vCustomerID Customers.CustomerIDTYPE;
vCustomerName Customers.CustomerNameTYPE;
vEmail Customers.EmailTYPE;
BEGIN
Retrieve customer information
SELECT
CustomerID,
CustomerName,
Email
INTO
vCustomerID,
vCustomerName,
vEmail
FROM
Customers
WHERE
CustomerID ; Specify the desired customer ID
Display customer information
DBMSOUTPUT.PUTLINECustomer ID: vCustomerID;
DBMSOUTPUT.PUTLINECustomer Name: vCustomerName;
DBMSOUTPUT.PUTLINEEmail: vEmail;
END;
THEN EXECUTE THE STORED PROCEDURE
BEGIN
GetcustomerInfo;
END;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
