Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> PL/SQL do processing on output cursor ?
I create the following Stored Procedure, but it can't compile. I want to
return a cursor
from a "select", but after select, I want to update the fields too. Can I do
it ??
PROCEDURE GetTokenControlList(p_cursor OUT refcur) IS
new_counter NUMBER;
BEGIN
OPEN p_cursor FOR
SELECT TOK_KEY, TOK_COUNTER, TOK_BLOCKSIZE FROM TIF_TOKENCONTROL;
FOR tok_rec in p_cursor LOOP
new_counter := tok_rec.TOK_COUNTER + tok_rec.TOK_BLOCKSIZE;
UPDATE TIF_TOKENCONTROL SET TOK_COUNTER = new_counter
WHERE TOK_KEY = tok_rec.TOK_KEY;
END LOOP;
END GetTokenControlList;
Received on Sun Dec 08 2002 - 07:49:08 CST