Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Q: plsql cursor question ?
Isn't it as easy as doing this?
OPEN cursor1;
c1 :=0;
tot := 0;
LOOP
tot := tot + c1;
FETCH cursor1 INTO c1;
EXIT WHEN cursor%NOTFOUND;
END LOOP;
tot :+ c1 * 300 + tot;
tedchyn_at_yahoo.com wrote:
> Sir,
>
> I have a table with following data
>
> c1
> --
> 100
> 200
> 300
> accumulate total tot := c1 + tot
> for last record tot:= c1 * 300 + tot
>
> since I do not know my which is my last record. I have to save the
> number and accumulate total for the previous saved record and
> continuing fetching until %notfound so I can process the last record
> saved.
>
> how do I do that in pl/sql code ?
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Thu Jan 20 2000 - 23:18:28 CST