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: oracle date

Re: oracle date

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Fri, 06 Aug 1999 13:24:34 GMT
Message-ID: <37b0e1c5.5390180@newshost.us.oracle.com>


A copy of this was sent to "Frank Leenders" <ftleenders_at_hotmail.com> (if that email address didn't require changing) On Fri, 6 Aug 1999 10:22:55 +0200, you wrote:

>Hello all,
>in some initialisation file it is possible to set the default presentation
>of the date datatype for an Oracle instance, most of the times set to
>dd-mmm-yy. In regard of the Y2K problem I asked our DBA's to set that
>default to dd-mm-yyyy. But they say Oracle recommends NOT to do that!?!? Is
>that true and if so, why?
>Remark: I am writing about instance level of that setting, not about the
>session setting.
>Thanks
>Frank
>

The reason it is not recommended to do at the instance level in the init.ora file is as follows:

If the client sets the NLS_* parameters -- they override the server in all cases. In fact, if the client sets the NLS_LANG parameter -- that causes all NLS_* settings on the server to be ignored and the defaults for that NLS_LANG specified on the client on used.

Where that comes into play is typically if the client is windows and the server is unix. The client install on windows set the NLS_LANG parameter in the registry by default. This setting is different from the default you find for unix. Any NLS_* settings you put in the init.ora will *not* be used by those clients. You'll get a false sense of security if you set it in the init.ora as many clients will totally ignore it.

You have to set the NLS_DATE_FORMAT in the registry on the client

or

you need to put an "alter session set nls_date_format='yyyymmdd'" in your apps right after the connect

or

with Oracle8i, release 8.1 you can code:

create or replace trigger data_logon_trigger after logon
ON DATABASE
begin

    execute immediate

        'alter session set nls_date_format = ''yyyymmdd'' '; end;
/

as well. that will make all sessions have that date format after they logon.

--
See http://govt.us.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'... Current article is "Part I of V, Autonomous Transactions" updated June 21'st  

Thomas Kyte                   tkyte_at_us.oracle.com
Oracle Service Industries     Reston, VA   USA

Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Fri Aug 06 1999 - 08:24:34 CDT

Original text of this message

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