Re: Can you determine table from ROWID?

From: Carl Gohringer <cgohring_at_lucifer>
Date: Wed, 2 Nov 1994 12:35:53 GMT
Message-ID: <Cyn4Bu.9Gs_at_nl.oracle.com>


karl_at_trapac.com (Karl Kraft) writes:
: I'm looking for a simple way to determine the table a record is
: in, given the ROWID of the record.
:
: If I can limit the search to a particular group of tables (say 3
: or four), is the ROWID only certain to appear in one table? If
: yes, then I could just select on each table looking for the ROWID.
: Is there a more general way to turn a ROWID into a table name?
:
:
: --
: Karl Kraft
: Karl_Kraft_at_trapac.com
: Karl_Kraft_at_ensuing.com
: [My opinions are my own]

ROWID contains the file number and block number. (check the docco for how ROWID is decomposed) You can then query DBA_EXTENTS to find out what extent that block belongs to. You can then determine what table that extent belongs to.

--
regards,
Carl
+-----------------------------------------------------------------------------+
Carl Gohringer, European Development Centre 
Oracle Park, Bittams Lane, Chertsey, Surrey, England, KT16 9RG
Internet   : cgohring_at_uk.oracle.com    
+-----------------------------------------------------------------------------+
Received on Wed Nov 02 1994 - 13:35:53 CET

Original text of this message