get timestamp from Oracle via Linked server

  • I'm looking for a way to get the server time stamp of an Oracle DB from Sql Server. We have it as a linked server, so i'd imagine I'd use OPENQUERY. Anyone know the syntax?

  • oracle has SYSDATE ahs an equivalent of our GetDate();

    oracle would be SELECT SYSDATE FROM DUAL;

    (oracle syntax requires a FROM clause...DUAL is a dummy table that can be used to supply the source.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • thanks. that worked

  • Lowell (1/23/2009)


    Lowell (last pork chopped for stupidity on 01/22/2008 11:30 pm)

    Man, I hope that's in good humor... If it's not, I'm really sorry.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • got another question... same type actually.

    what if it's a linked server that i want the current_timestamp for?

    select current_timestamp from linkedserver.????.dbo.????

    normally we do just "select current_timestamp" which is a function on the local server. but, assuming i have permissions, how would i grab it from another linked server?

  • since current_timestamp is a variable, it really doesn't matter which table you get it from;

    by same question, you mean from a linked sql server?

    i did select top 1 current_timestamp from linkedSQLserver.master.dbo.sysobjects, and it worked no problem;

    for fun i did a dif database with the same results:

    select current_timestamp from stormsql.geo.dbo.sysobjects

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply