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: Primary Key using date fields - ignores time part?

Re: Primary Key using date fields - ignores time part?

From: Tomm Carr <tommcatt_at_computer.org>
Date: 1997/09/04
Message-ID: <340EDFDF.323E@computer.org>#1/1

Joe Whalley wrote:
>
> I have a table that contains data, and I'm now trying to define a new
> primary key. One of the fields in the key is a date type. Several rows
> have the same date, but the time portion of the field is different. It
> seems that Oracle does not look at the time, and tells me it can't
> create the key because it would be violated by the data. Can I force it
> to look at the entire content of the column?

Unless you force it to (by using trunc or round, for example) Oracle looks at the value of the date field down to the second. Internally, the date type is a single value, there are no separate date and time parts to it.

You may want to post additional info -- the table as it exists, how you are trying to change it and what Oracle had to say about that change.

-- 
Tomm Carr
tommcatt@computer.org -- http://www.geocities.com/athens/delphi/6769
-- The Macintosh computer is like the open range;
-- In a world without fences, there are no Gates.
Received on Thu Sep 04 1997 - 00:00:00 CDT

Original text of this message

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