Delimiter //
/**
 * Table des ajouts des relations ENTRIES_MATCHCOD pour l'importation des MATCHINGCODES
 */
Drop Procedure if exists LOADER_CREATE_TABLE_MATCHINGCODES_ENTRIES//
Create Procedure LOADER_CREATE_TABLE_MATCHINGCODES_ENTRIES()
Begin

    Drop Table If Exists LOADER_MATCHINGCODES_ENTRIES;

    Create Table LOADER_MATCHINGCODES_ENTRIES(

        -- champs pour le traitements de l'import
        LOADER_STATUS_ID_LOADER_STATUS Int Not Null ,

        ID_LOADER_MATCHINGCODES_ENTRIES Int Unsigned Not Null Auto_increment,
--         LOADER_MATCHCOD_MATCHCOD_ID_LOADER_MATCHCOD_MATCHCOD Int Unsigned Not Null,
        LOADER_MATCHCOD_MATCHCOD_ID_LOADER_MATCHCOD_MATCHCOD Int Unsigned Null, -- -- permet d'ibtenir le nouvelle id de lettrage en création 
        LOADER_MATCHINGCODES_ENTRIES_ID_MATCHINGCODES Int Unsigned Null, -- id du letttrage en mode maj (comptable)

        -- contraintes et indexes
        Primary Key (ID_LOADER_MATCHINGCODES_ENTRIES)
        , Index (LOADER_STATUS_ID_LOADER_STATUS)

    ) ;

End //

Delimiter ;
CALL LOADER_CREATE_TABLE_MATCHINGCODES_ENTRIES();