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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: how to define date column in a table with only mm/dd/yyyy

RE: how to define date column in a table with only mm/dd/yyyy

From: William Beilstein <BeilstWH_at_OBG.com>
Date: Wed, 01 Nov 2000 14:44:08 -0500
Message-Id: <10667.120847@fatcity.com>


Don't use varchar2. Simply store the trunc value, which throws away the = time portion. For example

insert into my_table values(TRUNC(SYSDATE))

While the ability to store time is still there, what is stored is only the = date portion.

>>> Raj Gopalan <raj.gopalan_at_netdecisions.co.uk> 11/01/00 01:30PM >>>
Otherwise, write a insert/update trigger on the table to use TRUNC = function
to store the date value.

-----Original Message-----
Sent: Wednesday, November 01, 2000 3:26 PM To: Multiple recipients of list ORACLE-L portion

If you store it as format DATE it will contain time portion. If you only want to store date you store it as varchar2.

HTH,
Ruth
----- Original Message -----
To: "Multiple recipients of list ORACLE-L" <ORACLE-L_at_fatcity.com> Sent: Tuesday, October 31, 2000 12:31 PM

> Hi All,
>
> I have table that contains a column - TRADE_DATE.
>
> This column should always contain only the date portion - mm/dd/yyyy. =
It
> SHOULD NOT contain time portion.
>
> Is there any way, I can define this column or can I use some kind of
> constraint clauses on this column? If yes, please tell me how to do =
this.
>
> TIA,
>
> Rao
>
>
> Maheswara.Rao_at_SunGardP3.com=20
>
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com=20
> --
> Author: Rao, Maheswara
> INET: Maheswara.Rao_at_Sungardp3.com=20
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).

--=20
Please see the official ORACLE-L FAQ: http://www.orafaq.com=20 --=20
Author: Ruth Gramolini
  INET: rgramolini_at_tax.state.vt.us=20

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). --=20
Please see the official ORACLE-L FAQ: http://www.orafaq.com=20 --=20
Author: Raj Gopalan
  INET: raj.gopalan_at_netdecisions.co.uk=20
Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may Received on Wed Nov 01 2000 - 13:44:08 CST

Original text of this message

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