- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- NLS parameter's priority?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-05-2005 08:18 PM
тАО01-05-2005 08:18 PM
Thanks
Eric
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-05-2005 08:40 PM
тАО01-05-2005 08:40 PM
Re: NLS parameter's priority?
see Metalink
Note:74375.1
Subject: Default Date Formats
see the example :
SVRMGR> select * from nls_session_parameters 2> where parameter in ('NLS_DATE_LANGUAGE', 'NLS_DATE_FORMAT'); PARAMETER VALUE ------------------------------ ------------------------------ NLS_DATE_FORMAT DD-MON-YY NLS_DATE_LANGUAGE AMERICAN SVRMGR> select sysdate from dual; SYSDATE --------- 28-SEP-99 SVRMGR> alter session set nls_date_language=polish; SVRMGR> select * from nls_session_parameters 2> where parameter in ('NLS_DATE_LANGUAGE', 'NLS_DATE_FORMAT'); PARAMETER VALUE ------------------------------ ------------------------------ NLS_DATE_FORMAT DD-MON-YY NLS_DATE_LANGUAGE POLISH SVRMGR> select sysdate from dual; SYSDATE --------- 28-WRZ-99 SVRMGR> alter session set nls_language=hungarian; SVRMGR> select * from nls_session_parameters 2> where parameter in ('NLS_DATE_LANGUAGE', 'NLS_DATE_FORMAT'); PARAMETER VALUE ------------------------------ ------------------------------ NLS_DATE_FORMAT DD-MON-YY NLS_DATE_LANGUAGE HUNGARIAN SVRMGR> select sysdate from dual; SYSDATE --------- 28-SZE-99
Regards
Jean-Luc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-05-2005 08:51 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-05-2005 08:53 PM
тАО01-05-2005 08:53 PM
Re: NLS parameter's priority?
section 6. explains it all
If the NLS_LANG is set (either like in point 3,4 or 5) then parameters like NLS_SORT, NLS_DATE_FORMAT,... can be set as a "standalone" setting and will overrule the defaults derived from NLS_LANG_ part.
hope this helps!
regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-05-2005 09:19 PM
тАО01-05-2005 09:19 PM
Re: NLS parameter's priority?
Those parameters are 2 different concepts. NLS_DATE_FORMAT is the date format that will be used by default. NLS_DATE_LANGUAGE is the language that will be used by default to display those dates.
For example:
select to_char(sysdate - 7,'DD-MON-RR', 'nls_date_language=american') date1,
to_char(sysdate - 7,'DD-MON-RR', 'nls_date_language=portuguese') date2
from dual;
Will return "DEC" for American language and "DEZ" for Portuguese language:
DATE1 DATE2
----------- -----------
30-DEC-04 30-DEZ-04
For January the result will be the same: "JAN"...
Best Regards,
Eric Antunes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-05-2005 09:23 PM
тАО01-05-2005 09:23 PM
Re: NLS parameter's priority?
NLS_DATE_FORMAT is used if a date format mask is not specified in application code. The effective NLS_DATE_FORMAT is determined by the following (in order of precedence):
1 - Session NLS_DATE_FORMAT (via ALTER SESSION command)
2 - Client side NLS_DATE_FORMAT (from client environment variables/registry settings)
3 - Instance NLS_DATE_FORMAT (from init.ora file)
4 - Database NLS_DATE_FORMAT
Eric Antunes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-06-2005 11:38 AM
тАО01-06-2005 11:38 AM
Re: NLS parameter's priority?
There are 3 levels at which you can set NLS parameters:
Database, Instance and Session.
If a parameter is defined at more than one level then the rules on which one takes precedence are quite straighforward:
1. NLS database settings are overwritten by NLS instance settings
2. NLS database & NLS instance settings are overwritten by NLS session settings
If you have NLS_LANG set on the client then as a result of that you will also have a setting for NLS_DATE_FORMAT. Even if it's not set explicitly on the client, it will have a implicit value based on the default derived from the territory part of the NLS_LANG setting. That means that whatever setting you have in the init.ora gets "overwritten" (following rule '2' from above) by this setting from the client.
You can set the parameter NLS_DATE_FORMAT in the init.ora, but as we've seen in "question 1" above, if NLS_LANG is set in the client OS environment that has no effect because the "instance" setting in the init.ora is overwritten by the session setting coming from the environment variable. This is fully explained in the note 241047 as Yogeeraj mentioned.
Therefore, if NLS_LANG is set and you want a different NLS_DATE_FORMAT than is the default, you must also set NLS_DATE_FORMAT in the client environmentto override the default that is taken from the NLS_LANG.
Note: NLS_DATE_FORMAT set as a parameter in the OS environment will not take effect unless NLS_LANG is also set.
Attached is document explaining the difference between the YY,RR,YYYY and RRRR format masks.Metalink Note: 30557.1 explains the NLS_DATE_FORMAT and a Default Century.
Indira A