Delimiter //
/**
    procédure pour créer la table de parametrage de l'import
*/

Drop Procedure if exists LOADER_INFO_TABLES//

Create Procedure LOADER_INFO_TABLES ()
Begin

    Drop Table If Exists LOADER_INFO;

    Create Table LOADER_INFO (

		ID_LOADER_INFO Int Unsigned Not Null Auto_increment,
		LOADER_INFO_BATCH_NUM Int Not Null Default 0,
		LOADER_INFO_NAME Varchar(50) Not Null,
		LOADER_INFO_VALUE Varchar(255), 

        -- contraintes et indexes
		Primary Key (ID_LOADER_INFO), 
		Unique Key (LOADER_INFO_BATCH_NUM, LOADER_INFO_NAME)

    ) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

End //

Delimiter ;
CALL LOADER_INFO_TABLES();
