5. Execute the following code, which creates the customer_update_account stored procedure in your
tshirtshop database:
-- Create customer_update_account stored procedure
CREATE PROCEDURE customer_update_account(IN inCustomerId INT,
IN inName VARCHAR(50), IN inEmail VARCHAR(100),
IN inPassword VARCHAR(50), IN inDayPhone VARCHAR(100),
IN inEvePhone VARCHAR(100), IN inMobPhone VARCHAR(100))
BEGIN
UPDATE customer
SET name = inName, email = inEmail,
password = inPassword, day_phone = inDayPhone,
eve_phone = inEvePhone, mob_phone = inMobPhone
WHERE customer_id = inCustomerId;
END$$
The customer_update_account stored procedure updates the customer??™s account details in the database.
CHAPTER 16 ?– MANAGING CUSTOMER DETAILS 503
6. Execute this code, which creates the customer_update_credit_card stored procedure in your
tshirtshop database:
-- Create customer_update_credit_card stored procedure
CREATE PROCEDURE customer_update_credit_card(
IN inCustomerId INT, IN inCreditCard TEXT)
BEGIN
UPDATE customer
SET credit_card = inCreditCard
WHERE customer_id = inCustomerId;
END$$
The customer_update_credit_card stored procedure updates the customer??™s credit card information in
the database. It updates only the credit_card column for the customer, which contains the encrypted version
of the XML document containing the customer??™s complete credit card details.
Pages:
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625