Re: Another question Regarding ROWID being Safe
Date: 1996/10/24
Message-ID: <326F7478.4271_at_cincom.com>#1/1
stu_at_sierra.net@ wrote:
>
> In <326c2aec.94941168_at_dcsun4>, tkyte_at_us.oracle.com (Thomas J. Kyte) writes:
> >On 22 Oct 1996 02:33:11 GMT, srini_v_at_ix.netcom.com(Srinivasa Rao Vaikuntam)
> >wrote: <much deleted>
> >
> >No, a rowid will not change for a row ever.
> >
> >A rowid is assigned when a row is inserted. That rowid will remain with that
> >row forever while that row exists in the database. When that row is deleted,
> >that rowid may be reused by some other, newly inserted record.
> >
> >Thomas Kyte
> >Oracle Government
>
> I must disagree with your advice. The rowid is there is to provide a unique key.
> I don't recommend that it be used for anything else. It will change if the row
> moves for any reason. You should never depend on the physical attributes
> of the database. Also, some gateways may implement ROWID using some means
> other than physical location. That is valid as long as the ROWID is unique.
True, the ROWID is there to provide a unique key, and that key can
change if the rows move. But, I don't see anything wrong with using it
to immediately update a row. At the same time, I think it would be
better to always use the true PRIMARY KEY of the table to update the
database - it seems like the "proper" way to do it. The problem arises
when you have tables that don't have primary keys. I know that in a
perfect relational world, ALL tables should have a primary key, but
sometimes this just isn't practical.
I never thought about the gateways issue, but that makes sense. If you
start moving to distributed databases, and gateways to other databases,
the ROWID idea starts to fall apart. Should you ALWAYS have a primary
key, artificial or real, on every table no matter what the cost, in
order to facilitate easier updating?
Thanks,
Brian
-- Brian M. Biggs mailto:bbiggs_at_cincom.com Cincom Systems, Inc. voice: (513) 677-7661 http://www.cincom.com/Received on Thu Oct 24 1996 - 00:00:00 CEST