RE: CURRENT_TIMESTAMP vs GETDATE

RE: CURRENT_TIMESTAMP vs GETDATE

 

  

Hmmm, unfortunately, I only have to to reply and let you know I do not
have time now to think about it.

As far as A1, B1, I would simply assume that since Oracle already has
the answer, it did not need to get it again but used the answer it
already had for A1.

Joel Patterson
Database Administrator
joel.[Email address protected]
x72546
904 727-2546

-----Original Message-----
From: Vikas Sangar
[mailto:oracledba-ezmlmshield-x90974399.[Email address protected]
Sent: Thursday, February 01, 2007 2:49 AM
To: LazyDBA Discussion
Subject: RE: CURRENT_TIMESTAMP vs GETDATE

May be yes, But then why is there no diffrences between A1 & B1? A1 was
processed first by CPU, then came A2 and then B1. Dont you think there
should be some diffrence between A1 and B1 instead.

Its only that before returning any results to a query that the oracle
database locks the data, so as to output a snapshot/copy of the data
that was existent at the time when query was just fired. Thats what we
call time consistent data output.

Or it may be the case that for all the occurences of Date and time
values in a query at a given time, Oracle's SQL Parser caches or
replaces the values for all trailing ocurences(for similar tags ex-
sysdate, sysdate, systimestamp, systimestamp ect) that it had retrieved
for the very first occurence when a query gets fired.

Regards.
Vikas.

Original Message -----------------------
OK, Don't get me wrong, I have no basis for the theory as I did no
research.

However, your results don't discount my theory that the times are
processed through the CPU sequentially. What it proves is that you
cannot depend on the order that they are selected. :)

Actually, I suspect something else is going on.

Joel Patterson
Database Administrator
joel.[Email address protected]
x72546
904 727-2546

-----Original Message-----
From: Vikas Sangar
[mailto:oracledba-ezmlmshield-x65248527.[Email address protected]
Sent: Wednesday, January 31, 2007 12:48 AM
To: LazyDBA Discussion
Subject: RE: CURRENT_TIMESTAMP vs GETDATE

Hi Joel,

May be you are right but I doubt because if, had they been processed
sequentially, The output shown for the systimestamp in your first query
would have been greater/more than that of current_timestamp, Since
systimestamp comes after current_timestamp.

just check out this query and see for yourself. It seems that sequential
processing stuff does'nt seems to work.

select current_timestamp a1, systimestamp a2, current_timestamp b1,
systimestamp b2 from dual;

A1
-----------------------------------
31-JAN-07 11.04.48.859646 AM +05:30

A2
-----------------------------------
31-JAN-07 11.04.48.859635 AM +05:30

B1
-----------------------------------
31-JAN-07 11.04.48.859646 AM +05:30

B2
-----------------------------------
31-JAN-07 11.04.48.859635 AM +05:30

Regards...
Vikas.

Original Message -----------------------
Between sysdate (getdate()) and timestamp, I would think is because the
timestamp has timezone information in it. And date does not.
----
Hmmm, on my system they are also different, but only by millionths of a
second, which to me suggests they went to the CPU sequentially:

Notice that the last column has the latest time.
DBMON @ mqaudit> select current_timestamp, systimestamp from dual;

CURRENT_TIMESTAMP
SYSTIMESTAMP
------------------------------------------------------------------------
--- ------------------------
30-JAN-07 09.42.16.692385 AM -05:00
30-JAN-07 09.42.16.692312 AM -05:00

DBMON @ mqaudit> select systimestamp, current_timestamp from dual;

SYSTIMESTAMP
CURRENT_TIMESTAMP
------------------------------------------------------------------------
--- ------------------------
30-JAN-07 09.42.25.328189 AM -05:00
30-JAN-07 09.42.25.328254 AM -05:00


Joel Patterson
Database Administrator
joel.[Email address protected]
x72546
904 727-2546

-----Original Message-----
From: Vikas Sangar
[mailto:oracledba-ezmlmshield-x73291322.[Email address protected]
Sent: Tuesday, January 30, 2007 4:06 AM
To: LazyDBA Discussion
Subject: RE: CURRENT_TIMESTAMP vs GETDATE

Well, I dont know whats the intended use of Getdate().

But in Oracle 9i,
select current_timestamp, systimestamp from dual;
gives you almost the same results.But which one is more accurate has yet
to be discovered.

regards.

Original Message -----------------------

I get the same results?

select current_timestamp, getdate()

----------------------- -----------------------
2007-01-29 11:25:35.580 2007-01-29 11:25:35.580

(1 row(s) affected)



-----Original Message-----
From: Taylor Jay
[mailto:oracledba-ezmlmshield-x31449968.[Email address protected]
Sent: Monday, January 29, 2007 9:35 AM
To: LazyDBA Discussion
Subject: CURRENT_TIMESTAMP vs GETDATE


Can anyone provide some insight into why these two commands would return
different values. We did some testing of the patches on the new day
light savings time schedule this weekend. During the testing it was
brought to light that these two commands were returning different
values. Formatting aside, they were different. Should these not return
that same data and time?

Thanks in advance for any explanation.

Cheers-
Jay


---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
To post a dba job: http://jobs.lazydba.com
To Subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html




--
This message has been scanned for viruses and dangerous content by
MailScanner, and is believed to be clean.

Douglas County, Oregon
www.co.douglas.or.us



---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
To post a dba job: http://jobs.lazydba.com
To Subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html



---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
To post a dba job: http://jobs.lazydba.com
To Subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html




---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
To post a dba job: http://jobs.lazydba.com
To Subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html



---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
To post a dba job: http://jobs.lazydba.com
To Subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html




---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
To post a dba job: http://jobs.lazydba.com
To Subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html



---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
To post a dba job: http://jobs.lazydba.com
To Subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html



Oracle LazyDBA home page