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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Updating current row of cursor using OCI

Re: Updating current row of cursor using OCI

From: Chris Halioris <halioris_chris_nonlilly_at_lilly.com>
Date: 1997/02/20
Message-ID: <330CEF87.12B9@lilly.com>#1/1

PaulJ3 wrote:
>
> Is this type of thing possible? Something along the lines of
>
> update table column = value where current of (how do I get this cursor
> name?)
>
> Or really anything that will allow me to update a row without knowing
> particular colunms I want to put after the "where" keyword.
>
> Thanks for any info.

Not sure if the OCI introduces any complexity but in standard PL/SQL you can do this.

CURSOR c IS

   SELECT name
     FROM emp
   FOR UPDATE OF name;

FOR c_rec IN c LOOP

   UPDATE emp

      SET name = name || 'Jr.'
   WHERE CURRENT OF c;
END LOOP; Received on Thu Feb 20 1997 - 00:00:00 CST

Original text of this message

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