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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Datatype in Oracle

Re: Datatype in Oracle

From: Jason Jay Weiland <archduke_at_uclink4.berkeley.edu>
Date: Wed, 07 Oct 1998 13:25:04 -0700
Message-ID: <361BCE20.CD65905B@uclink4.berkeley.edu>


Ken,

     Date is an abstract in Oracle 7.3.x, to enter a date you would specify a format.

SQL> insert into foo
  2 values (To_Date('10/13/1974', 'MM/DD/YYYY')); 1 row created.

     The date dataype also has time information as well. A default string that works in place of using the To_Date function is 'DD-MON-YY' (e.g. '10-OCT-74') so the following would work:

SQL> insert into foo
  2 values ('10-OCT-74');
1 row created

     ... I believe this is due to Oracles default date format picture.

Some of the more common formats that I use are: YYYY Year

MM      Month (2-digit value)
MON     Month (3-letter abbr)
WW      Week of Year
W       Week of Month
DDD     Day of Year
DD      Day of Month
D       Day of Week
J       Julian Day (the number of days since 31-Dec-4713 BC)

HH      Hour of Day

HH12 Hour (1-12)
HH24 Hour (0-23)
MI      Minute
SS      Second

SSSS Seconds past midnight

     As for Booleans, Oracle 7.3x does not support a Boolean type, but a good work around is having a Char(1) that can only have values '1' or '0' (or: 'T'/'F').

Jay!!!

Ken Ho Kwok Fai wrote:

> I am using Oracle 7.3.2 in Unix. I want to know the format of the
> datatype "Date". What format I should use to input a date to the database
> which type is "Date"? Another problem is about Boolean type. Do oracle
> support "Boolean" type? Thanks you for your kind attention.
>
> --
> Regards,
> Ken
Received on Wed Oct 07 1998 - 15:25:04 CDT

Original text of this message

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