| Line 52... |
Line 52... |
| 52 |
c.famille = b.famille
|
52 |
c.famille = b.famille
|
| 53 |
WHERE (
|
53 |
WHERE (
|
| 54 |
nom_sel_nn IS NOT NULL AND nom_ret_nn IS NOT NULL AND nom_ret_nn != 0
|
54 |
nom_sel_nn IS NOT NULL AND nom_ret_nn IS NOT NULL AND nom_ret_nn != 0
|
| 55 |
AND nom_referentiel = 'bdtfx'
|
55 |
AND nom_referentiel = 'bdtfx'
|
| 56 |
AND nom_ret_nn = num_nom
|
56 |
AND nom_ret_nn = num_nom
|
| 57 |
AND (LOWER(c.famille) = LOWER(b.famille) OR c.famille IS NULL)
|
57 |
/* AND (LOWER(c.famille) = LOWER(b.famille) OR c.famille IS NULL) */
|
| 58 |
);
|
58 |
);
|
| 59 |
-- 339
|
59 |
-- 339 + 41373
|
| - |
|
60 |
SELECT ROW_COUNT() AS "BDTFX upd après correction sur nom_ret_nn + nom_sel_nn";
|
| Line 60... |
Line 61... |
| 60 |
|
61 |
|
| 61 |
/* test:
|
62 |
/* test:
|
| 62 |
SELECT c.nom_ret_nn, c.nom_ret, bLAST.num_nom, bLAST.nom_sci, bLAST.auteur, c.famille, bLAST.famille, c.nt, bLAST.num_taxonomique
|
63 |
SELECT c.nom_ret_nn, c.nom_ret, bLAST.num_nom, bLAST.nom_sci, bLAST.auteur, c.famille, bLAST.famille, c.nt, bLAST.num_taxonomique
|
| 63 |
FROM cel_obs c, tb_eflore.bdtfx_v1_01 b, tb_eflore.bdtfx_v1_01 bLAST
|
64 |
FROM cel_obs c, tb_eflore.bdtfx_v1_01 b, tb_eflore.bdtfx_v1_01 bLAST
|
| Line 82... |
Line 83... |
| 82 |
AND nom_referentiel = 'bdtfx'
|
83 |
AND nom_referentiel = 'bdtfx'
|
| 83 |
AND nom_sel_nn = b.num_nom
|
84 |
AND nom_sel_nn = b.num_nom
|
| 84 |
AND (LOWER(c.famille) = LOWER(b.famille) OR c.famille IS NULL)
|
85 |
AND (LOWER(c.famille) = LOWER(b.famille) OR c.famille IS NULL)
|
| 85 |
AND SUBSTRING_INDEX(c.nom_sel, ' ', 1) = SUBSTRING_INDEX(b.nom_sci, ' ', 1)
|
86 |
AND SUBSTRING_INDEX(c.nom_sel, ' ', 1) = SUBSTRING_INDEX(b.nom_sci, ' ', 1)
|
| 86 |
);
|
87 |
);
|
| 87 |
-- 251 avec indirection num_nom_retenu
|
88 |
-- 251 + 45649 avec indirection num_nom_retenu
|
| - |
|
89 |
SELECT ROW_COUNT() AS "BDTFX upd après correction sur nom_sel_nn";
|
| Line 88... |
Line 90... |
| 88 |
|
90 |
|
| 89 |
|
91 |
|
| 90 |
-- l'update BDTXA avec nom_sel_nn et nom_ret_nn corrects --
|
92 |
-- l'update BDTXA avec nom_sel_nn et nom_ret_nn corrects --
|
| Line 96... |
Line 98... |
| 96 |
nom_sel_nn IS NOT NULL AND nom_ret_nn IS NOT NULL AND nom_ret_nn != 0
|
98 |
nom_sel_nn IS NOT NULL AND nom_ret_nn IS NOT NULL AND nom_ret_nn != 0
|
| 97 |
AND nom_referentiel = 'bdtxa'
|
99 |
AND nom_referentiel = 'bdtxa'
|
| 98 |
AND nom_ret_nn = num_nom
|
100 |
AND nom_ret_nn = num_nom
|
| 99 |
AND (LOWER(c.famille) = LOWER(a.famille) OR c.famille IS NULL)
|
101 |
AND (LOWER(c.famille) = LOWER(a.famille) OR c.famille IS NULL)
|
| 100 |
);
|
102 |
);
|
| 101 |
-- 1
|
103 |
-- 1 + 49
|
| - |
|
104 |
SELECT ROW_COUNT() AS "BDTXA upd après correction sur nom_ret_nn + nom_sel_nn";
|
| Line 102... |
Line -... |
| 102 |
|
- |
|
| 103 |
/*TODO
|
105 |
|
| 104 |
-- l'update BDTXA avec nom_sel_nn seul
|
106 |
-- l'update BDTXA avec nom_sel_nn seul
|
| 105 |
UPDATE `BASEEDIT`.`cel_obs` c, `BASESOURCE`.`TABLEBDTXA` a SET
|
107 |
UPDATE `BASEEDIT`.`cel_obs` c, `BASESOURCE`.`TABLEBDTXA` a, `BASESOURCE`.`TABLEBDTXA` a_nom_ret SET
|
| 106 |
c.nom_ret = CONCAT(a.nom_sci, ' ', a.auteur),
|
108 |
c.nom_ret = CONCAT(a_nom_ret.nom_sci, ' ', a_nom_ret.auteur),
|
| 107 |
c.nom_ret_nn = a.num_nom,
|
109 |
c.nom_ret_nn = a.num_nom,
|
| 108 |
c.nt = a.num_tax,
|
110 |
c.nt = a.num_tax,
|
| 109 |
c.famille = a.famille
|
111 |
c.famille = a.famille
|
| - |
|
112 |
WHERE (
|
| 110 |
WHERE (
|
113 |
a_nom_ret.num_nom = a.num_nom_retenu
|
| 111 |
nom_sel_nn IS NOT NULL
|
114 |
AND nom_sel_nn IS NOT NULL
|
| 112 |
AND nom_referentiel = 'bdtxa'
|
115 |
AND nom_referentiel = 'bdtxa'
|
| 113 |
AND nom_sel_nn = num_nom
|
116 |
AND nom_sel_nn = a.num_nom
|
| 114 |
AND (LOWER(c.famille) = LOWER(a.famille) OR c.famille IS NULL)
|
117 |
AND (LOWER(c.famille) = LOWER(a.famille) OR c.famille IS NULL)
|
| 115 |
AND SUBSTRING_INDEX(c.nom_sel, ' ', 1) = SUBSTRING_INDEX(a.nom_sci, ' ', 1)
|
118 |
AND SUBSTRING_INDEX(c.nom_sel, ' ', 1) = SUBSTRING_INDEX(a.nom_sci, ' ', 1)
|
| 116 |
);
|
119 |
);
|
| 117 |
-- 49 sans les restrictions sur famille et SUBSTRING_INDEX()
|
120 |
-- 47 + 49 avec les restrictions sur famille et SUBSTRING_INDEX()
|
| 118 |
-- 47 avec les restrictions sur famille et SUBSTRING_INDEX()
|
- |
|
| 119 |
*/
|
- |
|
| - |
|
121 |
-- 48 sans les restrictions sur famille et SUBSTRING_INDEX()
|
| Line 120... |
Line 122... |
| 120 |
|
122 |
SELECT ROW_COUNT() AS "BDTXA upd après correction sur nom_sel_nn";
|
| 121 |
|
123 |
|
| 122 |
-- l'update ISFAN avec nom_sel_nn et nom_ret_nn corrects --
|
124 |
-- l'update ISFAN avec nom_sel_nn et nom_ret_nn corrects --
|
| 123 |
UPDATE `BASEEDIT`.`cel_obs` c, `BASESOURCE`.`TABLEISFAN` i SET
|
125 |
UPDATE `BASEEDIT`.`cel_obs` c, `BASESOURCE`.`TABLEISFAN` i SET
|
| Line 129... |
Line 131... |
| 129 |
AND nom_referentiel = 'isfan'
|
131 |
AND nom_referentiel = 'isfan'
|
| 130 |
AND nom_ret_nn = num_nom
|
132 |
AND nom_ret_nn = num_nom
|
| 131 |
AND (LOWER(c.famille) = LOWER(i.famille) OR c.famille IS NULL)
|
133 |
AND (LOWER(c.famille) = LOWER(i.famille) OR c.famille IS NULL)
|
| 132 |
);
|
134 |
);
|
| 133 |
-- 2
|
135 |
-- 2
|
| - |
|
136 |
SELECT ROW_COUNT() AS "ISFAN upd après correction sur nom_ret_nn + nom_sel_nn";
|
| Line 134... |
Line -... |
| 134 |
|
- |
|
| 135 |
/*TODO
|
137 |
|
| 136 |
-- l'update ISFAN avec nom_sel_nn seul
|
138 |
-- l'update ISFAN avec nom_sel_nn seul
|
| 137 |
UPDATE `BASEEDIT`.`cel_obs` c, `BASESOURCE`.`TABLEISFAN` i SET
|
139 |
UPDATE `BASEEDIT`.`cel_obs` c, `BASESOURCE`.`TABLEISFAN` i, `BASESOURCE`.`TABLEISFAN` i_nom_ret SET
|
| 138 |
c.nom_ret = CONCAT(i.nom_sci, ' ', i.auteur),
|
140 |
c.nom_ret = CONCAT(i_nom_ret.nom_sci, ' ', i_nom_ret.auteur),
|
| 139 |
c.nom_ret_nn = i.num_nom,
|
141 |
c.nom_ret_nn = i.num_nom,
|
| 140 |
c.nt = i.num_taxonomique,
|
142 |
c.nt = i.num_taxonomique,
|
| 141 |
c.famille = i.famille
|
143 |
c.famille = i.famille
|
| - |
|
144 |
WHERE (
|
| 142 |
WHERE (
|
145 |
i_nom_ret.num_nom = i.num_nom_retenu
|
| 143 |
nom_sel_nn IS NOT NULL
|
146 |
AND nom_sel_nn IS NOT NULL
|
| 144 |
AND nom_referentiel = 'isfan'
|
147 |
AND nom_referentiel = 'isfan'
|
| 145 |
AND nom_sel_nn = num_nom
|
148 |
AND nom_sel_nn = i.num_nom
|
| 146 |
AND (LOWER(c.famille) = LOWER(i.famille) OR c.famille IS NULL)
|
149 |
AND (LOWER(c.famille) = LOWER(i.famille) OR c.famille IS NULL)
|
| 147 |
);
|
150 |
);
|
| - |
|
151 |
-- 0
|
| Line 148... |
Line 152... |
| 148 |
*/
|
152 |
SELECT ROW_COUNT() AS "ISFAN upd après correction sur nom_sel_nn";
|
| 149 |
|
153 |
|
| 150 |
/*
|
154 |
/*
|
| 151 |
Pour observer les différences:
|
155 |
Pour observer les différences:
|