Re: Store TIME in the Oracle

From: Niall Litchfield <niall.litchfield_at_gmail.com>
Date: Sun, 14 Aug 2011 09:30:52 +0100
Message-ID: <CABe10saRhGKw+VukQpReSp1ywoGJ0-8R=JfS7-qYJFb94bmQAg_at_mail.gmail.com>



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_at_gmail.com>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

--
http://www.freelists.org/webpage/oracle-l
Received on Sun Aug 14 2011 - 03:30:52 CDT

Original text of this message