Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DELIMITER //
- DROP PROCEDURE IF EXISTS update_lp_description//
- create procedure update_lp_description()
- begin
- DECLARE l_name VARCHAR(200);
- DECLARE l_id BIGINT(20);
- DECLARE list_ids CURSOR FOR
- SELECT b.long_name, b.brand_id
- FROM brand as b
- WHERE b.has_lp =1;
- OPEN list_ids;
- lists_loop: LOOP
- FETCH list_ids INTO l_name, l_id;
- UPDATE brand set lp_description = Concat('Sign Up. Save Big is the premier loyalty program for ',l_name,', offering special discounts and savings to its most active and loyal customers. Sign Up. Save Big members are first to learn of upcoming sales and receive special discounts available only to program members.
- ') WHERE brand.brand_id = l_id;
- END LOOP lists_loop;
- end
- //
Add Comment
Please, Sign In to add comment