Commit 6ac72c88 authored by Antony Le Courtes's avatar Antony Le Courtes
Browse files

Ajout du INSEE et INSEE PROVISOIRE dans MV_INTERVENANT.sql Octopus.

parent 36dccf5d
......@@ -172,8 +172,12 @@ SELECT DISTINCT
adr.ville_nom adresse_commune,
pays.code_pays z_adresse_pays_id,
/* INSEE */
CAST(NULL AS varchar2(255)) numero_insee,
CAST(NULL AS numeric(1)) numero_insee_provisoire,
COALESCE(vindinsee.no_insee, vindinsee.no_insee_provisoire) numero_insee,
CASE
WHEN vindinsee.no_insee IS NULL
AND vindinsee.no_insee_provisoire IS NOT NULL
THEN 1
ELSE 0 END numero_insee_provisoire,
/* Banque */
CAST(NULL AS varchar2(255)) iban,
CAST(NULL AS varchar2(255)) bic,
......@@ -200,6 +204,7 @@ FROM i
JOIN induni
ON i.code = induni.c_individu_chaine --AND induni.c_source IN ('HARP', 'OCTO', 'SIHAM'))
LEFT JOIN octo.individu@octoprod ind ON ind.c_individu_chaine = induni.c_individu_chaine
LEFT JOIN octo.v_individu_insee@octoprod vindinsee ON ind.c_individu_chaine = vindinsee.individu_id
LEFT JOIN octo.v_individu@octoprod vind ON vind.c_individu_chaine = induni.c_individu_chaine
--On récupére la structure principale de l'individu
LEFT JOIN structure_aff_enseigne sae ON sae.individu_id = induni.c_individu_chaine
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment