HI
Please help me to solve this issue when i am compiling this cursor im getting the form error
Declare
Cursor Cur1 is SELECT slcode,
vendname,
vendtdsperc,
glcode,
Sum(debitamount) - [B]Nvl((SELECT Sum(creditamount)
FROM ledger
WHERE a.unitid = 1
AND a.periodid = 12
AND a.slcode = b.slcode
AND a.glcode = b.glcode
AND Substr(a.documentno,2,3) = '207'),0) derval [/B]
FROM ledger b,
vendmast c
WHERE b.unitid = 1
AND b.periodid = 12
AND Substr(b.documentno,2,3) = '212'
AND b.glcode NOT IN ('61118','61129','61210')
AND b.debitamount <> 0
AND b.slcode = c.vendcode
GROUP BY slcode,
glcode,
vendtdsperc,
vendname;
Begin
Null;
End;
Error follows
Error 103 at line 30 column 72
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
cast < a string literal with character set specification>
<a number><a single-quoted SQL string>
Error 103 at line 36, column 116
Encountered the symbol "," When expecting one of the following:
)intersect minus union
But without the following query , it is compiling successfully
Nvl((SELECT Sum(creditamount)
FROM ledger a
WHERE a.unitid = 1
AND a.periodid = 12
AND a.slcode = b.slcode
AND a.glcode = b.glcode
AND Substr(a.documentno,2,3) = '207'),
0) derval
please help me to solve this issue.
kanish