Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to define variables for ROW update with ROWID
On Tue, 30 Oct 2007 20:36:02 -0400, "Dereck L. Dietz"
<dietzdl_at_ameritech.net> wrote:
>Assume there is a table defined roughly as:
>
>TABLE
> column_1
> column_2
> column_3
> column_4
> column_5
>
>I declare a cursor as below including a ROWID for use for later updating.
>
>CURSOR cr_cursor
>IS
> SELECT column_1,
> column_2,
> column_3,
> column_4,
> column_5,
> ROWID
> FROM table;
>
>My question is, how do I define my variables to be able to do an update
>similar to the one below:
>
>UPDATE table
> SET ROW = v_table
> WHERE ROWID = v_rowid;
>
>Other than to define one variable with a record structure of the table AND
>the rowid and two more: a record of the table structure and a rowid record
>what else is possible?
>
If you are OPENing a CURSOR and processing it record by record, and UPDATEing the current record, the CURSOR can be OPENed FOR UPDATE and the UPDATE statement can include a clause WHERE CURRENT OF cr_cursor.
It is explained in "PL/SQL User's Guide and Reference" under "UPDATE Statement".'
B. Received on Wed Oct 31 2007 - 10:05:08 CDT
![]() |
![]() |