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: Tanel Poder <tanel_at_@peldik.com>
Date: Wed, 6 Aug 2003 15:09:37 +0300
Message-ID: <3f30f003_1@news.estpak.ee>


Hi!

Length takes varchar2 or clob as an argument, thus your date is converted to varchar2 according your date format mask first, and length is taken from the result. Try for example to alter session set nls_date_format = 'RRRRMMDD HH24:MI:SS'; and see length changed.

Use dump() function instead:

SQL> select dump(a) from t;

DUMP(A)




Typ=12 Len=7: 120,103,8,6,16,4,32

Tanel.

"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.
>
> - Jack
>
>
>
Received on Wed Aug 06 2003 - 07:09:37 CDT

Original text of this message

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