Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2005
    Posts
    127

    Unanswered: Query on SysDate

    Hi all,

    I executed the SYSDATE function call in my SQLPLUS, and it displayed the system date with out the time stamp in it.

    select sysdate from dual;

    even I tried to insert it into my table again the same thing happened, the timestamp is missing.

    create table test (col1 date)
    insert into test values (sysdate);

    Kindly let me know am i missing any system properties to be set

    mine is Oracle 9i on Windows XP2

    thanks and regards,
    Sn
    Last edited by Shefu; 04-26-07 at 09:52.

  2. #2
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    by default a time stamp is displayed using your default nls date format setting. SYSDATE always contains the time element but the default format causes it not to be displayed. If you want to see the timestamp use the following


    select to_char(sysdate,'MM/DD/YYYY HH24:MI.SS') FROM DUAL;
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

  3. #3
    Join Date
    Apr 2005
    Posts
    127
    HI,

    Thanks for the reply, I tried to fetch the data of the above specified sample table from my java program using JDBC drivers. Even then the value of the date is displayed without the TIMESTAMP..


    How can the format of the Date can be changed to retrieve the timestamp along with the date?

    Thanks,
    Sn

  4. #4
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Check this example:
    Code:
    SQL> create table test (col1 date);
    
    Table created.
    
    SQL> insert into test values (sysdate);
    
    1 row created.
    
    SQL> select to_char(col1, 'dd.mm.yyyy hh24:mi:ss') date_time from test;
    
    DATE_TIME
    -------------------
    26.04.2007 16:58:42
    
    SQL>
    As you can see, time portion is here.

    Now do the same on your database and post the result back here. Please, do copy-paste the whole session.

Posting Permissions

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