Re: Question for you Oracle Guru's -- conversion of SQL to Ora

From: Niall Litchfield <>
Date: Wed, 22 Dec 2004 06:38:59 -0000
Message-ID: <41c91680$0$16583$>

"bagieta" <> wrote in message news:cqa3el$ch0$
> I'm not a Oracle guru, but I use rowid sometimes and can tell you about it
> that what I know.
>> table. I know RowId exists in Oracle but I have forgotten how to use
>> it, i.e. do I have to maintain a sequence in pl/sql to use it?
> No you don't have to use any sequence.
> You can use rowid in query just like identity:
> MSSQL - select _at__at_identity, t.* from table t
> ORACLE - select rowid, t.* from table t
> you can do now something like
> update table
> set
> col1 = :col1,
> col2 = :col2
> where
> rowid = :old_rowid
> Remember that rowid is unique for the given query (it is not like oid in
> postgresql - unique for any table tuple). So when you finish your
> transaction and then call SELECT once again then the rowid value will be
> different.

Not *will* be different. *might* be different. Rowid is effectively a pointer to the physical location of the row. If the row *moves* then its rowid will change, if it doesn't it won't.

sequences are the mechanism for achieving the equivalent of identity (ie a guaranteed unique key).

Niall Litchfield
Oracle DBA
Received on Wed Dec 22 2004 - 07:38:59 CET

Original text of this message