Delimiter //
/**
 * Author:  armen
 * Created: 12 oct. 2016
 */
Drop Procedure if exists LOADER_MEMBERS_UPDATE//

Create Procedure LOADER_MEMBERS_UPDATE (
    In batchnum int
)
Begin
-- pour le moment rien a MAJ voi avec PO si besoin maj
--         update 
--             MEMBERS trgt 
--             Inner Join LOADER_MEMBERS src 
--                 On trgt.ID_MEMBERS = src.ID_MEMBERS
--             Inner Join LOADER_STATUS lst 
--                 On src.LOADER_STATUS_ID_LOADER_STATUS = lst.ID_LOADER_STATUS 
-- 
--         Set  
--             trgt.XXXX = Coalesce(src.XXXX, rgt.XXXX)
-- 
--         Where 1 = 1 
--             And lst.LOADER_STATUS_ERRCOUNT = 0 
--             And lst.LOADER_STATUS_BATCH_NUM =  batchnum
--         ;
End //

Delimiter ;