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

Home -> Community -> Usenet -> c.d.o.tools -> Re: selecting last inserted record in table

Re: selecting last inserted record in table

From: Barbara Kennedy <barbken_at_teleport.com>
Date: Fri, 8 Dec 2000 18:08:51 -0800
Message-ID: <8ugY5.742$JE.105715@nntp3.onemain.com>

Still not sure why, but maybe this will help. You can access the values that are going to be inserted, or changed in a trigger. (see :new and :old and the documentation on create trigger). This might make it easier since you will know what the values are at time of insert and can use them elsewhere. A trigger could update another table for example. Does this help any?
Jim
<faheemrao_at_my-deja.com> wrote in message news:90r5td$qdu$1_at_nnrp1.deja.com...
>
>
>
> Actually my problem is that I have converted a large schema form a
> database named called cache. Now I should give abrief backgroud of
> cache that Cache is an object orientd database and it have stucture
> like clasees in C++ and Java that aa table can have superclass(super
> table ) now when that specific table is to be updated then ist all
> upper parent tables are also should be updated. Now it happens
> automatiacally in Cache. And application which is rinning on front end
> insert s a record in one derived table and tries to get that record
> form the base class of the derieved table.
> Upto my knowledge Oracle dose not support that kind of Object oriented
> schema.
>
> So what I thought that a triiger is created on the derieved tables
> which activiated on insert, update and delete and take the insert ,
> update and delete action on the base tables.
> So that is why i need to have the last inserted , updated and deleted
> record selected. So that I can make neccessary changes in the base
> tables.
> Now I cannot make changes in the application code because it happens
> hundereds of time in the application code, so i have to change almost
> all the application code, so changing the application code is not
> feasible.
>
> Faheem Rao
> In article <90p70h$a5t$1_at_nnrp1.deja.com>,
> faheemrao_at_my-deja.com wrote:
> >
> >
> > I want to select the last inserted record in a table.
> >
> > I know that there is something to be do with the rownum but when I try
> > this quer logically it seems to be ok , but it is select zero rows,
> >
> > select * from table_name where rownum in (select max(rownum) from gg)
> >
> > to me that the subquery return the rownum 1 and that is why actuall
> > query goiving no result , I want a solution in one quer if posssible
 if
> > not I can go for stored procedure.
> >
> > thanks
> >
> > Faheem Rao
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
> >
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Fri Dec 08 2000 - 20:08:51 CST

Original text of this message

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