Re: Using rowid in a html anchor / select statement

From: Thomas J. Kyte <tkyte_at_us.oracle.com>
Date: 1996/09/30
Message-ID: <324fe2e7.5421665_at_dcsun4>#1/1


On Sat, 28 Sep 1996 22:51:01 -0500, Brian Martin <icbkr_at_ix.netcom.com> wrote:

>Bill Tierney wrote:
>>
>> to the full record whicj I'm hoping to retrieve
>> using rowid....
>> -----------------------------------------------------------------
>> 40/3 PL/SQL: Statement ignored
>> 42/53 PLS-00204: function or pseudo-column 'ROWID' may be used inside
>>
>> Does anyone have any suggestions...??
>
>yes. use a key value instead of rowid. it's not a good thing to
>choose for implementation in a state-dependent situation like
>a webserver. things could change before the www user sends the
>updates or whatever. rowid is a fluid value, not a constant
>like a key.

Alias the rowid in the query (eg: select rowid rid, a.* from TableName a where .... ) and reference rid. I have seen pl/sql get a little confused about the context of rowid in some statements. Using the alias always gets around this.

As for rowid being fluid - ****the rowid of a row will never change**** unless the row is deleted and re-inserted. Oracle basic replication counts on rowid. Oracle Forms counts on rowid. The rowid of a row is a value that will not change. The only way a rowid will change is if you physically delete and then reinsert the row (but then it is not the same row anymore anyway).

Even if the row migrates cause it doesn't fit, the rowid will stay the same. The rowid is even more constant then a key. You can update a key, you can't update a rowid.

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 Mon Sep 30 1996 - 00:00:00 CEST

Original text of this message