Home » RDBMS Server » Server Utilities » How can i convert Rowid..
How can i convert Rowid.. [message #72442] Tue, 17 June 2003 22:47 Go to next message
Haneef
Messages: 7
Registered: June 2003
Junior Member
What is the difference between extended Rowd-Id and Restricted RowdId...
And
how can i convert any rowid into decimal no.
Through which Views i can check Block No. and Row No. and Data object also

Extended Rowid format is
OOOOOO(Data Object No.) This is 32 bit.
FFF(Relative file no) This is 10 Bit.
BBBBBB( Block Number)This is 22 bit.
RRR(Row No.)This is 10bit.
What is the difference between these bit's.
If any body have any URL related to rowid please send it to me.
Re: How can i convert Rowid.. [message #72448 is a reply to message #72442] Wed, 18 June 2003 06:57 Go to previous message
Mahesh Rajendran
Messages: 10708
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
Membership Count:5 PL/SQL Rowid 
Fixed-length binary. 
Pseudocolumn of a table. 
A DESCRIBE or SELECT * FROM MY_TABLE will not show the rowid; 
a SELECT rowid FROM MY_TABLE will show the hashed location. 
Fastest possible access to a given row 
Rowids do not change as long as the record exists. 
Rowids can not be changed during an insert or update transaction. 
Rowids can only be used to return a record. 
Rowids will change when EXPORTED or IMPORTED 
Extended Rowids use a base 64 encoding of the physical address for each row selected 
 

Rowid Structure

	BBBBBBBB.RRRR.FFFF

	BBBBBBBB=Block
	RRRR=Row within the Block
	FFFF=File Number

Extended Rowid Structure

   select rowid 
	,substr(rowid,1,6) "OBJECT"
	,substr(rowid,7,3) "FILE"
	,substr(rowid,10,6) "BLOCK"
	,substr(rowid,16,3) "ROW"
	from myTable;

INSTANCE_ID        OBJECT FIL BLOCK  ROW
------------------ ------ --- ------ ---
AAABUeAAQAAACsjAAg AAABUe AAQ AAACsj AAg

Oracle Functions to apply to a Rowid 

ROWIDTOCHAR(rowid)   converts a rowid into a string.

CHARTOROWID('rowid_string') converts a string into a rowid

Querying a record by rowid

	select rowidtochar(rowid) as id from my_table
	where rowid=chartorowid('AAABUeAAQAAACsjAAg')

 

Previous Topic: Not able to export Pls help!
Next Topic: Urgent! nt server to solaris server oracle import
Goto Forum:
  


Current Time: Thu Nov 07 22:30:59 CST 2024