PostgreSQL La base de donnees la plus sophistiquee au monde.

Forums PostgreSQL.fr

Le forum officiel de la communauté francophone de PostgreSQL

Vous n'êtes pas identifié(e).

#1 25/01/2022 07:42:00

Charle
Membre

unterminated quoted identifier at or near ""Code postal "

Bonjour,
J'ai cette requette que je n'arrive pas à faire marcher sous postgres.

J'ai cette erreur, unterminated quoted identifier at or near ""Code postal"

Pourriez vous m'aider?

/******** ID FAVORI 40393610 ********/
with q1 as (
-- Payeur - ADRESSE FACTURATION (R.7)
select
  apprenant.objet_id as id_interne_aurion,
  D1.attribut_valstr AS "Nom Prénom Payeur",
  adresse.rue_1 AS "Rue (ligne 1).Adresse",
  adresse.rue_2 AS "Rue (ligne 2).Adresse",
  adresse.rue_3 AS "Rue (ligne 3).Adresse",
  D2.attribut_valstr AS "Code Postal.Adresse FACTU",
  D3.attribut_valstr AS "Ville.Adresse FACTU",
  D4.valeur AS "Pays.Adresse FACTU",
  D5.attribut_valstr AS "Téléphone Payeur",
  D6.attribut_valstr AS "Email Payeur"
from (select o.* from auriga.t_individus o where true and o.est_apprenant and not o.obsolete) apprenant
left join auriga.t_individus_adresses R1 on R1.individu_id = apprenant.objet_id
left join auriga.t_adresses adresse on adresse.objet_id = R1.adresse_id
left join auriga.t_relations R2 on R2.source_id = R1.objet_id and R2.relation_nom = 'individu-adresse-type_adresse'
left join auriga.t_types_adresse type_adresse on type_adresse.objet_id = R2.dest_id
left join auriga.t_pays pays on pays.objet_id = adresse.pays_id
left join auriga.t_donnees_str D1 on (D1.objet_id, D1.attribut_id) = (adresse.objet_id, 18652349)
left join auriga.t_donnees_str D2 on (D2.objet_id, D2.attribut_id) = (adresse.objet_id, 4431307)
left join auriga.t_donnees_str D3 on (D3.objet_id, D3.attribut_id) = (adresse.objet_id, 47145)
left join auriga.t_multilangues D4 on (D4.objet_id, D4.attribut_id, D4.langue_id) = (pays.objet_id, 351, 44323)
left join auriga.t_donnees_str D5 on (D5.objet_id, D5.attribut_id) = (adresse.objet_id, 18652344)
left join auriga.t_donnees_str D6 on (D6.objet_id, D6.attribut_id) = (adresse.objet_id, 18652348)
where (true
and (type_adresse.code = 'ADR_FACTU')
)
)
, q2 as (
-- Groupe de Facturation (R.10)
select
  apprenant.objet_id as id_interne_aurion,
  groupe.code AS "FACTURATION",
  D1.valeur AS "Libellé Facturation"
from (select o.* from auriga.t_individus o where true and o.est_apprenant and exists (select 1 from q1 where id_interne_aurion = o.objet_id) and not o.obsolete) apprenant
left join auriga.t_apprenants_groupes R1 on R1.apprenant_id = apprenant.objet_id
left join auriga.t_groupes groupe on groupe.objet_id = R1.groupe_id
left join auriga.t_types_groupe type_groupe on type_groupe.objet_id = groupe.type_groupe_id
left join auriga.t_multilangues D1 on (D1.objet_id, D1.attribut_id, D1.langue_id) = (groupe.objet_id, 661, 44323)
where (true
and (true)
and (type_groupe.code = 'FACTURATION')
)
)
, q3 as (
-- DOSSIER FINANCIER (R.8)
select
  apprenant.objet_id as id_interne_aurion,
  D1.valeur AS "Libellé.Choix mode de paiement",
  type_evenement_22.objet_id AS "id.Dossier financier d'inscription",
  D2.attribut_valdate::date AS "Date Dossier Complet.Dossier financier d'inscription",
  D3.attribut_valdate::date AS "Date Dossier Incomplet.Dossier financier d'inscription",
  oui_non_client.code AS "Code.Dossier complet"
from (select o.* from auriga.t_individus o where true and o.est_apprenant and exists (select 1 from q2 where id_interne_aurion = o.objet_id) and not o.obsolete) apprenant
left join auriga.t_apprenants_evenements R1 on R1.apprenant_id = apprenant.objet_id
left join auriga.t_evenements evenement on evenement.objet_id = R1.evenement_id
left join auriga.t_relations R2 on R2.source_id = evenement.objet_id and R2.relation_nom = 'evenement-type_evenement_22'
left join auriga.t_objets type_evenement_22 on type_evenement_22.objet_id = R2.dest_id and type_evenement_22.type = 'type_evenement_22' and not type_evenement_22.efface
left join auriga.t_relations R3 on R3.source_id = type_evenement_22.objet_id and R3.relation_nom = 'type_evenement_22-mode_reglement§18637223'
left join auriga.t_modes_reglement mode_reglement on mode_reglement.objet_id = R3.dest_id
left join auriga.t_relations R4 on R4.source_id = type_evenement_22.objet_id and R4.relation_nom = 'type_evenement_22-oui_non.client§17924950'
left join auriga.t_objets oui_non_client on oui_non_client.objet_id = R4.dest_id and oui_non_client.type = 'oui_non.client' and not oui_non_client.efface
left join auriga.t_multilangues D1 on (D1.objet_id, D1.attribut_id, D1.langue_id) = (mode_reglement.objet_id, 3411, 44323)
left join auriga.t_donnees_date D2 on (D2.objet_id, D2.attribut_id) = (type_evenement_22.objet_id, 19050328)
left join auriga.t_donnees_date D3 on (D3.objet_id, D3.attribut_id) = (type_evenement_22.objet_id, 35741504)
where (true
and type_evenement_22.objet_id is not null
)
)
, q4 as (
-- Groupe DIPLOME (R.2)
select
  apprenant.objet_id as id_interne_aurion,
  programme.code AS "Code.Programme",
  D1.valeur AS "Libellé.Programme"
from (select o.* from auriga.t_individus o where true and o.est_apprenant and exists (select 1 from q3 where id_interne_aurion = o.objet_id) and not o.obsolete) apprenant
left join auriga.t_inscriptions_programme inscription_programme on inscription_programme.apprenant_id = apprenant.objet_id
left join auriga.t_groupes groupe on groupe.objet_id = inscription_programme.groupe_id
left join auriga.t_types_groupe type_groupe on type_groupe.objet_id = groupe.type_groupe_id
left join auriga.t_programmes programme on programme.objet_id = groupe.programme_id
left join auriga.t_multilangues D1 on (D1.objet_id, D1.attribut_id, D1.langue_id) = (programme.objet_id, 4141, 44323)
where (true
and (type_groupe.code = 'DIPLOME')
)
)
, q5 as (
-- (R.1)
select
  apprenant.objet_id as id_interne_aurion,
  apprenant.objet_id AS "id.Apprenant",
  D1.valeur AS "Libellé.Titre",
  apprenant.ind_nom AS "Nom",
  apprenant.ind_prenom AS "Prénom",
  apprenant.ind_date_naissance AS "Date naissance",
  D2.attribut_valstr AS "Ville de naissance.Individu",
  ville.nom AS "Nom.Ville française",
  D3.attribut_valstr AS "Code postal ville de naissance.Individu",
  D4.valeur AS "Pays de naissance",
  D5.valeur AS "Libellé.Nationalité",
  D6.valeur AS "Libellé.Etudiant Payeur"
from (select o.* from auriga.t_individus o where true and o.est_apprenant and exists (select 1 from q4 where id_interne_aurion = o.objet_id) and not o.obsolete) apprenant
left join auriga.t_titres titre on titre.objet_id = apprenant.titre_id
left join auriga.t_villes ville on ville.objet_id = apprenant.ville_id
left join auriga.t_relations R1 on R1.source_id = apprenant.objet_id and R1.relation_nom = 'individu-pays§45031'
left join auriga.t_pays pays on pays.objet_id = R1.dest_id
left join auriga.t_individus_nationalites R2 on R2.individu_id = apprenant.objet_id
left join auriga.t_nationalites nationalite on nationalite.objet_id = R2.nationalite_id
left join auriga.t_relations R3 on R3.source_id = apprenant.objet_id and R3.relation_nom = 'individu-oui_non.client§18637807'
left join auriga.t_objets oui_non_client on oui_non_client.objet_id = R3.dest_id and oui_non_client.type = 'oui_non.client' and not oui_non_client.efface
left join auriga.t_multilangues D1 on (D1.objet_id, D1.attribut_id, D1.langue_id) = (titre.objet_id, 311, 44323)
left join auriga.t_donnees_str D2 on (D2.objet_id, D2.attribut_id) = (apprenant.objet_id, 45030)
left join auriga.t_donnees_str D3 on (D3.objet_id, D3.attribut_id) = (apprenant.objet_id, 48199)
left join auriga.t_multilangues D4 on (D4.objet_id, D4.attribut_id, D4.langue_id) = (pays.objet_id, 351, 44323)
left join auriga.t_multilangues D5 on (D5.objet_id, D5.attribut_id, D5.langue_id) = (nationalite.objet_id, 801, 44323)
left join auriga.t_multilangues D6 on (D6.objet_id, D6.attribut_id, D6.langue_id) = (oui_non_client.objet_id, 899741, 44323)
where (true
and (exists (select 1 from (with q1 as (
-- (R.1)
select
  apprenant.objet_id as id_interne_aurion,
  apprenant.objet_id AS "id.Apprenant",
  apprenant.ind_particule AS "NUMELV.Apprenant",
  apprenant.ind_nom AS "Nom d'usage.Apprenant",
  apprenant.ind_prenom AS "Prénom.Apprenant",
  groupe.code AS "Code.Groupe",
  programme.code AS "Programme",
  type_apprenant.code AS "Code.Type d'apprenant",
  type_convention.code AS "Code.Type de convention"
from (select o.* from auriga.t_individus o where true and o.est_apprenant and not o.obsolete) apprenant
left join auriga.t_inscriptions_programme inscription_programme on inscription_programme.apprenant_id = apprenant.objet_id
left join auriga.t_groupes groupe on groupe.objet_id = inscription_programme.groupe_id
left join auriga.t_types_groupe type_groupe on type_groupe.objet_id = groupe.type_groupe_id
left join auriga.t_programmes programme on programme.objet_id = groupe.programme_id
left join auriga.t_types_apprenant type_apprenant on type_apprenant.objet_id = inscription_programme.type_apprenant_id
left join auriga.t_types_convention type_convention on type_convention.objet_id = inscription_programme.type_convention_id
where (true
and (true)
and (type_groupe.code = 'FACTURATION')
)
)
, q2 as (
-- Mode admission (R.2)
select
  apprenant.objet_id as id_interne_aurion1,
  moded_admission_client.code AS "Code.Mode d'admission",
  programme.code AS "Programme",
  apprenant.objet_id AS "id.Apprenant",
  entite.code AS "Code.Campus de recrutement"
from (select o.* from auriga.t_individus o where true and o.est_apprenant and not o.obsolete) apprenant
left join auriga.t_inscriptions_programme inscription_programme on inscription_programme.apprenant_id = apprenant.objet_id
left join auriga.t_groupes groupe on groupe.objet_id = inscription_programme.groupe_id
left join auriga.t_types_groupe type_groupe on type_groupe.objet_id = groupe.type_groupe_id
left join auriga.t_relations R1 on R1.source_id = inscription_programme.objet_id and R1.relation_nom = 'inscription_programme-moded_admission.client§1531414'
left join auriga.t_objets moded_admission_client on moded_admission_client.objet_id = R1.dest_id and moded_admission_client.type = 'moded_admission.client' and not moded_admission_client.efface
left join auriga.t_programmes programme on programme.objet_id = groupe.programme_id
left join auriga.t_relations R2 on R2.source_id = inscription_programme.objet_id and R2.relation_nom = 'inscription_programme-entite§1531437'
left join auriga.t_entites entite on entite.objet_id = R2.dest_id
where (true
and (type_groupe.code = 'DIPLOME')
)
)
select
id_interne_aurion,
  q1."id.Apprenant",
  q1."NUMELV.Apprenant",
  q1."Nom d'usage.Apprenant",
  q1."Prénom.Apprenant",
  q1."Code.Groupe",
  q1."Programme",
  q1."Code.Type d'apprenant",
  q1."Code.Type de convention",
  q2."Code.Mode d'admission",
  q2."Code.Campus de recrutement"
from q1 natural join q2
where true /* and id_interne_aurion= any(('{' || $P{ObjectID_List} || '}')::integer[]) */
order by q1."Code.Groupe" asc, q1."Code.Type d'apprenant" asc, q1."Code.Type de convention" asc) r where r.id_interne_aurion = apprenant.objet_id))
)
)
, q6 as (
-- Apprenant UE (R.11)
select
  apprenant.objet_id as id_interne_aurion,
  D1.attribut_valbool AS "UE.Nationalité"
from (select o.* from auriga.t_individus o where true and o.est_apprenant and exists (select 1 from q5 where id_interne_aurion = o.objet_id) and not o.obsolete) apprenant
left join auriga.t_individus_nationalites R1 on R1.individu_id = apprenant.objet_id
left join auriga.t_nationalites nationalite on nationalite.objet_id = R1.nationalite_id
left join auriga.t_donnees_bool D1 on (D1.objet_id, D1.attribut_id) = (nationalite.objet_id, 2156292)
where (true
)
)
, q7 as (
-- Date de Validation RF (R.9)
select
  apprenant.objet_id as id_interne_aurion,
  D1.attribut_valdate::date AS "Date Validation RF par l'apprenant.Inscription au groupe"
from (select o.* from auriga.t_individus o where true and o.est_apprenant and exists (select 1 from q6 where id_interne_aurion = o.objet_id) and not o.obsolete) apprenant
left join auriga.t_inscriptions_programme inscription_programme on inscription_programme.apprenant_id = apprenant.objet_id
left join auriga.t_groupes groupe on groupe.objet_id = inscription_programme.groupe_id
left join auriga.t_types_groupe type_groupe on type_groupe.objet_id = groupe.type_groupe_id
left join auriga.t_donnees_date D1 on (D1.objet_id, D1.attribut_id) = (inscription_programme.objet_id, 43539386)
where (true
and (type_groupe.code = 'REGISTRATION_FILE')
)
)
, q8 as (
-- EMAIL_CONTACT (R.4)
select
  apprenant.objet_id as id_interne_aurion,
  coordonnee.coordonnee AS "Email ETUDIANT"
from (select o.* from auriga.t_individus o where true and o.est_apprenant and exists (select 1 from q6 where id_interne_aurion = o.objet_id) and not o.obsolete) apprenant
left join auriga.t_individus_coordonnees R1 on R1.individu_id = apprenant.objet_id
left join auriga.t_coordonnees coordonnee on coordonnee.objet_id = R1.coordonnee_id
left join auriga.t_types_coordonnee type_coordonnee on type_coordonnee.objet_id = R1.type_coordonnee_id
where (true
and (type_coordonnee.code = 'EMAIL_CONTACT')
)
)
, q9 as (
-- Adresse PERMANENT (R.3)
select
  apprenant.objet_id as id_interne_aurion,
  adresse.rue_1 AS "Rue (ligne 1).Adresse 2",
  adresse.rue_2 AS "Rue (ligne 2).Adresse 2",
  adresse.rue_3 AS "Rue (ligne 3).Adresse 2",
  D1.attribut_valstr AS "Ville.Adresse",
  D2.attribut_valstr AS "Code Postal.Adresse",
  ville.code_postal AS "Code postal.Ville française",
  ville.nom AS "Nom.Ville française 2",
  D3.valeur AS "Libellé.Pays",
  D4.attribut_valstr AS "Représentant Légal - Nom Prénom",
  D5.attribut_valstr AS "Représentant Légal - Email",
  D6.attribut_valstr AS "Représentant Légal - Téléphone",
  D7.valeur AS "Libellé.Représentant Légal Payeur"
from (select o.* from auriga.t_individus o where true and o.est_apprenant and exists (select 1 from q6 where id_interne_aurion = o.objet_id) and not o.obsolete) apprenant
left join auriga.t_individus_adresses R1 on R1.individu_id = apprenant.objet_id
left join auriga.t_adresses adresse on adresse.objet_id = R1.adresse_id
left join auriga.t_relations R2 on R2.source_id = R1.objet_id and R2.relation_nom = 'individu-adresse-type_adresse'
left join auriga.t_types_adresse type_adresse on type_adresse.objet_id = R2.dest_id
left join auriga.t_villes ville on ville.objet_id = adresse.ville_id
left join auriga.t_pays pays on pays.objet_id = adresse.pays_id
left join auriga.t_relations R3 on R3.source_id = apprenant.objet_id and R3.relation_nom = 'individu-oui_non.client§18637809'
left join auriga.t_objets oui_non_client on oui_non_client.objet_id = R3.dest_id and oui_non_client.type = 'oui_non.client' and not oui_non_client.efface
left join auriga.t_donnees_str D1 on (D1.objet_id, D1.attribut_id) = (adresse.objet_id, 47145)
left join auriga.t_donnees_str D2 on (D2.objet_id, D2.attribut_id) = (adresse.objet_id, 4431307)
left join auriga.t_multilangues D3 on (D3.objet_id, D3.attribut_id, D3.langue_id) = (pays.objet_id, 351, 44323)
left join auriga.t_donnees_str D4 on (D4.objet_id, D4.attribut_id) = (adresse.objet_id, 18652343)
left join auriga.t_donnees_str D5 on (D5.objet_id, D5.attribut_id) = (adresse.objet_id, 18652454)
left join auriga.t_donnees_str D6 on (D6.objet_id, D6.attribut_id) = (adresse.objet_id, 18652401)
left join auriga.t_multilangues D7 on (D7.objet_id, D7.attribut_id, D7.langue_id) = (oui_non_client.objet_id, 899741, 44323)
where (true
and (type_adresse.code = 'ADR_PERM')
)
)
, q10 as (
-- PORTABLE (R.6)
select
  apprenant.objet_id as id_interne_aurion,
  coordonnee.coordonnee AS "Tel PORTABLE"
from (select o.* from auriga.t_individus o where true and o.est_apprenant and exists (select 1 from q6 where id_interne_aurion = o.objet_id) and not o.obsolete) apprenant
left join auriga.t_individus_coordonnees R1 on R1.individu_id = apprenant.objet_id
left join auriga.t_coordonnees coordonnee on coordonnee.objet_id = R1.coordonnee_id
left join auriga.t_types_coordonnee type_coordonnee on type_coordonnee.objet_id = R1.type_coordonnee_id
where (true
and (type_coordonnee.code = 'TEL_SECONDAIRE')
)
)
, q11 as (
-- TELEPHONE (R.5)
select
  apprenant.objet_id as id_interne_aurion,
  coordonnee.coordonnee AS "Tel PRINCIPAL"
from (select o.* from auriga.t_individus o where true and o.est_apprenant and exists (select 1 from q6 where id_interne_aurion = o.objet_id) and not o.obsolete) apprenant
left join auriga.t_individus_coordonnees R1 on R1.individu_id = apprenant.objet_id
left join auriga.t_coordonnees coordonnee on coordonnee.objet_id = R1.coordonnee_id
left join auriga.t_types_coordonnee type_coordonnee on type_coordonnee.objet_id = R1.type_coordonnee_id
where (true
and (type_coordonnee.code = 'TEL_PRINCIPAL')
)
)
select
(array_agg(distinct id_interne_aurion))[1] as id_interne_aurion,
  q2."FACTURATION",
  q2."Libellé Facturation",
  q4."Code.Programme",
  q4."Libellé.Programme",
  ((case when (case when coalesce(cast(q6."UE.Nationalité" as text), '') <> '' then cast('UE' as text) else cast(q6."UE.Nationalité" as text) end) is null or (case when coalesce(cast(q6."UE.Nationalité" as text), '') <> '' then cast('UE' as text) else cast(q6."UE.Nationalité" as text) end)::text = '' then cast('HUE' as text) else (case when coalesce(cast(q6."UE.Nationalité" as text), '') <> '' then cast('UE' as text) else cast(q6."UE.Nationalité" as text) end) end)) as "UE / HUE",
  q5."Libellé.Titre",
  q5."Nom",
  q5."Prénom",
  q5."Date naissance",
  ((coalesce((coalesce((coalesce((coalesce((case when q5."Nom.Ville française" is null or q5."Nom.Ville française"::text = '' then q5."Ville de naissance.Individu" else q5."Nom.Ville française" end), '') || coalesce(cast(' ' as text), '')), '') || coalesce(cast('(' as text), '')), '') || coalesce((case when (substring((case when coalesce(q5."Nom.Ville française", '') <> '' then q5."Code postal ville de naissance.Individu" else q5."Nom.Ville française" end) from 1 for cast(cast(2 as numeric) as integer))) is null or (substring((case when coalesce(q5."Nom.Ville française", '') <> '' then q5."Code postal ville de naissance.Individu" else q5."Nom.Ville française" end) from 1 for cast(cast(2 as numeric) as integer)))::text = '' then cast('-' as text) else (substring((case when coalesce(q5."Nom.Ville française", '') <> '' then q5."Code postal ville de naissance.Individu" else q5."Nom.Ville française" end) from 1 for cast(cast(2 as numeric) as integer))) end), '')), '') || coalesce(cast(')' as text), ''))) as "Ville de naissance",
  q5."Pays de naissance",
  (array_to_string(array_agg(distinct(q5."Libellé.Nationalité") order by q5."Libellé.Nationalité"), ' / ')) as "Nationalités",
  ((coalesce((coalesce((coalesce((coalesce(q9."Rue (ligne 1).Adresse 2", '') || coalesce(cast(' ' as text), '')), '') || coalesce(q9."Rue (ligne 2).Adresse 2", '')), '') || coalesce(cast(' ' as text), '')), '') || coalesce(q9."Rue (ligne 3).Adresse 2", ''))) as "Adresse",
  ((case when q9."Code postal.Ville française" is null or q9."Code postal.Ville française"::text = '' then q9."Code Postal.Adresse" else q9."Code postal.Ville française" end)) as "Code postal Adresse",
  ((case when q9."Nom.Ville française 2" is null or q9."Nom.Ville française 2"::text = '' then q9."Ville.Adresse" else q9."Nom.Ville française 2" end)) as "Ville Adresse",
  (upper(q9."Libellé.Pays")) as "Pays Adresse",
  q8."Email ETUDIANT",
  q11."Tel PRINCIPAL",
  q10."Tel PORTABLE",
  q9."Représentant Légal - Nom Prénom",
  q9."Représentant Légal - Email",
  q9."Représentant Légal - Téléphone",
  ((case when (case when (case when coalesce((substring(q5."Libellé.Etudiant Payeur" from cast('yes|Oui' as text))), '') <> '' then cast('Etudiant' as text) else (substring(q5."Libellé.Etudiant Payeur" from cast('yes|Oui' as text))) end) is null or (case when coalesce((substring(q5."Libellé.Etudiant Payeur" from cast('yes|Oui' as text))), '') <> '' then cast('Etudiant' as text) else (substring(q5."Libellé.Etudiant Payeur" from cast('yes|Oui' as text))) end)::text = '' then (case when coalesce((substring(q9."Libellé.Représentant Légal Payeur" from cast('yes|Oui' as text))), '') <> '' then cast('Responsable Légal' as text) else (substring(q9."Libellé.Représentant Légal Payeur" from cast('yes|Oui' as text))) end) else (case when coalesce((substring(q5."Libellé.Etudiant Payeur" from cast('yes|Oui' as text))), '') <> '' then cast('Etudiant' as text) else (substring(q5."Libellé.Etudiant Payeur" from cast('yes|Oui' as text))) end) end) is null or (case when (case when coalesce((substring(q5."Libellé.Etudiant Payeur" from cast('yes|Oui' as text))), '') <> '' then cast('Etudiant' as text) else (substring(q5."Libellé.Etudiant Payeur" from cast('yes|Oui' as text))) end) is null or (case when coalesce((substring(q5."Libellé.Etudiant Payeur" from cast('yes|Oui' as text))), '') <> '' then cast('Etudiant' as text) else (substring(q5."Libellé.Etudiant Payeur" from cast('yes|Oui' as text))) end)::text = '' then (case when coalesce((substring(q9."Libellé.Représentant Légal Payeur" from cast('yes|Oui' as text))), '') <> '' then cast('Responsable Légal' as text) else (substring(q9."Libellé.Représentant Légal Payeur" from cast('yes|Oui' as text))) end) else (case when coalesce((substring(q5."Libellé.Etudiant Payeur" from cast('yes|Oui' as text))), '') <> '' then cast('Etudiant' as text) else (substring(q5."Libellé.Etudiant Payeur" from cast('yes|Oui' as text))) end) end)::text = '' then cast('Tiers' as text) else (case when (case when coalesce((substring(q5."Libellé.Etudiant Payeur" from cast('yes|Oui' as text))), '') <> '' then cast('Etudiant' as text) else (substring(q5."Libellé.Etudiant Payeur" from cast('yes|Oui' as text))) end) is null or (case when coalesce((substring(q5."Libellé.Etudiant Payeur" from cast('yes|Oui' as text))), '') <> '' then cast('Etudiant' as text) else (substring(q5."Libellé.Etudiant Payeur" from cast('yes|Oui' as text))) end)::text = '' then (case when coalesce((substring(q9."Libellé.Représentant Légal Payeur" from cast('yes|Oui' as text))), '') <> '' then cast('Responsable Légal' as text) else (substring(q9."Libellé.Représentant Légal Payeur" from cast('yes|Oui' as text))) end) else (case when coalesce((substring(q5."Libellé.Etudiant Payeur" from cast('yes|Oui' as text))), '') <> '' then cast('Etudiant' as text) else (substring(q5."Libellé.Etudiant Payeur" from cast('yes|Oui' as text))) end) end) end)) as "Payeur",
  q1."Nom Prénom Payeur",
  ((coalesce((coalesce((coalesce((coalesce(q1."Rue (ligne 1).Adresse", '') || coalesce(cast(' ' as text), '')), '') || coalesce(q1."Rue (ligne 2).Adresse", '')), '') || coalesce(cast(' ' as text), '')), '') || coalesce(q1."Rue (ligne 3).Adresse", ''))) as "Adresse FACTU",
  q1."Code Postal.Adresse FACTU",
  q1."Ville.Adresse FACTU",
  q1."Pays.Adresse FACTU",
  q1."Téléphone Payeur",
  q1."Email Payeur",
  q3."Libellé.Choix mode de paiement",
  q7."Date Validation RF par l'apprenant.Inscription au groupe",
  q3."id.Dossier financier d'inscription",
  q5."id.Apprenant",
  q3."Date Dossier Complet.Dossier financier d'inscription",
  q3."Date Dossier Incomplet.Dossier financier d'inscription",
  q3."Code.Dossier complet"
from q1 join q2 using (id_interne_aurion) join q3 using (id_interne_aurion) join q4 using (id_interne_aurion) join q5 using (id_interne_aurion) join q6 using (id_interne_aurion) left join q7 using (id_interne_aurion) left join q8 using (id_interne_aurion) left join q9 using (id_interne_aurion) left join q10 using (id_interne_aurion) left join q11 using (id_interne_aurion)
where true /* and id_interne_aurion= any(('{' || $P{ObjectID_List} || '}')::integer[]) */
group by q2."FACTURATION", q2."Libellé Facturation", q4."Code.Programme", q4."Libellé.Programme", (case when (case when coalesce(cast(q6."UE.Nationalité" as text), '') <> '' then cast('UE' as text) else cast(q6."UE.Nationalité" as text) end) is null or (case when coalesce(cast(q6."UE.Nationalité" as text), '') <> '' then cast('UE' as text) else cast(q6."UE.Nationalité" as text) end)::text = '' then cast('HUE' as text) else (case when coalesce(cast(q6."UE.Nationalité" as text), '') <> '' then cast('UE' as text) else cast(q6."UE.Nationalité" as text) end) end), q5."Libellé.Titre", q5."Nom", q5."Prénom", q5."Date naissance", (coalesce((coalesce((coalesce((coalesce((case when q5."Nom.Ville française" is null or q5."Nom.Ville française"::text = '' then q5."Ville de naissance.Individu" else q5."Nom.Ville française" end), '') || coalesce(cast(' ' as text), '')), '') || coalesce(cast('(' as text), '')), '') || coalesce((case when (substring((case when coalesce(q5."Nom.Ville française", '') <> '' then q5."Code postal

Cordialement

Hors ligne

#2 25/01/2022 08:27:40

rjuju
Administrateur

Re : unterminated quoted identifier at or near ""Code postal "

Bonjour,

Cela serait plus simple avec l'information de position de l'erreur dans la chaine.  Mais apparemment votre requête se termine par :

<> '' then q5."Code postal

Et bien évidemment l'identifiant n'est pas valide, et le CASE n'est pas terminé non plus.  À priori votre applicatif s'arrête au beau milieu de la requête, c'est n'est donc pas un problème avec postgres mais avec votre applicatif.

Hors ligne

#3 02/02/2022 18:08:01

Charle
Membre

Re : unterminated quoted identifier at or near ""Code postal "

Merci beaucoup julien pour les indication.
Je viens de trouver l'origine du probléme grace à tes explication.

Hors ligne

Pied de page des forums