DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: How to find last updated record of a table?

  1. #1
    Join Date
    May 2006
    Posts
    1

    Exclamation How to find last updated record of a table?

    Hi...

    I am Using Oracle 10g XE.

    I want to find last updated record of a table. Table name is 'DUP';


    I wrote a trigger as follows....
    >>

    SQL> CREATE OR REPLACE TRIGGER LUR
    2 BEFORE UPDATE OR INSERT
    3 ON DUP FOR EACH ROW
    5 BEGIN
    6 SELECT SYSTIMESTAMP INTO :NEW.N_TS FROM DUAL;
    7 END;
    8 /

    <<

    I am getting PLS-00049.

    If this trigger works properly, i can find last updated record as......

    >>

    SQL> SELECT * FROM DUP WHERE N_TS =(SELECT MAX(N_TS) FROM DUP);

    <<

    can anyone help me here....

    Thanks & Regards

    Raj S Vaida

  2. #2
    Join Date
    Sep 2005
    Posts
    278
    Describe the table DUP

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width