Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Updating current row of cursor using OCI
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