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

Drop Procedure if exists LOADER_MEMBERS_COPY//

Create Procedure LOADER_MEMBERS_COPY (
    In batchnum int
)
Begin
    updateQuerys: Begin
--         call LOADER_MEMBERS_UPDATE(batchnum);
        call LOADER_MEMBERS_METADA_UPDATE(batchnum);
    end ;

    insertQuerys: Begin
        call CASH_AUTOINCREMENT_VALUE('MEMBERS', @lastMembersId);
        call LOADER_MEMBERS_INSERT(batchnum, @lastMembersId);
        call LOADER_MEMBERS_METADA_INSERT(batchnum, @lastMembersId);
-- 
    end ;
End //

Delimiter ;