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: dd/mm/yy - fixed default?

Re: dd/mm/yy - fixed default?

From: Jacqui Caren <Jacqui.Caren_at_ig.co.uk>
Date: Tue, 11 Jan 2000 15:31:02 GMT
Message-ID: <Fo6GFx.33w@ig.co.uk>


In article comp.databases.oracle.misc:<386E86C7.9D3C414D_at_cc.gatech.edu>, Paul Bennett <bennett_at_cc.gatech.edu> writes:
>It may not be necessary to change anything in your scripts. The format is just
>a display format, so as long as the readers know that 01/01/00 is 2000 and not
>1900, you shouldn't need to change anything. Oracle's internal representation
>stores the 4 digit date, so
>
>IF date_var1 < date_var2
>
>will work just fine, even though you may display the dates to the user in
>mm/dd/yyyy.
>
>-- Paul
>
>james wigley wrote:
>
>> Is it inevitable that and SQL scripts which queries a date field in an
>> Oracle database will return with the format dd/mm/yy, unless the to_char(,)
>> function is used - or is there a global default or setting that will prevent
>> me from having to update a load of old scripts?
>

try setting the NLS_DATE_FORMAT
i.e.
 alter session set NLS_DATE_FORMAT = 'Dd Mon YYYY'

which, for the duration of the connection (session), will override the default date format used when displaying DATE fields.

Note that it also override the default format for inserted data so that
  insert into birthday values (to_date('jacqui','31 Mar 1960'));

becomes the norm :-)

I thought this and the other NLS config setting were basic^Wcommon knowledge (i.e. FAQ level stuff)?

Jacqui

--
Paul Ingram Group Ltd,140A High Street,Godalming GU7 1AB United Kingdom Email: J.Caren_at_ig.co.uk Fax: +44 1483 862801 Phone: +44 1483 862800 SmartCards in e-commerce? http://www.smartaxis.com/ Received on Tue Jan 11 2000 - 09:31:02 CST

Original text of this message

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