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 05/10/2011, 12h47   #1
Candidat au titre de Membre du Club
 
Inscription : décembre 2004
Messages : 60
Détails du profil
Informations forums :
Inscription : décembre 2004
Messages : 60
Points : 10
Points : 10
Par défaut Erreurs sur procédure PL/SQL avec fonction case

Bonjour,

J’ai des messages d’erreurs lors de la compilation de ma procedure qui utilise une fonction CASE :

PLS-00220: simple name required in this context

Je cherche à soustraire une monnaie et un montant et à les mettre dans les variables v_spec_div_prov_currency , v_spec_div_in_prov_amount

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
 
BEGIN
   IF is_RIMES 
   THEN
       SELECT vt.currency_code,
              vt.terms,
              vt.event_type
        INTO  v_sec_currency_code,
              v_terms,
              v_event_type,
              CASE vt.event_type
              WHEN 'SPEC_DIV' THEN
                   substr(regexp_substr(vt.terms,'Special [[:upper:]]{3} [[:digit:]]{1}.[[:digit:]]*',1),9,3)
                 ELSE NULL
              END v_spec_div_prov_currency,
              CASE vt.event_type
                 WHEN 'SPEC_DIV' THEN
                   substr(regexp_substr(vt.terms,'Special [[:upper:]]{3} [[:digit:]]{1}.[[:digit:]]*',1),13)
                  ELSE NULL
               END v_spec_div_in_prov_amount 
          FROM VALUATION_TEMP vt
         WHERE vt.termsdate = vt.evaluation_date
           AND vt.STATUS = 'OK' ;        
          --
 
END IF; 
END;
Toutes mes variables v_sec_currency_code, v_terms, v_event_type, v_spec_div_prov_currency , v_spec_div_in_prov_amount sont bien déclarées.

Pourriez-vous SVP m’aider à la corriger ?

Grand merci !
Djene
Djene est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 05/10/2011, 12h55   #2
Membre Expert
 
Inscription : août 2008
Messages : 1 271
Détails du profil
Informations forums :
Inscription : août 2008
Messages : 1 271
Points : 1 929
Points : 1 929
Les CASE doivent être dans le select, pas dans le INTO
Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
SELECT vt.currency_code,
       vt.terms,
       vt.event_type,
       CASE vt.event_type
            WHEN 'SPEC_DIV' THEN 
                 substr(regexp_substr(vt.terms,'Special [[:upper:]]{3} [[:digit:]]{1}.[[:digit:]]*',1),9,3)
            ELSE NULL
       END AS c1,
       CASE vt.event_type
            WHEN 'SPEC_DIV' THEN 
                 substr(regexp_substr(vt.terms,'Special [[:upper:]]{3} [[:digit:]]{1}.[[:digit:]]*',1),13)
            ELSE NULL
       END AS c2
  INTO v_sec_currency_code,
       v_terms,
       v_event_type,
       v_spec_div_prov_currency,
       v_spec_div_in_prov_amount
  FROM VALUATION_TEMP vt
 WHERE vt.termsdate = vt.evaluation_date
   AND vt.STATUS = 'OK' ;
skuatamad est déconnecté   Envoyer un message privé Réponse avec citation 10
Vieux 07/10/2011, 17h19   #3
Candidat au titre de Membre du Club
 
Inscription : décembre 2004
Messages : 60
Détails du profil
Informations forums :
Inscription : décembre 2004
Messages : 60
Points : 10
Points : 10
Par défaut Erreur sur procédure PL/SQL avec fonction CASE

Bonjour,


Grand merci skuatamad !

Djene
Djene est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité Cette discussion est résolue.
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 21h10.


 
 
 
 
Partenaires

Hébergement Web