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

PL/SQL Oracle Discussion :

Problème boucle WHILE


Sujet :

PL/SQL Oracle

  1. #1
    Candidat au Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Mai 2011
    Messages
    33
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Portugal

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Mai 2011
    Messages : 33
    Points : 2
    Points
    2
    Par défaut Problème boucle WHILE
    Bonjour, je rencontre un problème sur mon programme car je n'arrive pas a la faire rentrer dans une boucle WHILE

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    nbEnregistrementTableGenerique := SELECT COUNT(*) FROM INT_QFS_DONNEES_REF;
    WHILE nbEnregistrementTableGenerique != NULL && nbEnregistrementTableGenerique > 0 
    LOOP
    ...
    end loop;
    Le message d'erreur est :
    ORA-06550: line 15, column 37:
    PLS-00103: Encountered the symbol "SELECT"
    ORA-06550: line 18, column 3:
    PLS-00103: Encountered the symbol "LOOP"

    Merci pour votre attention.

  2. #2
    Expert éminent sénior Avatar de mnitu
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Octobre 2007
    Messages
    5 611
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Marne (Champagne Ardenne)

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Octobre 2007
    Messages : 5 611
    Points : 11 252
    Points
    11 252
    Par défaut
    Et si vous lisez le tutoriel PL/SQL ?

  3. #3
    Candidat au Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Mai 2011
    Messages
    33
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Portugal

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Mai 2011
    Messages : 33
    Points : 2
    Points
    2
    Par défaut
    Il est bien évident que dans mon programme la syntaxe est respectée...

    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
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    DECLARE
      caract1          number(2)          := NULL;
      caract2          number(2)          := NULL;
      champNum         number(15,6)       :=NULL;
      nbEnregistrement number(10)         := NULL;
      tailleChampPk    number(3)          := NULL;
      chaine1          varchar2(10)       := NULL;
      chaine2          varchar2(10)       := NULL;
      chaine3          varchar2(10)       := NULL;
      nomTable         varchar2(40)       := NULL;
      champPK          varchar2(40)       := NULL;
      champModifier    varchar2(40)       := NULL;
      champCaract      varchar2(160 BYTE) := NULL;
    BEGIN
      nbEnregistrementTableGenerique := SELECT COUNT(*) FROM INT_QFS_DONNEES_REF;
      WHILE nbEnregistrementTableGenerique != NULL && nbEnregistrementTableGenerique > 0 
      LOOP
        nomTable := SELECT tableName FROM INT_QFS_DONNEES_REF WHERE rownum = 1;
     
        champPK := SELECT recordKey FROM INT_QFS_DONNEES_REF WHERE rownum = 1;
     
        caract1    := instr(champPK, '|', 1);
        caract2    := instr(champPK, '|', caract1 + 1);
     
        IF (caract1 > 0) then
          chaine1  := substr(champPK, caract1-1);
        end IF;
     
        tailleChampPk := length(champPK);
     
        IF (caract2    > 0) THEN
          chaine2     := substr(champPK, caract1 + 1, tailleChampPk - caract2 - 1);
          chaine3     := substr(champPK, caract2 + 1, tailleChampPk);
        ELSE
          chaine2 := substr(champPK, caract1 + 1, tailleChampPk);
        end IF;
     
        IF (chaine3 = NULL) THEN
          DELETE FROM nomTable WHERE colonne1 = chaine1 AND colonne2   = chaine2
          AND EXISTS (SELECT 1 FROM INT_QFS_DONNEES_REF WHERE actiontype = 'D' );
            ELSE
          DELETE FROM nomTable WHERE colonne1 = chaine1 AND colonne2   = chaine2
          AND colonne3   = chaine3 AND EXISTS
            (SELECT 1 FROM INT_QFS_DONNEES_REF WHERE actiontype = 'D');
         end IF; 
     
         champModifier :=
        (SELECT fildName FROM INT_QFS_DONNEES_REF WHERE rownum := 1 );  
         champNum :=
        (SELECT FIELDNUMBER FROM INT_QFS_DONNEES_REF WHERE rownum := 1 );
        champCaract :=
        (SELECT FIELDCHARVALUE FROM INT_QFS_DONNEES_REF WHERE rownum := 1);
     
      IF (chaine3 != NULL) THEN
        IF (SELECT fildType FROM INT_QFS_DONNEES_REF) = 'N' THEN
          IF EXISTS (SELECT * FROM nomTable WHERE colonne1 = chaine1 
          AND colonne2 = chaine2) THEN
     
            (UPDATE champModifer SET nomTable WHERE colonne1 = chaine1
            AND colonne2   = chaine2) := champNum;
          ELSE
            INSERT INTO nomTable (colonne1, colonne2, champModifier);
            VALUES               (chaine1, chaine2, champNum);
          end IF
        ELSIF
          (SELECT fildType FROM INT_QFS_DONNEES_REF) = 'C' THEN
          IF EXISTS (SELECT * FROM nomTable WHERE colonne1 = chaine1 
          AND colonne2 = chaine2) THEN
            (UPDATE champModifer SET nomTable WHERE colonne1 = chaine1
              AND colonne2   = chaine2) := champCaract;
          ELSE
            INSERT INTO nomTable(colonne1, colonne2, champModifier);
            VALUES (chaine1, chaine2, champCaract);
     
          end IF;
        end IF
      ELSE
        IF (SELECT fildType FROM INT_QFS_DONNEES_REF) := 'N' THEN
     
          IF EXISTS (SELECT * FROM nomTable  WHERE colonne1 = chaine1
          AND colonne2   = chaine2  AND colonne3   = chaine3) THEN
     
            (UPDATE champModifer SET nomTable WHERE colonne1 = chaine1
              AND colonne2   = chaine2 AND colonne3   = chaine3) := champNum;
          ELSE
            INSERT INTO nomTable (colonne1, colonne2, colonne3, champModifier);
          VALUES (chaine1, chaine2, chaine3, champNum);
          end IF;
        ELSIF
          (SELECT fildType FROM INT_QFS_DONNEES_REF) = 'C' THEN
          IF EXISTS (SELECT * FROM nomTable WHERE colonne1 = chaine1
              AND colonne2   = chaine2 AND colonne3   = chaine3) THEN
     
            (UPDATE champModifer SET nomTable WHERE colonne1 = chaine1
             AND colonne2   = chaine2 AND colonne3   = chaine3) := champCaract; 
          ELSE
            INSERT INTO nomTable (colonne1, colonne2, colonne3, champModifier);          
            VALUES (chaine1, chaine2, chaine3, champCaract);
     
     
          end IF;
        end IF
      end IF;
      DELETE FROM INT_QFS_DONNEES_REF WHERE rownum = 1;
     
      nbEnregistrementTableGenerique := nbEnregistrementTableGenerique - 1;
     end loop;
    END;

  4. #4
    Expert éminent sénior Avatar de mnitu
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Octobre 2007
    Messages
    5 611
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Marne (Champagne Ardenne)

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Octobre 2007
    Messages : 5 611
    Points : 11 252
    Points
    11 252
    Par défaut
    Citation Envoyé par ImO-StOnE Voir le message
    Il est bien évident que dans mon programme la syntaxe est respectée...
    Oui bien sûr. Mais, la question est la syntaxe de quel langage ?

  5. #5
    Candidat au Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Mai 2011
    Messages
    33
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Portugal

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Mai 2011
    Messages : 33
    Points : 2
    Points
    2
    Par défaut
    Je pense et j'espère avoir respecté la syntaxe du langage pl/sql. Mais si vous me le demandez je pense que ça ne doit pas être ça ...

  6. #6
    Membre expérimenté 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
    Points : 1 738
    Points
    1 738
    Par défaut
    Petit indice ici par exemple

    bon courage
    Dans la connaissance du monde, ceux qui ne savent rien en savent toujours autant que ceux qui n'en savent pas plus qu'eux. (Pierre Dac)

  7. #7
    Modérateur
    Avatar de Waldar
    Homme Profil pro
    Customer Success Manager @Vertica
    Inscrit en
    Septembre 2008
    Messages
    8 452
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 46
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Customer Success Manager @Vertica
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Septembre 2008
    Messages : 8 452
    Points : 17 820
    Points
    17 820
    Par défaut
    Vous voyez trop gros, prenez déjà le temps d'assimiler les bases.

    Ce n'est pas très compliqué de constater que votre code est faux :
    Code SQL : 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
    declare
        v$_nb    pls_integer;
    begin
        v$_nb := select count(*) from dual;
    end;
    /
     
    Error at line 1
    ORA-06550: Ligne 4, colonne 14 :
    PLS-00103: Symbole "SELECT" rencontré à la place d'un des symboles suivants :
     
       ( - + case mod new not null <identificateur>
       <identificateur entre guillemets>
       <variable attachée (bind variable)> continue avg count
       current exists max min prior sql stddev sum variance execute
       forall merge time timestamp interval date
       <un littéral de chaîne avec spécification de jeu de caractères>
       <un nombre> <une chaîne SQL entre apostrophes> pipe
       <constante de chaîne é

  8. #8
    Candidat au Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Mai 2011
    Messages
    33
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Portugal

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Mai 2011
    Messages : 33
    Points : 2
    Points
    2
    Par défaut
    ça ne m'aide pas trop de me dire que mon code est faux et de m'afficher le message d'erreur qui s'affiche car si j'ai posté c'est justement parce que je ne comprenais pas ce message.

  9. #9
    Modérateur
    Avatar de Waldar
    Homme Profil pro
    Customer Success Manager @Vertica
    Inscrit en
    Septembre 2008
    Messages
    8 452
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 46
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Customer Success Manager @Vertica
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Septembre 2008
    Messages : 8 452
    Points : 17 820
    Points
    17 820
    Par défaut
    C'est vrai, mais le lien du message juste au-dessus vous amènera sur des exemples directement dans la documentation Oracle.

    Néanmoins ce qui devrait vous aider c'est de procéder par test unitaire.
    Vous avez déjà écrit pas mal de code, ça vous a pris du temps mais comme tout est faux il faut tout recommencer.

    D'où la petite méthode qui devrait vous inciter à tester les choses au fur et à mesure.

  10. #10
    Membre régulier
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Décembre 2006
    Messages
    108
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Décembre 2006
    Messages : 108
    Points : 83
    Points
    83
    Par défaut
    c'est plutot
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    SELECT COUNT(*) INTO nbEnregistrementTableGenerique FROM INT_QFS_DONNEES_REF;
    au lieu de


    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    nbEnregistrementTableGenerique  := SELECT COUNT(*) FROM INT_QFS_DONNEES_REF;
    latrach.net

  11. #11
    Membre régulier
    Inscrit en
    Décembre 2010
    Messages
    211
    Détails du profil
    Informations forums :
    Inscription : Décembre 2010
    Messages : 211
    Points : 102
    Points
    102
    Par défaut
    Citation Envoyé par webfranc Voir le message
    c'est plutôt
    Exactement.

  12. #12
    Candidat au Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Mai 2011
    Messages
    33
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Portugal

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Mai 2011
    Messages : 33
    Points : 2
    Points
    2
    Par défaut
    Je ne comprend pas l'anglais :/ Merci des conseils j'en prends note mais lorsque vous dite :
    Citation Envoyé par Waldar Voir le message
    tout est faux il faut tout recommencer.
    Vous parlez sérieusement ?

  13. #13
    Expert éminent sénior Avatar de mnitu
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Octobre 2007
    Messages
    5 611
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Marne (Champagne Ardenne)

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Octobre 2007
    Messages : 5 611
    Points : 11 252
    Points
    11 252
    Par défaut
    Citation Envoyé par ImO-StOnE Voir le message
    Je ne comprend pas l'anglais ...
    Et si vous lisez le tutoriel PL/SQL ?
    Il est en français.

  14. #14
    Modérateur
    Avatar de Waldar
    Homme Profil pro
    Customer Success Manager @Vertica
    Inscrit en
    Septembre 2008
    Messages
    8 452
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 46
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Customer Success Manager @Vertica
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Septembre 2008
    Messages : 8 452
    Points : 17 820
    Points
    17 820
    Par défaut
    Citation Envoyé par ImO-StOnE Voir le message
    Je ne comprend pas l'anglais :/
    En bas de la page, il y a un exemple, c'est du code, ce sera le même en français ou en anglais !
    Mais vous avez eu la réponse par d'autre membre depuis.

    Citation Envoyé par ImO-StOnE Voir le message
    Vous parlez sérieusement ?
    Oui, il n'y a quasiment rien de correct dans votre code.

  15. #15
    Candidat au Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Mai 2011
    Messages
    33
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Portugal

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Mai 2011
    Messages : 33
    Points : 2
    Points
    2
    Par défaut
    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
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    DECLARE
      caract1          number(2)          := NULL;
      caract2          number(2)          := NULL;
      champNum         number(15,6)       :=NULL;
      nbEnregistrement number(10)         := NULL;
      tailleChampPk    number(3)          := NULL;
      chaine1          varchar2(10)       := NULL;
      chaine2          varchar2(10)       := NULL;
      chaine3          varchar2(10)       := NULL;
      nomTable         varchar2(40)       := NULL;
      champPK          varchar2(40)       := NULL;
      champModifier    varchar2(40)       := NULL;
      champCaract      varchar2(160 BYTE) := NULL;
    BEGIN
      SELECT COUNT(*) INTO nbEnregistrementTableGenerique FROM INT_QFS_DONNEES_REF;
      WHILE nbEnregistrementTableGenerique != NULL && nbEnregistrementTableGenerique > 0 
      LOOP
        SELECT tableName INTO nomTable FROM INT_QFS_DONNEES_REF WHERE rownum = 1;
        SELECT recordKey INTO champPK FROM INT_QFS_DONNEES_REF WHERE rownum = 1;
     
        caract1    := instr(champPK, '|', 1);
        caract2    := instr(champPK, '|', caract1 + 1);
     
        IF (caract1 > 0) then
          chaine1  := substr(champPK, caract1-1);
        end IF;
     
        tailleChampPk := length(champPK);
     
        IF (caract2    > 0) THEN
          chaine2     := substr(champPK, caract1 + 1, tailleChampPk - caract2 - 1);
          chaine3     := substr(champPK, caract2 + 1, tailleChampPk);
        ELSE
          chaine2 := substr(champPK, caract1 + 1, tailleChampPk);
        end IF;
     
        IF (chaine3 = NULL) THEN
          DELETE FROM nomTable WHERE colonne1 = chaine1 AND colonne2   = chaine2
          AND EXISTS (SELECT 1 FROM INT_QFS_DONNEES_REF WHERE actiontype = 'D' );
            ELSE
          DELETE FROM nomTable WHERE colonne1 = chaine1 AND colonne2   = chaine2
          AND colonne3   = chaine3 AND EXISTS
            (SELECT 1 FROM INT_QFS_DONNEES_REF WHERE actiontype = 'D');
         end IF; 
     
     
        SELECT fildName INTO champModifier FROM INT_QFS_DONNEES_REF WHERE rownum := 1;  
        SELECT FIELDNUMBER INTO champNum FROM INT_QFS_DONNEES_REF WHERE rownum := 1 ;
        SELECT FIELDCHARVALUE INTO champCaract FROM INT_QFS_DONNEES_REF WHERE rownum := 1;
     
      IF (chaine3 != NULL) THEN
        IF (SELECT fildType FROM INT_QFS_DONNEES_REF) = 'N' THEN
          IF EXISTS (SELECT * FROM nomTable WHERE colonne1 = chaine1 
          AND colonne2 = chaine2) THEN
     
            UPDATE champModifer SET nomTable = champNum WHERE colonne1 = chaine1
            AND colonne2   = chaine2;
          ELSE
            INSERT INTO nomTable (colonne1, colonne2, champModifier);
            VALUES               (chaine1, chaine2, champNum);
          end IF
        ELSIF
          (SELECT fildType FROM INT_QFS_DONNEES_REF) = 'C' THEN
          IF EXISTS (SELECT * FROM nomTable WHERE colonne1 = chaine1 
          AND colonne2 = chaine2) THEN
            UPDATE champModifer SET nomTable = champCaract WHERE colonne1 = chaine1
              AND colonne2   = chaine2;
          ELSE
            INSERT INTO nomTable(colonne1, colonne2, champModifier);
            VALUES (chaine1, chaine2, champCaract);
     
          end IF;
        end IF
      ELSE
        IF (SELECT fildType FROM INT_QFS_DONNEES_REF) := 'N' THEN
     
          IF EXISTS (SELECT * FROM nomTable  WHERE colonne1 = chaine1
          AND colonne2   = chaine2  AND colonne3   = chaine3) THEN
     
            UPDATE champModifer SET nomTable = champNum WHERE colonne1 = chaine1
              AND colonne2   = chaine2 AND colonne3   = chaine3;
          ELSE
            INSERT INTO nomTable (colonne1, colonne2, colonne3, champModifier);
            VALUES (chaine1, chaine2, chaine3, champNum);
          end IF;
        ELSIF
          SELECT fildType FROM INT_QFS_DONNEES_REF = 'C' THEN
          IF EXISTS (SELECT * FROM nomTable WHERE colonne1 = chaine1
              AND colonne2   = chaine2 AND colonne3   = chaine3) THEN
     
            UPDATE champModifer SET nomTable = champCaract WHERE colonne1 = chaine1
             AND colonne2   = chaine2 AND colonne3   = chaine3;
          ELSE
            INSERT INTO nomTable (colonne1, colonne2, colonne3, champModifier);          
            VALUES (chaine1, chaine2, chaine3, champCaract);
     
     
          end IF;
        end IF
      end IF;
      DELETE FROM INT_QFS_DONNEES_REF WHERE rownum = 1;
     
      nbEnregistrementTableGenerique := nbEnregistrementTableGenerique - 1;
     end loop;
    END;
    Vous parait-il plus juste ?

  16. #16
    Membre régulier
    Inscrit en
    Décembre 2010
    Messages
    211
    Détails du profil
    Informations forums :
    Inscription : Décembre 2010
    Messages : 211
    Points : 102
    Points
    102
    Par défaut
    Et bien c'est à toi de nous dire si cela ne génère aucune erreur!!

  17. #17
    Candidat au Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Mai 2011
    Messages
    33
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Portugal

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Mai 2011
    Messages : 33
    Points : 2
    Points
    2
    Par défaut
    Voici les erreurs qu'il me génère :
    ORA-06550: line 16, column 48:
    PLS-00103: Encountered the symbol "6" when expecting one of the following:
    
    ORA-06550: line 47, column 78:
    PLS-00103: Encountered the symbol "=" when expecting one of the following:
    ORA-06550: line 48, column 78:
    PLS-00103: Encountered the symbol "=" when expecting one of the following:
    ORA-06550: line 49, column 78:
    PLS-00103: Encountered the symbol "=" when expecting one of the following:
    
    ORA-06550: line 52, column 8:
    PLS-00103: Encountered the symbol "SELECT" when expecting one of the following:
    ORA-06550: line 52, column 49:
    PLS-00103: Encountered the symbol "=" when expecting one of the following:

  18. #18
    Membre régulier
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Décembre 2006
    Messages
    108
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Décembre 2006
    Messages : 108
    Points : 83
    Points
    83
    Par défaut
    ce message d'erreur est généré après la modification de la requête?
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    SELECT COUNT(*) INTO nbEnregistrementTableGenerique FROM...
    il nous faut la dernière version du code qui génère cette erreur
    latrach.net

  19. #19
    Candidat au Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Mai 2011
    Messages
    33
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Portugal

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Mai 2011
    Messages : 33
    Points : 2
    Points
    2
    Par défaut
    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
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    DECLARE
      caract1          number(2)          := NULL;
      caract2          number(2)          := NULL;
      champNum         number(15,6)       :=NULL;
      nbEnregistrement number(10)         := NULL;
      tailleChampPk    number(3)          := NULL;
      chaine1          varchar2(10)       := NULL;
      chaine2          varchar2(10)       := NULL;
      chaine3          varchar2(10)       := NULL;
      nomTable         varchar2(40)       := NULL;
      champPK          varchar2(40)       := NULL;
      champModifier    varchar2(40)       := NULL;
      champCaract      varchar2(160 BYTE) := NULL;
    BEGIN
      SELECT COUNT(*) INTO nbEnregistrementTableGenerique FROM INT_QFS_DONNEES_REF;
      WHILE nbEnregistrementTableGenerique != NULL && nbEnregistrementTableGenerique > '0'
      LOOP
        SELECT tableName INTO nomTable FROM INT_QFS_DONNEES_REF WHERE rownum = 1;
        SELECT recordKey INTO champPK FROM INT_QFS_DONNEES_REF WHERE rownum = 1;
     
        caract1    := instr(champPK, '|', 1);
        caract2    := instr(champPK, '|', caract1 + 1);
     
        IF (caract1 > 0) then
          chaine1  := substr(champPK, caract1-1);
        end IF;
     
        tailleChampPk := length(champPK);
     
        IF (caract2    > 0) THEN
          chaine2     := substr(champPK, caract1 + 1, tailleChampPk - caract2 - 1);
          chaine3     := substr(champPK, caract2 + 1, tailleChampPk);
        ELSE
          chaine2 := substr(champPK, caract1 + 1, tailleChampPk);
        end IF;
     
        IF (chaine3 = NULL) THEN
          DELETE FROM nomTable WHERE colonne1 = chaine1 AND colonne2   = chaine2
          AND EXISTS (SELECT 1 FROM INT_QFS_DONNEES_REF WHERE actiontype = 'D' );
            ELSE
          DELETE FROM nomTable WHERE colonne1 = chaine1 AND colonne2   = chaine2
          AND colonne3   = chaine3 AND EXISTS
            (SELECT 1 FROM INT_QFS_DONNEES_REF WHERE actiontype = 'D');
         end IF; 
     
     
        SELECT fildName INTO champModifier FROM INT_QFS_DONNEES_REF WHERE rownum = 1;  
        SELECT FIELDNUMBER INTO champNum FROM INT_QFS_DONNEES_REF WHERE rownum = 1 ;
        SELECT FIELDCHARVALUE INTO champCaract FROM INT_QFS_DONNEES_REF WHERE rownum = 1;
     
      IF (chaine3 != NULL) THEN
        IF SELECT fildType FROM INT_QFS_DONNEES_REF WHERE rownum =1 = 'N' THEN
          IF EXISTS (SELECT * FROM nomTable WHERE colonne1 = chaine1 
          AND colonne2 = chaine2) THEN
     
            UPDATE champModifer SET nomTable = champNum WHERE colonne1 = chaine1
            AND colonne2   = chaine2;
          ELSE
            INSERT INTO nomTable (colonne1, colonne2, champModifier)
            VALUES (chaine1, chaine2, champNum);
          end IF
        ELSE
          IF (SELECT fildType FROM INT_QFS_DONNEES_REF WHERE rownum = 1) = 'C' THEN
          IF EXISTS (SELECT * FROM nomTable WHERE colonne1 = chaine1 
          AND colonne2 = chaine2) THEN
            UPDATE champModifer SET nomTable = champCaract WHERE colonne1 = chaine1
              AND colonne2   = chaine2;
          ELSE
            INSERT INTO nomTable(colonne1, colonne2, champModifier)
            VALUES (chaine1, chaine2, champCaract);
     
          end IF;
        end IF
      ELSE
        IF (SELECT fildType FROM INT_QFS_DONNEES_REF) = 'N' THEN
     
          IF EXISTS (SELECT * FROM nomTable  WHERE colonne1 = chaine1
          AND colonne2   = chaine2  AND colonne3   = chaine3) THEN
     
            UPDATE champModifer SET nomTable = champNum WHERE colonne1 = chaine1
              AND colonne2   = chaine2 AND colonne3   = chaine3;
          ELSE
            INSERT INTO nomTable (colonne1, colonne2, colonne3, champModifier);
            VALUES (chaine1, chaine2, chaine3, champNum);
          end IF;
        ELSIF
          SELECT fildType FROM INT_QFS_DONNEES_REF = 'C' THEN
          IF EXISTS (SELECT * FROM nomTable WHERE colonne1 = chaine1
              AND colonne2   = chaine2 AND colonne3   = chaine3) THEN
     
            UPDATE champModifer SET nomTable = champCaract WHERE colonne1 = chaine1
             AND colonne2   = chaine2 AND colonne3   = chaine3;
          ELSE
            INSERT INTO nomTable (colonne1, colonne2, colonne3, champModifier);          
            VALUES (chaine1, chaine2, chaine3, champCaract);
     
     
          end IF;
        end IF
      end IF;
      DELETE FROM INT_QFS_DONNEES_REF WHERE rownum = 1;  
      nbEnregistrementTableGenerique := nbEnregistrementTableGenerique - 1;
     end loop;
    END;
    voila le code

  20. #20
    Candidat au Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Mai 2011
    Messages
    33
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Portugal

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Mai 2011
    Messages : 33
    Points : 2
    Points
    2
    Par défaut
    Rapport d'erreur :
    ORA-06550: line 16, column 48:
    PLS-00103: Encountered the symbol "6" when expecting one of the following:
    
       * & - + / at loop mod remainder rem <exposant (**)> and or ||
       multiset
    The symbol "and" was substituted for "6" to continue.
    ORA-06550: line 52, column 8:
    PLS-00103: Encountered the symbol "SELECT" when expecting one of the following:
    
       ( - + case mod new not null <identificateur>
       <identificateur entre guillemets> <variable bind> avg count
       current exists max min prior sql stddev sum
    ORA-06550: line 52, column 65:
    PLS-00103: Encountered the symbol "=" when expecting one of the following:
    
       * & - + ; / at for mod remainder rem <exposant (**)> and or
       group having intersect minus order start union where connect
       || multiset
    06550. 00000 -  "line %s, column %s:\n%s"
    *Cause:    Usually a PL/SQL compilation error.
    *Action:
    et voila les erreurs.

Discussions similaires

  1. Problème boucle while
    Par Peedro dans le forum Langage
    Réponses: 4
    Dernier message: 07/10/2008, 14h09
  2. Problème boucle while
    Par chuko dans le forum C
    Réponses: 7
    Dernier message: 04/07/2008, 16h12
  3. Problème boucle while
    Par fred33 dans le forum Langage
    Réponses: 2
    Dernier message: 23/05/2008, 19h16
  4. [MySQL] Problème boucle WHILE
    Par Adlack dans le forum PHP & Base de données
    Réponses: 2
    Dernier message: 26/02/2007, 19h30
  5. Problème boucle while et evenement
    Par tse_tilky_moje_imja dans le forum Général Python
    Réponses: 2
    Dernier message: 30/03/2006, 18h11

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