Re: Another question Regarding ROWID being Safe

From: Randy Dewoolfson <randyd_at_cais3.cais.com>
Date: 1996/10/24
Message-ID: <54mjmm$9n2_at_news2.cais.com>#1/1


Srinivasa Rao Vaikuntam (srini_v_at_ix.netcom.com) wrote:
: In <326C2BF5.C33_at_infosystem.ch> Daniel Klien <klien_at_infosystem.ch>
: writes:
: >
: >Doug Oldmeadow wrote:
: >>
: >> We have been using ROWID as the key condition to apply updates to a
 row
: >> that has been selected for update. The Administrator's concept
 manual
: >> states this is the fastest method to access a particular row. In
 other
: >> words we select our columns plus ROWID, let the user do user stuff,
 then
: >> update where ROWID = fetched ROWID.
: >>
: >> The manual also says that ROWIDs will change when the data is
: >> unloaded/reloaded - ie some event happens that causes the physical
: >> location of the data to change. Recently, someone suggested that we
: >> should not be using ROWID in this way as "it is not safe".
: >>
: >> My question is - Can ROWID change within the scope of a transaction
 ?
: >> Also, if I do not select for update, is the ROWID still guaranteed
 to be
: >> unique, provided I maintain my connection to the database?
: >>
: >> Any input appreciated.
: >>
: >> Doug OHi Doug
: >
: >You must SELECT FOR UPDATE if you want this guarantee.
: >
: >Bye Dan
 

: I retrieve 10 records from the table, and delete 5 of them from the
: table, after checking for some values. Will the ROWID's of the other 5
: change after the delete operation?

The ROWID will STAY THE SAME for each record across all these transactions. That is: there is no danger of mysteriously changing ROWIDs.

What you should NOT DO is save the ROWID in a table for use later. This is where you risk an EXP/IMP or other shuffling of the data that would screw you up.

Randy :)

--
    ..uu.           Randy DeWoolfson          ----------------------
  .?$" '?i     .                              I  randyd_at_cais.com   I
 .T^M  ._at_"    d9    .    .f   ,.un.  t     ,  I--------------------I
 "  Z :#"    M `8   U    <  .dP"``Y# `M   _at_"  I brandall_at_erols.com I
    &H?`    Xl _R   $5.  $  ?*    _at_   'P,#"   I--------------------I
  ,d#^*L   :RP'~$b  f`$L:M  Xf  .f'    dH`    I     ,\//.      X   I
    &  'M ,P    `E  M   "$  Mux~      n!`     I     |o o|          I
   dk   `h"       ' j     " y"       *~       I=oOO==(_)==Ooo======I
Received on Thu Oct 24 1996 - 00:00:00 CEST

Original text of this message