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

Home -> Community -> Usenet -> c.d.o.server -> Re: Get rownum or rowid in insert URGENTT!!!!

Re: Get rownum or rowid in insert URGENTT!!!!

From: David Pomphrey <High.Flight_at_btinternet.com>
Date: Fri, 05 Nov 1999 08:52:50 +0000
Message-ID: <38229AE2.5F34727C@btinternet.com>

From David P, Glasgow, Scotland, UK

Carlos - you probably wouldn'r be able to get the ROWID until you COMMIT 'ed.

Also the ROWNUM is a relative, psuedo-column i.e. its context is one of resultsets from the server only. So you run a SELECT query with 4000 rows in the resultset, and you can refer (with limitations) to a range of ROWNUMs (i.e. WHERE rownum<2500).

Oracle does not let you pick specific tuples such as WHERE ROWNUM=255, but it will let you select the first 254 tuples if you have WHERE rownum<255. (this is one of the limitations of ROWNUM)

Why not create a trigger to post a timestamp (accurate to the second only, of course) during and INSERT?

You can also do the same with triggers on UPDATE if you need a true timestamp for the column

Hope that helps -

David P.


Carlos wrote:

> Hi!
>
> I need something very Urgent!!
> I am making severals inserts in a table, for each one I need to get the
> rowid or rownum . How to do it?
> I tried with a trigger, but it didn't work. Any suggestion?
> I don't know in which moment the client is going to make an insert,
> that's why I need these, to identified that row.
>
> Thanks
> Carlos
Received on Fri Nov 05 1999 - 02:52:50 CST

Original text of this message

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