Meake
10 pts. | May 28 2009 1:01AM GMT
you might want to declare the C1 before the BEGIN and after the condition you wish to satisfy then write a loop to check for condition…
Depends on what you want to the answers to be like….



DECLARE
BEGIN
FOR C1 IN
(SELECT A.BANK,A.BRANCH,A.MODULE,A.SCHEME,A.ACCOUNTNO,A.ACCOUNTISN,NVL(T.NEXTDUEDATE,:TDATE) NEXTDUEDATE,A.REVIEWDATE
FROM ACCOUNTMASTER A,TERMLOANSDATA T
WHERE A.BANK=:INPBANK AND A.BRANCH=DECODE(:INPBRANCH,'ALL',A.BRANCH,:INPBRANCH)
AND A.MODULE=:INPMODULE AND A.SCHEME=DECODE(:INPSCHEME,'ALL',A.SCHEME,:INPSCHEME)
AND A.ACCOUNTNO=DECODE(:INPACCOUNTNO,'ALL',A.ACCOUNTNO,:INPACCOUNTNO)
AND T.BANK=A.BANK AND T.BRANCH=A.BRANCH AND T.MODULE=A.MODULE AND T.SCHEME=A.SCHEME AND T.ACCOUNTNO=A.ACCOUNTNO
AND T.ACCOUNTISN=A.ACCOUNTISN) LOOP
c1.NEXTDUEDATE:=add_months(c1.NEXTDUEDATE,1)
dbms_output.put_line(c1.BANK||' '||c1.BRANCH||' '||c1.MODULE||' '||c1.SCHEME||' '||c1.ACCOUNTNO||' '||c1.ACCOUNTISN||' '||c1.NEXTDUEDATE||' '||c1.REVIEWDATE);
EXIT WHEN c1.NEXTDUEDATE > c1.REVIEWDATE
end loop;
END;


Meake
10 pts. | May 28 2009 1:01AM GMT
you might want to declare the C1 before the BEGIN and after the condition you wish to satisfy then write a loop to check for condition…
Depends on what you want to the answers to be like….
