Guest User

Untitled

a guest
Dec 11th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. DELIMITER //
  2.  
  3. DROP PROCEDURE IF EXISTS update_lp_description//
  4.  
  5. create procedure update_lp_description()
  6. begin
  7. DECLARE l_name VARCHAR(200);
  8. DECLARE l_id BIGINT(20);
  9.  
  10. DECLARE list_ids CURSOR FOR
  11. SELECT b.long_name, b.brand_id
  12. FROM brand as b
  13. WHERE b.has_lp =1;
  14. OPEN list_ids;
  15. lists_loop: LOOP
  16. FETCH list_ids INTO l_name, l_id;
  17. 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.
  18. ') WHERE brand.brand_id = l_id;
  19.  
  20. END LOOP lists_loop;
  21. end
  22. //
Add Comment
Please, Sign In to add comment