Re: Oracle DATE datatype storage.

From: Mark Grand <mdg_at_netcom22.netcom.com>
Date: 1995/07/30
Message-ID: <MDG.95Jul30065726_at_netcom22.netcom.com>#1/1


In article <1995Jul25.132639_at_ebi.ac.uk> ditommaso_at_ebi.ac.uk (MATTEO DITOMMASO) writes:

> > We don't care about the hour, minute and second and we have
> > many dates to store. This seems quite wasteful to store this in
> > seven bytes when it could be done in four. Is there a way to internally
> > store the date in four bytes?
> >
> your best bet is to store it as a NUMBER(8)
> YYYYMMDD
> instead of using the ORACLE date format.

Assuming that the dates span a limited number of years, it would be more space efficient to store them as the difference between the actual dates and a reference date, such as 01-JAN-1997. For a reasonable range of dates, that will use only 2 or 3 bytes per date.

-- 
==============================
Mark Grand
Received on Sun Jul 30 1995 - 00:00:00 CEST

Original text of this message