nls_date_format [message #468378] |
Thu, 29 July 2010 23:01  |
pointers
Messages: 451 Registered: May 2008
|
Senior Member |
|
|
Hi,
I wanted to change session nls_date_format to change display format of the date. I dont want to use to_char. I wanted to change session date display settings. my current display format is 'dd/mm/yyyy'.
I did as below but it is not reflecting the changes.
SQL> select sysdate from dual;
SYSDATE
-----------
30/07/2010
SQL> alter session set nls_date_format='dd-mon-yy';
Session altered
SQL> select sysdate from dual;
SYSDATE
-----------
30/07/2010
SQL> alter session set nls_timestamp_format='dd-mon-yy hh24:mi:ss';
Session altered
SQL> select sysdate from dual;
SYSDATE
-----------
30/07/2010
SQL> select * from nls_session_parameters;
PARAMETER VALUE
------------------------------ ----------------------------------------
NLS_LANGUAGE ENGLISH
NLS_TERRITORY AUSTRALIA
NLS_CURRENCY $
NLS_ISO_CURRENCY AUSTRALIA
NLS_NUMERIC_CHARACTERS .,
NLS_CALENDAR GREGORIAN
NLS_DATE_FORMAT dd-mon-yy
NLS_DATE_LANGUAGE ENGLISH
NLS_SORT BINARY
NLS_TIME_FORMAT HH12:MI:SSXFF AM
NLS_TIMESTAMP_FORMAT dd-mon-yy hh24:mi:ss
NLS_TIME_TZ_FORMAT HH12:MI:SSXFF AM TZR
NLS_TIMESTAMP_TZ_FORMAT DD/MON/RR HH12:MI:SSXFF AM TZR
NLS_DUAL_CURRENCY $
NLS_COMP BINARY
NLS_LENGTH_SEMANTICS BYTE
NLS_NCHAR_CONV_EXCP FALSE
17 rows selected
SQL> alter session set nls_timestamp_tz_format='dd-mon-yy hh24:mi:ss';
Session altered
SQL> select sysdate from dual;
SYSDATE
-----------
30/07/2010
Can you please help me in getting the date format in 'dd-mon-yy' or any other format that we give. I dont want to use mask as if i use i need to use at too many places.
Regards,
Pointers
|
|
|
|
Re: nls_date_format [message #468380 is a reply to message #468379] |
Thu, 29 July 2010 23:07   |
pointers
Messages: 451 Registered: May 2008
|
Senior Member |
|
|
Thanks for your reply Blackswan.
Yes it worked for me in my personal computer when i tried yesterday.
But in my production database (office), when i try, it is not working.
Regards,
Pointers
|
|
|
|
|
|
Re: nls_date_format [message #468397 is a reply to message #468383] |
Fri, 30 July 2010 00:12   |
pointers
Messages: 451 Registered: May 2008
|
Senior Member |
|
|
Hey thanks all for you replies.
I am not sure why it is not working in my production database.
I checked as Blackswan suggested.
SQL> ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY-MM-DD HH24:MI:SS';
Session altered
SQL> select sysdate from dual;
SYSDATE
-----------
30/07/2010
SQL>
Is there any settings that are stopping these changes to reflect.
Regards,
Poiners
|
|
|
|
|
|
Re: nls_date_format [message #468436 is a reply to message #468429] |
Fri, 30 July 2010 01:48   |
pointers
Messages: 451 Registered: May 2008
|
Senior Member |
|
|
@Vamshi,
I dont want to use any masking like "cast" or "to_char" the reason is that incase i use, i need to use at too many places. So looking for settings (nls_date_format)
@Micheal,
There are no triggers created.
Regards,
Pointers
|
|
|
|
|
|
Re: nls_date_format [message #468470 is a reply to message #468429] |
Fri, 30 July 2010 02:39  |
 |
Michel Cadot
Messages: 68765 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
Quote:2/ Why ?
Anybody would want to do so ?
Because some applications (didn't you see many here?) use an implicit conversion on date and don't want users change it.
Quote:1/ How?
Well I thought it was possible but I already answered and demonstrated in a usenet forum a couple of years ago that it is not possible as ALTER SESSION does not trigger any trigger, unfortunatly.
Regards
Michel
|
|
|