about to store millseconds ..
DBAsupport.com Forums - Powered by vBulletin
Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: about to store millseconds ..

  1. #1
    Join Date
    Jan 2002
    Posts
    78
    Hi Friends,

    I want to Store in mydatabase time with millseconds. Is it Possible to Store this in Oracle? Upto My knowledge i know that the Date Datatype will store Hours,Minutes and seconds.

    Sekhar

  2. #2
    Join Date
    Jan 2002
    Posts
    15

    Thumbs up

    U R right? I think you have to use JAVA for getting the millsec, if you want, and store in separate field.
    Solved

  3. #3
    Join Date
    Jun 2001
    Location
    Helsinki. Finland
    Posts
    3,938
    You can use DBMS_UTILITY.GET_TIME but have in mind that it is not syncronized with SYSDATE. The time you get (a number) is the number of 100th's of a second from some arbitrary epoch.

    In 9i, there are new time formats, one of them is TIMESTAMP it shows the miliseconds even with precision of 9, default is 6.



  4. #4
    Join Date
    Jun 2000
    Location
    Madrid, Spain
    Posts
    7,447
    Code:
    Connected to:
    Oracle8i Enterprise Edition Release 8.1.7.2.0 - Production
    With the Partitioning option
    JServer Release 8.1.7.2.0 - Production
    
    SQL> alter session set events '10406 trace name context forever';
    
    Session altered.
    
    SQL> create table a (kk timestamp);  
    
    Table created.
    
    SQL> insert into a values(sysdate);
    
    1 row created.
    
    SQL> select * from a;
    
    KK
    ---------------------------------------------------------------------------
    17-JAN-02 11.38.54 AM
    cool huh

  5. #5
    Join Date
    Jun 2001
    Location
    Helsinki. Finland
    Posts
    3,938

    cool huh
    Yep :-)

    Even this is possible;

    insert into a values(systimestamp);

    But look at select * from a;




    [Edited by julian on 01-17-2002 at 07:02 AM]

  6. #6
    Join Date
    Dec 2001
    Location
    Bangalore, India
    Posts
    23
    Hi,


    Can anyone please elaborate on set events '10406 trace name context forever' or tell me where can I get more info on this.


    Thanks and Regards,
    Vijay R.


  7. #7
    Join Date
    Jun 2000
    Location
    Madrid, Spain
    Posts
    7,447
    10406 is used to enable timestamp dtaatype in Oracle 8i, of course it's not supported officially

  8. #8
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    True, this event enables you to store timestamp dataype values and use timestamp related functions inside 8i, but don't be fooled by this semi-feature! For example, it alows you to use SYSTIMESTAMP as Julian has pointed out, but make some tests with SYSTIMESTAMP inserts and see what fractional seconds are realy stored! Definitely not something that has anything to do with miliseconds or system clock! :(
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

  9. #9
    Join Date
    Jun 2000
    Location
    Madrid, Spain
    Posts
    7,447
    000000000

    :(

  10. #10
    Join Date
    Jan 2002
    Posts
    15

    cool

    cool
    Solved

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