Re: Using rowid in a html anchor / select statement

From: Thomas J. Kyte <tkyte_at_us.oracle.com>
Date: 1996/10/01
Message-ID: <32519e00.2351871_at_dcsun4>#1/1


On Tue, 01 Oct 1996 17:07:16 -0400, David J Roth <droth_at_adaptron.com> wrote:

>
>
>ROWID's do change!
>It is true that a ROWID stays the same for a record but...
>...all ROWID's are re-assigned when a table is export w/compress and then imported.
>...If a record is deleted it's ROWID can be reused. This will not happen immediately but will happen
>eventually.
>
>Dave

But rowids don't change.

A rowid can be reused. It cannot be changed. A rowid is like a primary key assigned by the system when the data is inserted. If you exp the data, truncate the table and re-import, the system will assign a primary key to the data. You are not changing a rowid, you are deleting and re-inserting your data.

All rowids are 'reassigned' during exp/imp (even without compress), but this is not changing a rowid.

Perhaps we are arguing semantics here, but the rowid doesn't change, a rowid is a reusable primary key generated by the system used in a large variety of applications (btw: don't exp/imp tables that have fast refresh snapshots defined on them, you'll break the snapshot that way. You wouldn't consider doing an exp/imp while a forms session is open, you'll get 'Data has changed, please requery')

To see an interesting use of rowids and before images or checksum to prevent lost updates via a web application, look at 'optimistic locking on the web' at http://govt.us.oracle.com, tech center, downloadable utilities. It mimicks the locking that Oracle Forms does for you. Instead of writing tons of code every time you build an update form and an update routine, you can get this down to one line of code in the update form and one line of code in the update routine. These routines rely on rowids in the same exact way oracle forms does. If you exp/imp all the data while these routines are in action, you'll get the same message forms would give you 'data has changed, please requery'.

Thomas Kyte
Oracle Government
tkyte_at_us.oracle.com                          

http://govt.us.oracle.com

  • Check out Oracle Governments web site! ----- Follow the link to "Tech Center" and then downloadable Utilities for some free software...

statements and opinions are mine and do not necessarily reflect the opinions of Oracle Corporation Received on Tue Oct 01 1996 - 00:00:00 CEST

Original text of this message