Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Need help with "for update" cursor

Need help with "for update" cursor

From: Rui Chambel <REMOVE_THISrchambel_at_netscape.net>
Date: Tue, 14 Sep 1999 18:09:31 +0100
Message-ID: <937332607.325409@orodruin.esoterica.pt>


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;

begin

  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

--



Rui Chambel
- Portugal -
Delphi, C++, VB, Java, SQL, I*net
e-mail: rchambel_at_netscape.net

Make your life simple:
Write your own programs!
Received on Tue Sep 14 1999 - 12:09:31 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US