Re: Granularity of ORACLE's date/time

From: Thomas J. Kyte <tkyte_at_us.oracle.com>
Date: 1995/05/15
Message-ID: <3p7pgu$oth_at_inet-nntp-gw-1.us.oracle.com>#1/1


randyd_at_cais2.cais.com (Randy Dewoolfson) wrote:
>
> Karen Huguley (khuguley_at_sti.nasa.gov) wrote:
> : I apologize for the simplicity of this question, but I am
> : surprised at what I am finding with ORACLE's sysdate function.
 

> : Is it possible to extract milliseconds from the system date/time?
> : Seconds are not always granular-enough. Any suggestions?
 

> : Thanks in advance,
> : K. Huguley
> : NASA Center for AeroSpace Information
>
> ORACLE DATE fields only store down to the second.
> If you are limited to being strictly inside ORACLE for some reason,
> then you can switch to, or extend by, a SEQUENCE which will order
> your records chronologically (sort of...), otherwise you could use
> Pro*C (or others) to stuff an additional field (MILLISECONDS) and
> use a concatenated sort... User exits are another hook for this
> kind of thing.
>
> Good Luck
>
> Randy
>
> --
> ..uu. z' , ___________________
> ?$""`?i . x" .uu I Randy I
> `M ._at_" d9b . f .,.uun. ?$ ?i' I DeWoolfson I
> 'Z :#" M `8 U8 < .dP"```"# `M ._at_" I-----------------I
> '&H?` X ,oR $5. $ ?* _at_ 'Z :#" I randyd_at_cais.com I
> d#`*L :RP' $b f`$L:M Xf .f' '&H?` I-----------------I
> ,!"> 5. $' ?X X "NXF M .=` d#` I ,\\/. I
> > 'M d$ `E M "$$ Mux~ n!" I |o o| I
> k `h ' ' "" ` z" * I=ooO==(_)==Ooo===I
> % ` " " I_________________I

You can get hundreds of seconds out of the v$timer table, or if you don't want to give access to v$timer to anyone, you can use the stored procedure dbms_utility.get_time to get the same value. The v$timer table has one column and one row (sort of like dual). The column "HSECS" contains the time down to the hundredths of seconds. The stored proc is another way to get the same value.

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government Received on Mon May 15 1995 - 00:00:00 CEST

Original text of this message