-
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
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|