Re: Store TIME in the Oracle

  • From: Niall Litchfield <niall.litchfield@xxxxxxxxx>
  • To: ecandrietta@xxxxxxxxx
  • Date: Sun, 14 Aug 2011 09:30:52 +0100

The short answer is that there isn't. I'm curious as to what your need is
though. I can think of 2 use cases. The first is where you want to store
time in one field and date in another. The second is when you want to store
duration. I'd argue that in the first case splitting the field is incorrect,
that you will always want to distinguish '2011-08-14 13:44' from '2011-08-13
13:44'. In the second case I'd store duration as number of (milli)seconds.

Niall

On Sun, Aug 14, 2011 at 2:08 AM, Eriovaldo Andrietta
<ecandrietta@xxxxxxxxx>wrote:

> Hello Friends:
>
>
>   I would like to know if there is a datatype to store only time in oracle,
> like HH24:MI
>
>   I can use VARCHAR2(5) and save like that : 01:50, 22:35, ...
>
>   Also, I can use DATE and store only time: HH24:MI , but in this case, it
> will store the date too. In this case I need supress data when reading the
> table.
>
>   Is there another way to do it ?
>
> Regards
> Eriovaldo
>
>
>



-- 
Niall Litchfield
Oracle DBA
http://www.orawin.info

Other related posts: