Re: How to define variables for ROW update with ROWID



On Oct 30, 8:36 pm, "Dereck L. Dietz" <diet...@xxxxxxxxxxxxx> 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?

One recommendation is to consider instead of retrieving row values via
a cursor then updating individual rows ... is to just issue the update
statement with an appropriate where clause.

You can probably force something awkward using collections and bulk
collect but do you really want to proceed like that?

.



Relevant Pages

  • Re: How to define variables for ROW update with ROWID
    ... I declare a cursor as below including a ROWID for use for later updating. ... TYPE PartNum IS TABLE OF parent.part_num%TYPE ... TYPE PartName IS TABLE OF parent.part_name%TYPE ...
    (comp.databases.oracle.server)
  • Re: Very strange problem.
    ... Can I use "for update" in the declaration of a cursor? ... When I commit records after delete 3000 rows, ... > My Oracle is 8.1.7, I delete records according to rowid, It work for me. ... >> Giridhar Kodakalla ...
    (comp.databases.oracle.server)
  • How to define variables for ROW update with ROWID
    ... I declare a cursor as below including a ROWID for use for later updating. ... Other than to define one variable with a record structure of the table AND ...
    (comp.databases.oracle.server)
  • Getting ROWID back in all caps
    ... I am writing an sp that uses a cursor to get the rowid and ... it passes as upper case. ... Is there a way to get the cursor to preserve ...
    (comp.databases.oracle.misc)