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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Re[4]: Date format element rule change

RE: Re[4]: Date format element rule change

From: <Alexander.Feinstein_at_mitchell1.com>
Date: Tue, 12 Feb 2002 13:53:58 -0800
Message-ID: <F001.0040D4C4.20020212133819@fatcity.com>

Jonathan,
You are right.
From FM:

For input format models, format items cannot appear twice, and format items that represent similar information cannot be combined. For example, you cannot use 'SYYYY' and 'BC' in the same format string.

And:

NLS_DATE_FORMAT specifies the default date format to use with the TO_CHAR and TO_DATE functions.

Alex.

-----Original Message-----
From: Jonathan Gennick [mailto:jonathan_at_gennick.com] Sent: Tuesday, February 12, 2002 1:21 PM To: Alexander.Feinstein_at_mitchell1.com
Cc: Alexander Feinstein
Subject: Re[4]: Date format element rule change

Alexander,

Your example below is very helpful, and explains why I recalled that duplicating date elements was possible. I probably used TO_CHAR to test this in the past, while the other day I was using ALTER SESSION.

My theory on why you can't duplicate elements when setting NLS_DATE_FORMAT is that the NLS_DATE_FORMAT value gets used for both input AND output. It's no problem to spit the month out twice in two different ways, but there's probably some issues involved with making users specify the month twice. For example, what if a user specifies two different months, as in: Feb (03) 15, 2002?

This is becomming clearer to me now. Thanks.

Best regards,

Jonathan Gennick  
mailto:jonathan_at_gennick.com * 906.387.1698 http://Gennick.com * http://MichiganWaterfalls.com * http://ValleySpur.com

Monday, February 11, 2002, 10:48:20 PM, you wrote:

AFmc> You can, using to_char, but not in "alter ... nls ..."
SQL>> select to_char(sysdate,'Mon (MM) DD, YYYY') from dual;
AFmc> TO_CHAR(SYSDATE,'
AFmc> -----------------
AFmc> Feb (02) 11, 2002
AFmc> 1 row selected.


AFmc> Alex. Received on Tue Feb 12 2002 - 15:53:58 CST

Original text of this message

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