IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Langage SQL Discussion :

requete SQL XML


Sujet :

Langage SQL

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre averti
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2008
    Messages
    13
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Seine Saint Denis (Île de France)

    Informations professionnelles :
    Activité : Ingénieur développement logiciels

    Informations forums :
    Inscription : Avril 2008
    Messages : 13
    Par défaut requete SQL XML
    bonjour
    je travail sur une BD oracle 10xe
    j'ai besoin de recuperer des donner en xml pour cela j'ai ecris cette requette:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    select XMLElement(name "Compte", 
               XMLAttributes(CPT.typeCompteId as "TypeCompte", Clt.clientId as "CodeClient", CPT.mnemonique as "Mnemonique",
                       Gr.groupeId as "GroupeId", CtrPr.centreProductionId as "ProductionId", CPT.compteId as "NumeroCompte",
                       AgFac.agragationfacturationId as "AgregationfacturationId", TrCtb.tiersComptableId as "TiersComptable", M.marcheId as "MarcheId",
                       Cpst.compensateurId as "CompensateurId"), 
               XMLElement(name "LibelleEdition",CPT.libelleEdition),
               XMLElement(name "LibellePJ",CPT.libellePJ),
               XMLElement(name "MessageAllouant",LT.messageAllouant)).getStringVal() 
     
                       FROM Compte CPT, Client Clt, Groupe Gr, CentreProduction CtrPr, AGFACT AgFac, TiersComptable TrCtb, Marche M, Compensateur Cpst,
                       Entite Ent, Ticket T, LG_STCK LT  
                       where CPT.clientId=Clt.clientId and Ent.EntiteId=Clt.EntiteId and Gr.GroupeId=Ent.GroupeId 
                       and CtrPr.centreProductionId=CPT.centreProductionId and AgFac.compteId=CPT.compteId and CPT.tiersComptableId=TrCtb.tiersComptableId
                       and M.MarcheId=CPT.MarcheId and Cpst.compensateurId=CPT.compensateurId   
                       and LT.ticketId=T.ticketId and T.compteId=CPT.compteId and CPT.compteId='C1' and CPT.mnemonique='edtg'
     
     
     
    le probleme c'est que ce select me retourne  une ligne repeter 9 fois.
    aider moi svp à trouver  la solution pour ne pas avoir de repition dans le resultat.
    voila le resultat de cette requete:
     
    <Compte TypeCompte="TC" CodeClient="Clt1" Mnemonique="edtg" GroupeId="Grp1" ProductionId="CP1" NumeroCompte="C1" AgregationfacturationId="AgrFct1" TiersComptable="TrCptb1" MarcheId="M1" CompensateurId="Cmpst1"><LibelleEdition></LibelleEdition><LibellePJ></LibellePJ><MessageAllouant>cgfhcvvbvb</MessageAllouant></Compte>
    <Compte TypeCompte="TC" CodeClient="Clt1" Mnemonique="edtg" GroupeId="Grp1" ProductionId="CP1" NumeroCompte="C1" AgregationfacturationId="AgrFct1" TiersComptable="TrCptb1" MarcheId="M1" CompensateurId="Cmpst1"><LibelleEdition></LibelleEdition><LibellePJ></LibellePJ><MessageAllouant>cgfhcvvbvb</MessageAllouant></Compte>
    <Compte TypeCompte="TC" CodeClient="Clt1" Mnemonique="edtg" GroupeId="Grp1" ProductionId="CP1" NumeroCompte="C1" AgregationfacturationId="AgrFct1" TiersComptable="TrCptb1" MarcheId="M1" CompensateurId="Cmpst1"><LibelleEdition></LibelleEdition><LibellePJ></LibellePJ><MessageAllouant>cgfhcvvbvb</MessageAllouant></Compte>
    <Compte TypeCompte="TC" CodeClient="Clt1" Mnemonique="edtg" GroupeId="Grp1" ProductionId="CP1" NumeroCompte="C1" AgregationfacturationId="AgrFct1" TiersComptable="TrCptb1" MarcheId="M1" CompensateurId="Cmpst1"><LibelleEdition></LibelleEdition><LibellePJ></LibellePJ><MessageAllouant>cgfhcvvbvb</MessageAllouant></Compte>
    <Compte TypeCompte="TC" CodeClient="Clt1" Mnemonique="edtg" GroupeId="Grp1" ProductionId="CP1" NumeroCompte="C1" AgregationfacturationId="AgrFct1" TiersComptable="TrCptb1" MarcheId="M1" CompensateurId="Cmpst1"><LibelleEdition></LibelleEdition><LibellePJ></LibellePJ><MessageAllouant>cgfhcvvbvb</MessageAllouant></Compte>
    <Compte TypeCompte="TC" CodeClient="Clt1" Mnemonique="edtg" GroupeId="Grp1" ProductionId="CP1" NumeroCompte="C1" AgregationfacturationId="AgrFct1" TiersComptable="TrCptb1" MarcheId="M1" CompensateurId="Cmpst1"><LibelleEdition></LibelleEdition><LibellePJ></LibellePJ><MessageAllouant>cgfhcvvbvb</MessageAllouant></Compte>
    <Compte TypeCompte="TC" CodeClient="Clt1" Mnemonique="edtg" GroupeId="Grp1" ProductionId="CP1" NumeroCompte="C1" AgregationfacturationId="AgrFct1" TiersComptable="TrCptb1" MarcheId="M1" CompensateurId="Cmpst1"><LibelleEdition></LibelleEdition><LibellePJ></LibellePJ><MessageAllouant>cgfhcvvbvb</MessageAllouant></Compte>
    <Compte TypeCompte="TC" CodeClient="Clt1" Mnemonique="edtg" GroupeId="Grp1" ProductionId="CP1" NumeroCompte="C1" AgregationfacturationId="AgrFct1" TiersComptable="TrCptb1" MarcheId="M1" CompensateurId="Cmpst1"><LibelleEdition></LibelleEdition><LibellePJ></LibellePJ><MessageAllouant>cgfhcvvbvb</MessageAllouant></Compte>
    <Compte TypeCompte="TC" CodeClient="Clt1" Mnemonique="edtg" GroupeId="Grp1" ProductionId="CP1" NumeroCompte="C1" AgregationfacturationId="AgrFct1" TiersComptable="TrCptb1" MarcheId="M1" CompensateurId="Cmpst1"><LibelleEdition></LibelleEdition><LibellePJ></LibellePJ><MessageAllouant>cgfhcvvbvb</MessageAllouant></Compte>

  2. #2
    Membre Expert Avatar de Yanika_bzh
    Homme Profil pro
    Responsable Applicatif et R&D
    Inscrit en
    Février 2006
    Messages
    1 144
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Royaume-Uni

    Informations professionnelles :
    Activité : Responsable Applicatif et R&D
    Secteur : Finance

    Informations forums :
    Inscription : Février 2006
    Messages : 1 144
    Par défaut
    Regardez vos jointures, cela sent une jointure incomplete.
    Utilisez des jointures explicites vous aurez moins de difficultés a trouver la relation manquante
    Bon courage

  3. #3
    Membre averti
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2008
    Messages
    13
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Seine Saint Denis (Île de France)

    Informations professionnelles :
    Activité : Ingénieur développement logiciels

    Informations forums :
    Inscription : Avril 2008
    Messages : 13
    Par défaut
    Citation Envoyé par Yanika_bzh Voir le message
    Regardez vos jointures, cela sent une jointure incomplete.
    Utilisez des jointures explicites vous aurez moins de difficultés a trouver la relation manquante
    Bon courage
    je ne vois pas ce que vous voulez dire mais j'ai verifié les jointures sans rien changer . je vous informe que je suis vraiment debutant alors soyez le plus clair possible

  4. #4
    Membre averti
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2008
    Messages
    13
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Seine Saint Denis (Île de France)

    Informations professionnelles :
    Activité : Ingénieur développement logiciels

    Informations forums :
    Inscription : Avril 2008
    Messages : 13
    Par défaut le probleme
    le problème c'est que ce sélect me retourne une ligne répétée 9 fois.
    aider moi svp à trouver la solution pour ne pas avoir de répétition dans le résultat.
    voila le résultat de cette requête:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    <Compte TypeCompte="TC" CodeClient="Clt1" Mnemonique="edtg" GroupeId="Grp1" ProductionId="CP1" NumeroCompte="C1" AgregationfacturationId="AgrFct1" TiersComptable="TrCptb1" MarcheId="M1" CompensateurId="Cmpst1"><LibelleEdition></LibelleEdition><LibellePJ></LibellePJ><MessageAllouant>cgfhcvvbvb</MessageAllouant></Compte>
    <Compte TypeCompte="TC" CodeClient="Clt1" Mnemonique="edtg" GroupeId="Grp1" ProductionId="CP1" NumeroCompte="C1" AgregationfacturationId="AgrFct1" TiersComptable="TrCptb1" MarcheId="M1" CompensateurId="Cmpst1"><LibelleEdition></LibelleEdition><LibellePJ></LibellePJ><MessageAllouant>cgfhcvvbvb</MessageAllouant></Compte>
    <Compte TypeCompte="TC" CodeClient="Clt1" Mnemonique="edtg" GroupeId="Grp1" ProductionId="CP1" NumeroCompte="C1" AgregationfacturationId="AgrFct1" TiersComptable="TrCptb1" MarcheId="M1" CompensateurId="Cmpst1"><LibelleEdition></LibelleEdition><LibellePJ></LibellePJ><MessageAllouant>cgfhcvvbvb</MessageAllouant></Compte>
    <Compte TypeCompte="TC" CodeClient="Clt1" Mnemonique="edtg" GroupeId="Grp1" ProductionId="CP1" NumeroCompte="C1" AgregationfacturationId="AgrFct1" TiersComptable="TrCptb1" MarcheId="M1" CompensateurId="Cmpst1"><LibelleEdition></LibelleEdition><LibellePJ></LibellePJ><MessageAllouant>cgfhcvvbvb</MessageAllouant></Compte>
    <Compte TypeCompte="TC" CodeClient="Clt1" Mnemonique="edtg" GroupeId="Grp1" ProductionId="CP1" NumeroCompte="C1" AgregationfacturationId="AgrFct1" TiersComptable="TrCptb1" MarcheId="M1" CompensateurId="Cmpst1"><LibelleEdition></LibelleEdition><LibellePJ></LibellePJ><MessageAllouant>cgfhcvvbvb</MessageAllouant></Compte>
    <Compte TypeCompte="TC" CodeClient="Clt1" Mnemonique="edtg" GroupeId="Grp1" ProductionId="CP1" NumeroCompte="C1" AgregationfacturationId="AgrFct1" TiersComptable="TrCptb1" MarcheId="M1" CompensateurId="Cmpst1"><LibelleEdition></LibelleEdition><LibellePJ></LibellePJ><MessageAllouant>cgfhcvvbvb</MessageAllouant></Compte>
    <Compte TypeCompte="TC" CodeClient="Clt1" Mnemonique="edtg" GroupeId="Grp1" ProductionId="CP1" NumeroCompte="C1" AgregationfacturationId="AgrFct1" TiersComptable="TrCptb1" MarcheId="M1" CompensateurId="Cmpst1"><LibelleEdition></LibelleEdition><LibellePJ></LibellePJ><MessageAllouant>cgfhcvvbvb</MessageAllouant></Compte>
    <Compte TypeCompte="TC" CodeClient="Clt1" Mnemonique="edtg" GroupeId="Grp1" ProductionId="CP1" NumeroCompte="C1" AgregationfacturationId="AgrFct1" TiersComptable="TrCptb1" MarcheId="M1" CompensateurId="Cmpst1"><LibelleEdition></LibelleEdition><LibellePJ></LibellePJ><MessageAllouant>cgfhcvvbvb</MessageAllouant></Compte>
    <Compte TypeCompte="TC" CodeClient="Clt1" Mnemonique="edtg" GroupeId="Grp1" ProductionId="CP1" NumeroCompte="C1" AgregationfacturationId="AgrFct1" TiersComptable="TrCptb1" MarcheId="M1" CompensateurId="Cmpst1"><LibelleEdition></LibelleEdition><LibellePJ></LibellePJ><MessageAllouant>cgfhcvvbvb</MessageAllouant></Compte>

  5. #5
    Modérateur
    Avatar de Chtulus
    Homme Profil pro
    Ingénieur
    Inscrit en
    Avril 2008
    Messages
    3 094
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 45
    Localisation : France, Rhône (Rhône Alpes)

    Informations professionnelles :
    Activité : Ingénieur
    Secteur : Santé

    Informations forums :
    Inscription : Avril 2008
    Messages : 3 094
    Par défaut
    Bonsoir,

    Soi par le ou par le Enfin je crois !

    « Je ne cherche pas à connaître les réponses, je cherche à comprendre les questions. »
    - Confucius -

    Les meilleurs cours, tutoriels et Docs sur les SGBD et le SQL
    Tous les cours Office
    Solutions d'Entreprise



  6. #6
    Membre Expert Avatar de pacmann
    Homme Profil pro
    Consulté Oracle
    Inscrit en
    Juin 2004
    Messages
    1 626
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 44
    Localisation : France, Bas Rhin (Alsace)

    Informations professionnelles :
    Activité : Consulté Oracle
    Secteur : Distribution

    Informations forums :
    Inscription : Juin 2004
    Messages : 1 626
    Par défaut
    Salut !

    Sans vouloir te vexer Chtulhu :
    - TOP n'est pas dans la norme SQL
    - TOP ne marche pas sur
    Citation Envoyé par mmanas
    je travail sur une BD oracle 10xe
    - C'est un peu barbare, donc j'ai peur de regarder la requête de près, mais j'ai le même pressentiment que Yanika : les doublons, c'est souvent une jointure pas assez précise...


+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Requeter Mysql sans passer par du sql -xml?-
    Par Malone dans le forum Bases de données
    Réponses: 2
    Dernier message: 22/08/2006, 14h02
  2. Requeter Mysql sans passer par du sql -xml?-
    Par Malone dans le forum Delphi
    Réponses: 2
    Dernier message: 22/08/2006, 14h02
  3. [SQL] Sortir une requete en XML
    Par ouquoi dans le forum PHP & Base de données
    Réponses: 5
    Dernier message: 30/05/2006, 15h42
  4. [XML] DTD representant requete SQL
    Par voyageur dans le forum Langage SQL
    Réponses: 2
    Dernier message: 10/05/2006, 11h18
  5. [Design] Requete SQL ou Caching XML ?
    Par brousaille dans le forum ASP.NET
    Réponses: 4
    Dernier message: 05/04/2006, 16h10

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo