Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Getting sysdate across a DB link

Re: Getting sysdate across a DB link

From: Paul Moore <gustav_at_morpheus.demon.co.uk>
Date: Sun, 02 Mar 2003 17:27:54 +0000
Message-ID: <adgdadb9.fsf@morpheus.demon.co.uk>


Jaap W. van Dijk <j.w.vandijk.removethis_at_hetnet.nl> writes:

> On 28 Feb 2003 08:53:10 -0800, paul.moore_at_atosorigin.com (Paul Moore)
> wrote:
>
> ...
>>PS I just tried using inline views:
>>
>> select (local - remote)*24*3600 diff
>> from
>> (select sysdate local from dual) l,
>> (select sysdate remote from dual_at_t) r;
>>
>> That didn't work either :-(
> ...
>
> To exclude errors (what error did you get by the way?) from other
> causes than querying over the database link, what happens if you try:
>
> select sysdate from dual_at_t ?

That works, and seems to get the date from the remote server (at least, the result seems to be a few seconds out - the difference isn't enough to be glaringly obvious, and I can't reset the date on the remote server).

So it looks like, if the only table involved is remote, then sysdate is evaluated on the remote machine, but if there's any local table at all, all occurrences of sysdate are evaluated locally.

BTW, the inline vew example I gave above didn't give an error - it just gave a result of zero (which isn't right - the two clocks are a few seconds different...)

Paul.

-- 
This signature intentionally left blank
Received on Sun Mar 02 2003 - 11:27:54 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US