Subversion Repositories eFlore/Applications.coel

Rev

Rev 1467 | Blame | Compare with Previous | Last modification | View Log | RSS feed

UPDATE coel_meta_historique_ligne SET cmhl_ce_table = 107
WHERE cmhl_ce_table = 102 
        AND cmhl_cle_ligne NOT LIKE '%-%';

UPDATE coel_meta_historique_ligne SET cmhl_cle_ligne = CONCAT_WS('-', 
        IF (ExtractValue(cmhl_enregistrement, '//csap_id_personne') = '', 0, ExtractValue(cmhl_enregistrement, '//csap_id_personne')),
        ExtractValue(cmhl_enregistrement, '//csap_id_role'),
        ExtractValue(cmhl_enregistrement, '//csap_id_structure')
        ) 
WHERE cmhl_ce_table = 121 
  AND cmhl_ce_etat = 1;

UPDATE coel_meta_historique_ligne SET cmhl_cle_ligne = CONCAT_WS('-', 
        SUBSTRING_INDEX(cmhl_cle_ligne, '-', 1),  # Premier 
        SUBSTRING_INDEX(cmhl_cle_ligne, '-', -1), # Dernier
        SUBSTRING_INDEX(SUBSTRING_INDEX(cmhl_cle_ligne, '-', 2), '-', -1)# Milieu
        ) 
WHERE cmhl_ce_table = 121 
  AND cmhl_ce_etat = 2;

UPDATE coel_meta_historique_ligne SET cmhl_cle_ligne = CONCAT_WS('-',
        SUBSTRING_INDEX(SUBSTRING_INDEX(cmhl_cle_ligne, '-', 2), '-', -1), # Milieu
        SUBSTRING_INDEX(cmhl_cle_ligne, '-', -1), # Dernier
        SUBSTRING_INDEX(cmhl_cle_ligne, '-', 1)  # Premier
        ) 
WHERE cmhl_ce_table = 121 
  AND cmhl_ce_etat = 3;