Re: Question for you Oracle Guru's -- conversion of SQL to Ora
Date: Wed, 22 Dec 2004 06:38:59 -0000
"bagieta" <bagieta21_at_poczta.onet.pl> wrote in message
> 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
> col1 = :col1,
> col2 = :col2
> 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
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. http://download-west.oracle.com/docs/cd/B14117_01/server.101/b10743/datatype.htm#sthref3893
sequences are the mechanism for achieving the equivalent of identity (ie a guaranteed unique key).
-- Niall Litchfield Oracle DBA http://www.niall.litchfield.dial.pipex.comReceived on Wed Dec 22 2004 - 07:38:59 CET