Home » Other » Suggestions & Feedback » USERENV legacy function in SYS_CONTEXT to get language_territory.databse_characterset (Oracle 11g and later versions)
USERENV legacy function in SYS_CONTEXT to get language_territory.databse_characterset [message #616415] Mon, 16 June 2014 13:11 Go to next message
Lalit Kumar B
Messages: 3123
Registered: May 2013
Location: World Wide on the Web
Senior Member
This is not related to any issue so posted in General forum.

My question is that how reliable is it to ask a poster in the forum to post the language_territory.databse_characterset information of current session using the USERENV function provided in SYS_CONTEXT. I know it is a legacy function that is retained for backward compatibility, however, still in use. It will be helpful for me to know, so that I would keep in mind not to ask the posters in the forum to provide details using the above functionality.

Regards,
Lalit
Re: USERENV legacy function in SYS_CONTEXT to get language_territory.databse_characterset [message #616421 is a reply to message #616415] Mon, 16 June 2014 14:47 Go to previous messageGo to next message
Michel Cadot
Messages: 65252
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

The problems, when they are about character set, are most of the time with SESSION character set which can't get be gotten with USERENV.
Why ask for USERENV and not "SYS_CONTEXT('USERENV'" which is the way to do it now?
SQL> select userenv('LANGUAGE') from dual;
USERENV('LANGUAGE')
----------------------------------------------------
AMERICAN_AMERICA.WE8MSWIN1252

1 row selected.

SQL> select sys_context('USERENV','lANGUAGE') from dual;
SYS_CONTEXT('USERENV','LANGUAGE')
-----------------------------------------------------------
AMERICAN_AMERICA.WE8MSWIN1252

1 row selected.

In addition, often people does not even give their Oracle version and OS or read the guide and post accordingly, don't expect they give this information (which is moreover most of the time useless for the questions).

Re: USERENV legacy function in SYS_CONTEXT to get language_territory.databse_characterset [message #616422 is a reply to message #616421] Mon, 16 June 2014 14:57 Go to previous messageGo to next message
Lalit Kumar B
Messages: 3123
Registered: May 2013
Location: World Wide on the Web
Senior Member
Michel Cadot wrote on Tue, 17 June 2014 01:17

Why ask for USERENV and not "SYS_CONTEXT('USERENV'" which is the way to do it now?

Yes, I agree. I too said the USERENV function in SYS_CONTEXT.

Quote:

In addition, often people does not even give their Oracle version and OS or read the guide and post accordingly, don't expect they give this information (which is moreover most of the time useless for the questions).

Once again, I agree. But often we need the Oracle version and OS details, since the solutions might differ. My only concern is whether or not to ask the posters(who doesn't know much about nls parameters) to provide details using USERENV function in SYS_CONTEXT in their session.

From your reply, I guess it's OK to let them use SYS_CONTEXT to provide the required details. Certainly it will help me in future.

And thanks for moving the topic to suggestions & feedback forum, even I thought a while(in fact couple of minutes Smile) before posting in General forum.
Re: USERENV legacy function in SYS_CONTEXT to get language_territory.databse_characterset [message #616440 is a reply to message #616422] Tue, 17 June 2014 00:26 Go to previous message
Michel Cadot
Messages: 65252
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Quote:
My only concern is whether or not to ask the posters(who doesn't know much about nls parameters) to provide details using USERENV function in SYS_CONTEXT in their session.


There is no problem to ask for more information if it helps to solve the issue.

Previous Topic: IE hack and spam link
Next Topic: URLs in Detailed Forum Guide do not work as links
Goto Forum:
  


Current Time: Thu Dec 14 07:56:08 CST 2017

Total time taken to generate the page: 0.01700 seconds