Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Time-only column techniques

Re: Time-only column techniques

From: Jerry Gitomer <jgitomer_at_p3.net>
Date: 1998/02/05
Message-ID: <34D95E50.3740@p3.net>#1/1

Hi Rick,

Maybe its getting late but I am confused by your posting.

The Oracle DATE datatype already includes the time down to the nearest second and is good for something like 4712BC to 4712AD. Since you can extract any part of the DATE using a format string why do you feel that it should be changed?

If you prefer you can certainly build your own index fields by creating a TIME column of type NUMBER when you insert data into your table and then indexing TIME, but why bother? Oracle is perfectly content to index on DATE datatypes and no extra work is required on your part.

Regards

Jerry

Rick Jones wrote:
>
> Since Oracle doesn't support a "TIME" datatype, I'm wondering whether
> there is a commonly-used workaround within the Oracle community.
>
> My goal is for the columns to be eligible for datetime arithmetic, date
> functions, and for the optimizer to be able to use indexes when
> evaluating "time" predicates. I don't believe the "columnname -
> trunc(columname)" technique for extracting just the "TIME" portion of any
> DATE column would be a good solution.
>
> With that in mind, I'm assuming we should use a DATE datatype and store a
> locally agreed upon constant (eg, 01-JAN-0001) into the "date" portion.
> However, I would appreciate hearing other suggestions.
>
> -------------------==== Posted via Deja News ====-----------------------
> http://www.dejanews.com/ Search, Read, Post to Usenet
Received on Thu Feb 05 1998 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US