Explian rowid,rownum?what are the psoducolumns we have?

Showing Answers 1 - 26 of 26 Answers

krish

  • Jul 28th, 2006
 

ROWID - Hexa decimal number each and every row having unique.Used in searching

ROWNUM - It is a integer number also unique for sorting Normally TOP N Analysys.

Other Psudo Column are

NEXTVAL,CURRVAL Of sequence are some exampls

askrish@hotmail.com

D. Madhusudhana Rao ( 9885626575)

  • Aug 1st, 2006
 

psoducolumn in the sence which is not created by the user explicitly but user can use those things explicityly.

examples

rowid,rowno,currval,nextval,sysdate,uid,level.

RowID:  While storing in the database oracle generates one id for each row.

you can call based upon the rowid .ex: select * from emp where rowid=....

RowNo : This no is also generated by oracle itself. but you cant call based upon this one in select clause

  Was this answer useful?  Yes

Sphurti

  • Aug 14th, 2006
 

I would like to add one more point here ,

Rowid is permanent for the life time whereas rownum is not. What i mean is till the time the record is present in the table, the value of ROWID of a particular row in a table will always be same whereas the value of ROWNUM will vary.

  Was this answer useful?  Yes

Gyaneshwar VC

  • Sep 4th, 2006
 

Even ROWID is also not permanent for life time.Because If one exports and imports the table data then ROWID changes.

sunflower

  • Feb 22nd, 2007
 

Rowid is a unique identifier, when a row is inserted into the table it generates a row id and will be removed when the row is deleted.

For each row returned by the query a Rownum, pseudocolumn is returned in which order oracle selects the rows from the table. Using rownum one can even limit the number of rows selected from the table.

Ex: select * from emp where rownum<10;

askvenki

  • Jul 19th, 2007
 

rowid is hexadecimal format which is parmently stored with row
rownum while retreivng data oracle attach row num for each row

  Was this answer useful?  Yes

g_sidhu

  • Feb 4th, 2008
 

Row id:  Hexadecimal string representing the unique address of a row in its table. This datatype is primarily for values returned by the ROWID pseudocolumn.

 

Rownum: For each row returned by a query, the ROWNUM pseudocolumn returns a number indicating the order in which Oracle selects the row from a table or set of joined rows. The first row selected has a ROWNUM of 1, the second has 2, and so on. You can use ROWNUM to limit the number of rows returned by a query, as in this example:

 SELECT * FROM employees WHERE ROWNUM < 10;

A pseudocolumn behaves like a table column, but is not actually stored in the table. You can select from pseudocolumns, but you cannot insert, update, or delete their values. This section describes these pseudocolumns:

- CURRVAL and NEXTVAL

- LEVEL

- ROWID

- ROWNUM

johnjerry

  • Oct 9th, 2009
 

My 2 cents:
Rowid contains hexa-decimal number

  • bits 1 to 32 (bytes 1 to 4): data object id (0-4294967295)
  • bits 33 to 44 (byte 5 and half byte 6): file number inside the tablespace (0-4095) - file id
  • bits 45 to 64 (half byte 6 and bytes 7 and 8): block number inside the file (0-1048575) - block id
  • bits 65 to 80 (bytes 9 and 10): row number inside the block (0-65535)

When printed, each field is displayed in radix 64 (A-Za-z0-9+/): OOOOOOFFFBBBBBBRRR

  Was this answer useful?  Yes

Radha

  • Jul 14th, 2011
 

Row ID: Code defined by the database for unique identification of each row. It is 18 alphabetical characters in length.
Row NUM: A sequence number used to retrieve rows from the table.
Some other Pseudo columns are - Level, Rowscn, UID, User, Sysdate.

  Was this answer useful?  Yes

Art11

  • Sep 27th, 2011
 

Pseudocolumn - a column that is not stored in a table, yet behaves like a table column.

ROWID - a global unique address for a row in a database.

ROWNUM
Returns a number indicating the order in which Oracle selects the row from a table or set of joined rows. The first row selected has a ROWNUM of 1, the second has 2, and so on.

If using ORDER BY with ROWNUM then the rows will be reordered by the ORDER BY clause, means the sequence of rows will be different. it is better to use ROW_NUMBER() analytic unction.

Example:
SELECT * FROM emp WHERE ROWNUM < 11 ORDER BY ename;

Fix:
SELECT * FROM (SELECT * FROM emp ORDER BY empno) WHERE ROWNUM < 11;

ROW_NUMBER() analytic function example:
SELECT * FROM ( SELECT deptno, ename, sal ,ROWNUM ,ROW_NUMBER() over (order by sal desc, ename) as rno FROM emp ) --WHERE rno <= 4
/

  Was this answer useful?  Yes

Dilip

  • Sep 3rd, 2012
 

Here I am providing all the psudo columns of Oracle ROWNUM, ROWID,NEXTVAL, CURRVAL, SYSDATE, USER, LEVEL

  Was this answer useful?  Yes

PRADEEP

  • Oct 16th, 2012
 

rowid is octal decimal values it is stored permanently in a oracle database. It will created while creating a table.

rownum is also octal decimal number but it is for only specific time span it will arise after completed a task.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions