Results 1 to 10 of 10
  1. #1
    Join Date
    Aug 2004
    Location
    Buenos Aires, Argentina
    Posts
    28

    Unanswered: Clock - Timestamp

    Simple questions: Where does the database take the CURRENT_TIMESTAMP date from? How can I see that value from SQLPLUS? Thank you.

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    SELECT CURRENT_TIMESTAMP FROM DUAL;

    I'd say that this time is taken from system (DB Server) time, but I might be wrong about it.

  3. #3
    Join Date
    Aug 2004
    Location
    Buenos Aires, Argentina
    Posts
    28
    Thanks, but the query is throwing "invalid column" on the CURRENT_TIMESTAMP word.
    The DUAL only tables only has a Dummy field, varchar2(1), in the database. Could that have something to do?
    Thanks again.

  4. #4
    Join Date
    May 2004
    Location
    BA [ARG]
    Posts
    137
    What's your db version??
    It works for me...

    Code:
    SQL*Plus: Release 9.2.0.1.0 - Production on Mon May 15 18:00:24 2006
    
    Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.
    
    SQL> conn ---@---
    Enter password: ******
    Connected.
    SQL> SELECT CURRENT_TIMESTAMP FROM DUAL;
    
    CURRENT_TIMESTAMP
    --------------------------------------------------------------------
    15-MAY-06 06.00.59.827000 PM -03:00
    
    SQL>

  5. #5
    Join Date
    Aug 2004
    Location
    Buenos Aires, Argentina
    Posts
    28
    "Oracle8i Enterprise Edition Release 8.1.7.4.0"
    Thanks.

  6. #6
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    If I'm not wrong, TIMESTAMP was introduced with Oracle 9. In 8.1.7, you'll have to stick to DATE datatype.

  7. #7
    Join Date
    Aug 2004
    Location
    Buenos Aires, Argentina
    Posts
    28
    Any ideas on how to get the date and hour on 8.1.7?
    Thanks.

  8. #8
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    SELECT TO_CHAR(sysdate, 'dd.mm.yyyy hh24:mi:ss') date_and_time FROM dual;

  9. #9
    Join Date
    Aug 2004
    Location
    Buenos Aires, Argentina
    Posts
    28
    You are the BEST DBA IN THE UNIVERSE. Thank you.

  10. #10
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    LOL!!! That was the best joke I've heard recently

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •