Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: last row inserted in the table

Re: last row inserted in the table

From: <jan.stulrajter_at_zoznam.sk>
Date: 16 Apr 2007 08:13:01 -0700
Message-ID: <1176736381.676730.269500@o5g2000hsb.googlegroups.com>


In 10g, you can specify ROWDEPENDENCIES for a table. In that case, the SCN is stored at a row level. You can then easy get the latest inserted rows.

If you don`t specify ROWDEPENDENCIES, the SCN is stored at the block level, so all the rows in one block will have the same SCN.

So in 10g, you can get the last inserted rows as following (with precision based on the above explanation):

SELECT * FROM t ORDER BY ORA_ROWSCN DESC;

Jan

Mariano napísal(a):
> How can I know what is the last row inserted in a table??? I have an
> ID column that is auto-incremented by the default auto-increment
> trigger.
>
> Can I be sure that MAX id number is the last row inserted?
Received on Mon Apr 16 2007 - 10:13:01 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US