delimiter $$
Drop procedure if exists `havais` $$
create procedure `havais`(SEAS varchar(20))
BEGIN
UPDATE havais
SET B_DESCRIPTION=replace(B_DESCRIPTION,E_SIZE,'');
UPDATE havais
SET A_STYLECODE =replace(A_STYLECODE,E_SIZE,'');
UPDATE havais
SET C_SHORT_COLOUR = left(D_FULL_COLOUR,5);
UPDATE havais
SET E_SIZE = left(E_SIZE,3);
UPDATE havais
SET M_SUBDEPARTMENT = L_DEPARTMENT;
UPDATE havais
SET P_SEASON = 'H08' ;
UPDATE havais
SET S_VALID_MONTHS = "YYYYYYYYYYYY";
UPDATE havais
SET AD_RESERVED_B = '';
SET @selhav = concat("
select * from havais order by N_PRODUCT ") ;
prepare hav from @selhav;
execute hav;
deallocate prepare hav ;
END $$
DELIMITER $$
call `havais`('H09');
|