X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Ffusionax%2FEntreprises.sql;h=1c66461e9b913151235d24b2b7d1e39f59628c6f;hb=cafb410fea6f257f45da08631c6cdb5c35f86b17;hp=a14ccd12948adea6d2a05d2892aba32df93f0e20;hpb=40214aa65f590952c7bb2a586d6d0a9446b3c0e7;p=platal.git diff --git a/modules/fusionax/Entreprises.sql b/modules/fusionax/Entreprises.sql index a14ccd1..1c66461 100644 --- a/modules/fusionax/Entreprises.sql +++ b/modules/fusionax/Entreprises.sql @@ -5,13 +5,13 @@ DROP TABLE IF EXISTS `fusionax_entreprises`; CREATE TABLE IF NOT EXISTS `fusionax_entreprises` ( `EN` CHAR(2) NOT NULL COMMENT 'Vaut toujours EN pour cette table', `Code_etab` BIGINT(10) NOT NULL COMMENT 'Code de l''établissement', - `Raison_sociale` VARCHAR(255) collate utf8_general_ci NOT NULL COMMENT 'Raison sociale de l''établissement', - `Sigle` VARCHAR(50) collate utf8_general_ci NOT NULL COMMENT 'Sigle de l''établissement', - `Date_maj` DATE NOT NULL COMMENT 'Date de mise à jour de ces informations', - PRIMARY KEY(`Code_etab`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci; + `Raison_sociale` VARCHAR(255) NOT NULL COMMENT 'Raison sociale de l''établissement', + `Sigle` VARCHAR(50) NOT NULL COMMENT 'Sigle de l''établissement', + PRIMARY KEY(`Code_etab`), + INDEX (Raison_sociale(20)) +) ENGINE=InnoDB, CHARSET=utf8; -LOAD DATA LOCAL INFILE 'Entreprises.txt' INTO TABLE `fusionax_entreprises` FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\r\n' -(EN, Code_etab, Raison_sociale, Sigle, @Inconnu, @StringDate_maj) -SET -`Date_maj` = CONCAT(SUBSTRING(@StringDate_maj,7),'-',SUBSTRING(@StringDate_maj,4,2),'-',SUBSTRING(@StringDate_maj,1,2)); +LOAD DATA LOCAL INFILE '{?}Entreprises.txt' INTO TABLE `fusionax_entreprises` CHARACTER SET utf8 FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\r\n' +(EN, Code_etab, Raison_sociale, Sigle, @Inconnu, @StringDate_maj); + +UPDATE fusionax_entreprises SET Raison_sociale = TRIM(Raison_sociale), Sigle = TRIM(Sigle);