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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: HOW TO SELECT LATEST INSERTED ROW..

RE: HOW TO SELECT LATEST INSERTED ROW..

From: Jacques Kilchoer <Jacques.Kilchoer_at_quest.com>
Date: Wed, 21 Feb 2001 21:18:41 -0800
Message-ID: <F001.002B9DCB.20010221103030@fatcity.com>

>-----Original Message-----
>From: Saurabh Sharma [mailto:saurabhs_at_fcsltd.com]
>Sent: mercredi, 21. février 2001 02:15
>
>how can i select the latest inserted row from a table.
>i want to select a col value, perform some operation on it and update
> the same to table via a trigger..
>it says table is mutating.
>i'm inserting rows 1 at a time.

Here is an example of a trigger that sets a date field to be the insert date. Are you trying to do something similar to this?

SQL> create table t (n number, d date) ;

Table created.

SQL> create trigger t_bfi before insert on t for each row

  2  begin
  3    :new.d := sysdate ;
  4  end ;
  5  /


Trigger created.

SQL> insert into t (n) values (1) ;

1 row created.

SQL> select * from t ;

         N D
---------- ---------
         1 21-FEB-01



Jacques R. Kilchoer
(949) 754-8816
Quest Software, Inc.
8001 Irvine Center Drive
Irvine, California 92618
U.S.A.
http://www.quest.com Received on Wed Feb 21 2001 - 23:18:41 CST

Original text of this message

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