DBAsupport.com Forums - Powered by vBulletin
Results 1 to 7 of 7

Thread: Urgent Help !!! Insert Statement

  1. #1
    Join Date
    Jan 2000
    Posts
    27
    I want to insert mili second in date column. How can I achieve this ???
    Eg. 01-05-2001 12:30:35:800 so here 800 are Milliseconds?

    Or Oracle will insert milisecond auto when u insert date. If that is so how can I get milisecond part along with date and time.

    Thanks


  2. #2
    Join Date
    Feb 2000
    Location
    Washington DC
    Posts
    1,843
    SQL> select sysdate from dual;

    SYSDATE
    ---------
    05-JAN-01

    SQL> select to_char(sysdate,'mmddyyyyhh24miss') from dual;

    TO_CHAR(SYSDATE,'MMDDYYYYHH24MISS')
    ----------------------------------------------------------
    01052001102049

    I mean. you can use 'to_char' to get full date format.

    [Edited by sreddy on 01-05-2001 at 11:36 AM]

  3. #3
    Join Date
    Jan 2001
    Posts
    36
    I don't think oracle stores milliseconds in its DATE
    datatype.
    A DATE datatype only stores
    centuryyear,month,day,hour,minute,second.


  4. #4
    Join Date
    Nov 2000
    Location
    Baltimore, MD USA
    Posts
    1,339
    AFAIK, he is correct. Oracle does not store milliseconds.

    The format that sreddy provided is
    mm - month
    dd - day
    yyyy - year
    hh24 - hour (24)
    mi - minutes
    ss - seconds

    - Chris

  5. #5
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    Yup, you will have to wait until 9i until you can access parts of a second.
    Jeff Hunter

  6. #6
    Join Date
    Feb 2000
    Location
    Washington DC
    Posts
    1,843
    Yes ! DB2 supports and I don't think Oracle supports it as of now.

  7. #7
    Join Date
    May 2000
    Location
    Portsmouth, NH, USA
    Posts
    378

    Talking you can using java in oracle



    you can create a simple script using Java in Oracle that will get you milliseconds.
    I read it in ORACLE magazine.

    I could post it here if ya want, but it is definately online probably. It was a pretty cool program.

    Lemme see if I can find it online somewhere.

    - Magnus

Posting Permissions

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


Click Here to Expand Forum to Full Width