Précédent   Forum des professionnels en informatique > Bases de données > Oracle > PL/SQL
PL/SQL Forum d'entraide sur le PL/SQL
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 26/05/2011, 10h40   #1
 
Homme
Étudiant
Inscription : 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 :
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.
kouette est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 26/05/2011, 10h51   #2
Expert Confirmé Sénior
 
Avatar de mnitu
 
Homme Marius Nitu
Ingénieur développement logiciels
Inscription : octobre 2007
Messages : 3 311
Détails du profil
Informations personnelles :
Nom : Homme Marius Nitu
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 : 3 311
Points : 5 808
Points : 5 808
Et si vous lisez le tutoriel PL/SQL ?
mnitu est déconnecté   Envoyer un message privé Réponse avec citation 01
Vieux 26/05/2011, 10h57   #3
 
Homme
Étudiant
Inscription : 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
Il est bien évident que dans mon programme la syntaxe est respectée...

Code :
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;
kouette est déconnecté   Envoyer un message privé Réponse avec citation 01
Vieux 26/05/2011, 11h15   #4
Expert Confirmé Sénior
 
Avatar de mnitu
 
Homme Marius Nitu
Ingénieur développement logiciels
Inscription : octobre 2007
Messages : 3 311
Détails du profil
Informations personnelles :
Nom : Homme Marius Nitu
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 : 3 311
Points : 5 808
Points : 5 808
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 ?
mnitu est déconnecté   Envoyer un message privé Réponse avec citation 10
Vieux 26/05/2011, 11h20   #5
 
Homme
Étudiant
Inscription : 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
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 ...
kouette est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 26/05/2011, 11h24   #6
Membre Expert
 
Avatar de Yanika_bzh
 
Homme Yannick
Ingénieur Etudes & Developpements
Inscription : février 2006
Messages : 1 125
Détails du profil
Informations personnelles :
Nom : Homme Yannick
Localisation : France, Deux Sèvres (Poitou Charente)

Informations professionnelles :
Activité : Ingénieur Etudes & Developpements
Secteur : High Tech - Éditeur de logiciels

Informations forums :
Inscription : février 2006
Messages : 1 125
Points : 1 670
Points : 1 670
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)
Yanika_bzh est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 26/05/2011, 11h42   #7
Modérateur
 
Homme Fabien
Ingénieur d'études en décisionnel
Inscription : septembre 2008
Messages : 5 684
Détails du profil
Informations personnelles :
Nom : Homme Fabien
Âge : 34
Localisation : France, Yvelines (Île de France)

Informations professionnelles :
Activité : Ingénieur d'études en décisionnel
Secteur : Arts - Culture

Informations forums :
Inscription : septembre 2008
Messages : 5 684
Points : 10 434
Points : 10 434
Envoyer un message via ICQ à Waldar Envoyer un message via Skype™ à Waldar
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 :
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 é
__________________
Email : http://scr.im/waldar
Waldar est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 26/05/2011, 11h47   #8
 
Homme
Étudiant
Inscription : 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
ç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.
kouette est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 26/05/2011, 11h52   #9
Modérateur
 
Homme Fabien
Ingénieur d'études en décisionnel
Inscription : septembre 2008
Messages : 5 684
Détails du profil
Informations personnelles :
Nom : Homme Fabien
Âge : 34
Localisation : France, Yvelines (Île de France)

Informations professionnelles :
Activité : Ingénieur d'études en décisionnel
Secteur : Arts - Culture

Informations forums :
Inscription : septembre 2008
Messages : 5 684
Points : 10 434
Points : 10 434
Envoyer un message via ICQ à Waldar Envoyer un message via Skype™ à Waldar
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.
__________________
Email : http://scr.im/waldar
Waldar est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 26/05/2011, 11h53   #10
Membre du Club
 
Homme
Développeur informatique
Inscription : décembre 2006
Messages : 104
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : France

Informations professionnelles :
Activité : Développeur informatique

Informations forums :
Inscription : décembre 2006
Messages : 104
Points : 49
Points : 49
c'est plutot
Code :
SELECT COUNT(*) INTO nbEnregistrementTableGenerique FROM INT_QFS_DONNEES_REF;
au lieu de


Code :
nbEnregistrementTableGenerique  := SELECT COUNT(*) FROM INT_QFS_DONNEES_REF;
webfranc est déconnecté   Envoyer un message privé Réponse avec citation 10
Vieux 26/05/2011, 11h55   #11
Membre du Club
 
Inscription : décembre 2010
Messages : 190
Détails du profil
Informations forums :
Inscription : décembre 2010
Messages : 190
Points : 60
Points : 60
Citation:
Envoyé par webfranc Voir le message
c'est plutôt
Exactement.
AbouZaid est déconnecté   Envoyer un message privé Réponse avec citation 01
Vieux 26/05/2011, 12h00   #12
 
Homme
Étudiant
Inscription : 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
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 ?
kouette est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 26/05/2011, 12h07   #13
Expert Confirmé Sénior
 
Avatar de mnitu
 
Homme Marius Nitu
Ingénieur développement logiciels
Inscription : octobre 2007
Messages : 3 311
Détails du profil
Informations personnelles :
Nom : Homme Marius Nitu
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 : 3 311
Points : 5 808
Points : 5 808
Citation:
Envoyé par ImO-StOnE Voir le message
Je ne comprend pas l'anglais ...
Citation:
Et si vous lisez le tutoriel PL/SQL ?
Il est en français.
mnitu est déconnecté   Envoyer un message privé Réponse avec citation 01
Vieux 26/05/2011, 12h18   #14
Modérateur
 
Homme Fabien
Ingénieur d'études en décisionnel
Inscription : septembre 2008
Messages : 5 684
Détails du profil
Informations personnelles :
Nom : Homme Fabien
Âge : 34
Localisation : France, Yvelines (Île de France)

Informations professionnelles :
Activité : Ingénieur d'études en décisionnel
Secteur : Arts - Culture

Informations forums :
Inscription : septembre 2008
Messages : 5 684
Points : 10 434
Points : 10 434
Envoyer un message via ICQ à Waldar Envoyer un message via Skype™ à Waldar
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.
__________________
Email : http://scr.im/waldar
Waldar est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 26/05/2011, 12h32   #15
 
Homme
Étudiant
Inscription : 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
Code :
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 ?
kouette est déconnecté   Envoyer un message privé Réponse avec citation 02
Vieux 26/05/2011, 12h48   #16
Membre du Club
 
Inscription : décembre 2010
Messages : 190
Détails du profil
Informations forums :
Inscription : décembre 2010
Messages : 190
Points : 60
Points : 60
Et bien c'est à toi de nous dire si cela ne génère aucune erreur!!
AbouZaid est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 26/05/2011, 13h32   #17
 
Homme
Étudiant
Inscription : 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
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:
kouette est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 26/05/2011, 13h59   #18
Membre du Club
 
Homme
Développeur informatique
Inscription : décembre 2006
Messages : 104
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : France

Informations professionnelles :
Activité : Développeur informatique

Informations forums :
Inscription : décembre 2006
Messages : 104
Points : 49
Points : 49
ce message d'erreur est généré après la modification de la requête?
Code :
SELECT COUNT(*) INTO nbEnregistrementTableGenerique FROM...
il nous faut la dernière version du code qui génère cette erreur
webfranc est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 26/05/2011, 14h27   #19
 
Homme
Étudiant
Inscription : 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
Code :
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
kouette est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 26/05/2011, 14h28   #20
 
Homme
Étudiant
Inscription : 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
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.
kouette est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 16h41.


 
 
 
 
Partenaires

Hébergement Web