Delimiter //
/**
    In batchnum Int : num du lot, si 0 ou null traitement de l'ensembles des lignes
*/

Drop Procedure if exists LOADER_BALANCECONTROL_COPY//

Create Procedure LOADER_BALANCECONTROL_COPY (
    In batchnum int
)
Begin
	if batchnum = 0 Then
        set @lbcc_entitie = GET_LOADER_INFO('ID_ENTITIES', 1);
		call BUSINESS_FI_ANA_INSERT_NEW_ACCOUNTS(null, @lbcc_entitie);
		call BUSINESS_UPDATE_FIANA(null, @lbcc_entitie);
	End if;
End //

Delimiter ;