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: Date in primary key

Re: Date in primary key

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Tue, 5 Sep 2000 19:12:06 +0200
Message-ID: <968173817.29584.0.pluto.d4ee154e@news.demon.nl>

<eoin7_at_my-deja.com> wrote in message news:8p386u$tap$1_at_nnrp1.deja.com...
>
>
> Is it okay to have a date column as part of a primary key, or should
> this be avoided?
> My db design includes an associative table that seems to require a date
> column for uniqueness, along with the keys from the tables being
> associated.
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.

Shouldn't be a problem, provided you take care to trunc the date upon insert or update if the time doesn't interest you. Otherwise you will have to include an explicit range scan for the last day (which I usually do by appending 23:59:59).

Hth,

Sybrand Bakker, Oracle DBA Received on Tue Sep 05 2000 - 12:12:06 CDT

Original text of this message

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