Delimiter //
/**
 * Author:  armen
 * Created: 12 oct. 2016
 * temporraire
 * vu avec PO, interdir droit admin
 */

Drop Procedure If Exists LOADER_MEMBERS_NORMALIZE_MAP_ADMIN_RIGHTS//
Create Procedure LOADER_MEMBERS_NORMALIZE_MAP_ADMIN_RIGHTS(
    In batchnum Int
)
Begin

	Update LOADER_MEMBERS ltar
	Inner Join LOADER_STATUS lst
		On ltar.LOADER_STATUS_ID_LOADER_STATUS = lst.ID_LOADER_STATUS
	
	Set 
		ltar.MEMBERS_ADMIN_RIGHTS = 0 -- type connection denied
	Where
		lst.LOADER_STATUS_BATCH_NUM = batchnum
	;
	
End//
Delimiter ;