Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Need help with "for update" cursor
Hi,
I'm new with Oracle and need help on this one.
I need a cursor from one simple table and need to update one row at a time.
I'm using Oracle 8, and keep getting this message "PLS-00413: identifier in CURRENT OF clause is not a cursor name
This is what I did:
TYPE TNomAnu IS REF CURSOR RETURN import_nomanu%ROWTYPE;
nomanu_cursor TNomanu;
nomanu_rec import_nomanu%ROWTYPE;
OPEN nomanu_cursor FOR
SELECT * FROM import_nomanu
WHERE MORADA_PROC IS NULL
FOR UPDATE;
LOOP
/* Fetch from cursor variable. */
FETCH nomanu_cursor INTO nomanu_rec;
EXIT WHEN nomanu_cursor%NOTFOUND; -- exit when last row is fetched
UPDATE import_nomanu
SET MORADA=NEW_MORADA, MORADA_PROC=NEW_MORADA_PROC
WHERE CURRENT OF nomanu_cursor;
END LOOP;
CLOSE nomanu_cursor;
exception
when others then
null;
end;
Can anyone help me?
Many thanks in advance,
Rui Chambel
--
![]() |
![]() |