Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2006
    Posts
    119

    Unanswered: Rounding in Oracle

    Hi,
    Simple question here.

    My Java application is JDBC driver to connect to Oracle 11. I have a Date column and noticing that Oracle 11 does not store the millisecond part of the date. So when I read the Date back and look for the time in millseconds, the last thread digits are always 000.

    Any advice?
    Is this just a limit for Oracle or is there anyway to change it?

    Thanks

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Perhaps you have used DATE datatype instead of TIMESTAMP?
    Code:
    SQL> create table test
      2  (col_d date,
      3   col_t timestamp
      4  );
    
    Table created.
    
    SQL> insert into test (col_d, col_t) values (sysdate, systimestamp);
    
    1 row created.
    
    SQL> select * from test;
    
    COL_D            COL_T
    ---------------- -----------------------------------------------------
    11.06.2009 11:50 11.06.09 11:50:25.234000
    
    SQL>

  3. #3
    Join Date
    Mar 2007
    Posts
    623
    As you provided no details, I will provide you answer from SQL Reference book, available with another Oracle documentation e.g. online on http://tahiti.oracle.com/.

    For Oracle 11g, it is available here: http://download.oracle.com/docs/cd/B...b28286/toc.htm
    Chapter 2 Basic Elements of Oracle SQL
    Datatypes
    Oracle Built-in Datatypes
    TIMESTAMP Datatype
    ...fractional_seconds_precision optionally specifies the number of digits Oracle stores in the fractional part of the SECOND datetime field. When you create a column of this datatype, the value can be a number in the range 0 to 9. The default is 6.

Posting Permissions

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