Bonjour,

J'essaie de faire du pl/sql et je suis un peu débutante, mais j'avais trouvé pas mal de chose intéressante sur les faqs (en passant merci)

Mais je me retrouve à avoir une erreur lorsque je fais la requête suivante :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
SELECT DISTINCT C.COM_FISCAL_YR,
                        (SELECT SUM(D.COM_ITEM_AMOUNT) 
                          FROM COMMIT_ITM_DST D, COMMIT_ITEMS I 
                          WHERE I.ELEMENT_5 = 'cur.REQ_NUM' 
                          AND D.COM_XREF_NUM = I.COM_XREF_NUM 
                          AND D.COM_XREF_ITEM_NUM = I.COM_XREF_ITEM_NUM 
                          AND D.COM_FISCAL_YR = C.COM_FISCAL_YR 
                          AND D.LOCATION = 1) AS COM_AMT
FROM COMMIT_ITM_DST C 
		WHERE COM_FISCAL_YR >= '2002' 
		ORDER BY COM_FISCAL_YR;
Je sais que cette requête fonctionne très bien en sql car je l'ai fait rouler dans TOAD (si vous connaissez)

voici l'erreur engendré par cette requête

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
                        (SELECT SUM(D.COM_ITEM_AMOUNT)
                         *
ERROR at line 26:
ORA-06550: line 26, column 26:
PLS-00103: Encountered the symbol "SELECT" when expecting one of the following:
( - + mod not null others <an identifier>
<a double-quoted delimited-identifier> <a bind variable> avg
count current exists max min prior sql stddev sum variance
execute forall time timestamp interval date
<a string literal with character set specification>
<a number> <a single-quoted SQL string>
ORA-06550: line 32, column 47:
PLS-00103: Encountered the symbol "AS" when expecting one of the following:
; return returning and or
ORA-06550: line 36, column 64:
PLS-00103: Encountered the symbol "AS" when expecting one of the following:
, ; for <an identifier>
<a double-quoted delimited-identifier> group having intersect
minus order start union where connect
ORA-06550: line 45, column 47:
PLS-00103: Encountered the symbol "AS" when expecting one of the following:
, ; for <an identifier>
<a double-quoted delimited-identifier> group having intersect
minus order st
Je sais que c'est une grosse erreur à lire, mais je n'y comprends rien

est-ce que quelqu'un aurait une idée???

Je vous remercie à l'avance
Nadine