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: Size of Date field

Re: Size of Date field

From: Billy Verreynne <vslabs_at_onwe.co.za>
Date: 6 Aug 2003 02:38:14 -0700
Message-ID: <1a75df45.0308060138.4a56bf48@posting.google.com>


"Jack Wang" <nospam_at_nospam.com> wrote in message news:<yb1Ya.40993$LD6.846165_at_news0.telusplanet.net>...
> <Quotes from docs>
> Oracle uses its own internal format to store dates. Date data is stored in
> fixed-length fields of seven bytes each, corresponding to century, year,
> month, day, hour, minute, and second.
> </Quotes>
>
> SQL>select length(bday) from t;
>
> returns length of 9 instead of 7. Can someone explain it? Thanks.

SQL> create table xtest( x date );

Table created.

SQL> insert into xtest values ( sysdate );

1 row created.

SQL> select length(x), vsize(x) from xtest;

 LENGTH(X) VSIZE(X)
---------- ----------

        20 7

SQL> <quote from docs>
LENGTH returns the length of char in characters. VSIZE returns the number of bytes in the internal representation of expr. </quote>

--
Billy
Received on Wed Aug 06 2003 - 04:38:14 CDT

Original text of this message

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