Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: selecting last inserted record in table
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 - 11:31:25 CST