Question: I want to do a TEST procedure called VGR_TestUpdatedPnone for this procedure (triggers sql) UpdatedPnone VRG_ procedure DELIMITER $$ DROP PROCEDURE IF EXISTS VRG_UpdatePhone$$ CREATE

I want to do a TEST procedure called VGR_TestUpdatedPnone for this procedure (triggers sql)

UpdatedPnone

VRG_ procedure

DELIMITER $$

DROP PROCEDURE IF EXISTS VRG_UpdatePhone$$

CREATE PROCEDURE VRG_UpdatePhone( IN nCustName CHAR(25), IN priorAreaCode CHAR(3), IN priorPhoneNumber CHAR(8), IN newAreaCode CHAR(3), IN newPhoneNumber CHAR(8), OUT error_msg CHAR(80) )

BEGIN

DECLARE rowCount INT DEFAULT 0; DECLARE readCustomerID INT; DECLARE done INT DEFAULT 0; DECLARE Custcount, CIndex INT DEFAULT 0; DECLARE CustUpdate_Cursor CURSOR FOR SELECT CustomerID FROM VRG_CUSTOMER C WHERE C.CustName = nCustName AND C.areaCode = priorAreaCode AND C.phoneNumber = priorPhoneNumber; DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1;

SELECT COUNT(*) INTO rowCount FROM VRG_CUSTOMER C WHERE C.CustName = nCustName AND C.areaCode = priorAreaCode AND C.phoneNumber = priorPhoneNumber;

IF rowCount = 0 THEN SET error_msg = 'Customer Does Not Exist In Database -- No Action Taken'; ELSE OPEN CustUpdate_Cursor;

SET Custcount = (SELECT FOUND_ROWS()); WHILE Cindex

CLOSE CustUpdate_Cursor; END IF; END$$

DELIMITER ;

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 Databases Questions!