Question: PROJECT # 3 : CREATE THE FOLLOWING STORED PROCEDURE THAT WILL DISPLAY A CUSTOMER. First, we declare variables to store customer ID , customer

PROJECT \#3: 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 123 with the desired customer ID.
Next, we display the retrieved customer information using DBMS_OUTPUT.PUT_LINE 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 DBMS_OUTPUT.PUT_LINE statements.
```
CREATE OR REPLACE PROCEDURE GetCustomerInfo
IS
-- Declare variables to store customer details
v_CustomerID Customers.CustomerID%TYPE;
v_CustomerName Customers.CustomerName%TYPE;
v_Email Customers.Email%TYPE;
BEGIN
-- Retrieve customer information
SELECT
CustomerID,
CustomerName,
Email
INTO
v_CustomerID,
v_CustomerName,
v_Email
FROM
Customers
WHERE
CustomerID =1; -- Specify the desired customer ID
-- Display customer information
DBMS_OUTPUT.PUT_LINE('Customer ID: "|| v_CustomerID);
DBMS_OUTPUT.PUT_LINE('Customer Name: '|| v_CustomerName);
DBMS_OUTPUT.PUT_LINE('Email: '|| v_Email);
END;
/
```
THEN EXECUTE THE STORED PROCEDURE
BEGIN
GetcustomerInfo;
END;
/
PROJECT \ # 3 : CREATE THE FOLLOWING STORED

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!