This discussion is archived
4 Replies Latest reply: Apr 13, 2012 12:34 PM by Justin Cave RSS

SYSDATE is Going Backward

user4184769 Newbie
Currently Being Moderated
Hi All,

I am creating a very simple way to keep track the timing for my processing as the following; however, the timestamp is going backward, any clues?

My Oracle version is 11g.
PROCEDURE xyz
IS
l_timestamp VARCHAR2(100);

BEGIN

   SELECT to_char(sysdate,  'mm/dd/yyyy hh24:mm:ss') INTO l_timestamp FROM DUAL;
   INSERT INTO timetracking VALUES ('merging data',  l_timestamp);
   COMMIT;

   MERGE INTO ....;

   COMMIT;

   SELECT to_char(sysdate,  'mm/dd/yyyy hh24:mm:ss') INTO l_timestamp FROM DUAL;
   INSERT INTO timetracking VALUES ('completed',  l_timestamp);
   COMMIT;
   
END;
the process completed around 30-40 mins, and the result from the timetracking table stored as:

action                time
====               ====
merging data      04/13/2012 14:04:57
completed         04/13/2012 14:04:47     <==== What is going on here ????
Any clues?

Regards,
Jz

Edited by: user4184769 on Apr 13, 2012 12:21 PM

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points