Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1012
  • Last Modified:

nls_calendar for a specific user

I am having oracle 7.3.4 on UNIX. Clients connect from several places
on a Win2k server thru terminal services which has the Runtime Modules installed.
The problem is that a new user now is using a different NLS_CALENDAR
Is there a way I can tell the Win2k, or Oracle that this user must use a specific NLS?
If I want to change his logon form to change the session's nls, is that possible?
Ehab
0
Ehab Salem
Asked:
Ehab Salem
  • 5
  • 4
  • 3
  • +1
1 Solution
 
AllaICommented:
If the client sets NLS parameters, they override the server in all cases. So if you want the client to use specific NLS setting, you have to set it in the registry on the client or to put an "alter session set nls_calendar=..." in your Forms application right after connect.
0
 
Ehab SalemAuthor Commented:
All clients are accessing one server thru Terminal Service and the registry of the server is the one that affects the sessions not the clients. You got my point
0
 
pennnnCommented:
Is the new user a new Oracle user? If you have a way to indentify him, then you can put the "alter session set nls_calender..." statement in your form. Please let us know more details about how you identify the user and if you can modify the form to do that?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
AllaICommented:
I don't know exactly how to administer Win2K Terminal Services, but I'm sure that there's a possibility to set NLS_CALENDAR for each user on the Windows server, so this parameter will override the global setting in the registry.
0
 
Ehab SalemAuthor Commented:
Thanks for your replies.
Pennnn, If you know a way to change to nls_calendar for a user at startup in the Forms that would solve my problem. I tried it but I couldn't because the DMS command alter_session.set_nls is only feasible from an anonymous block only, that's from sqlplus only as far as I know.
The user is also a different oracle user than the others.
Allal: I tried in the hkey_current_user but it didn't work at all.
0
 
pennnnCommented:
The alter session command can't be executed in PL/SQL, but you can use FORMS_DDL to execute it. The syntax is:
FORMS_DDL('alter session set nls_calendar = ..... ');

Hope that helps!
0
 
Ehab SalemAuthor Commented:
i TRIED FORMS_DLL BUT IT HAS NO EFFECT, JUST AS IS DBMS_SESSION.SET_NLS... NO EFFECT AT ALL
0
 
pennnnCommented:
Can you please post the portion your code where you execute the FORMS_DDL statement. There might be some other reason that it doesn't work - wrong syntax, etc.
Have you tried the alter session command in SQL*Plus just to see if the syntax of the command is correct?
0
 
Ehab SalemAuthor Commented:
1- In Sql it is working ok, the command is as follows:
dbms_session.set_nls('nls_calendar','GREGORIAN');
Forms is not giving any error during runtime or compile, but it doesn't take the nls I am writing, unlike in Sqlplus.
0
 
AllaICommented:
What's about your NLS_LANG setting for the clients? Other NLS parameters in the client environment are ignored if NLS_LANG is not set.
And, in what trigger you call dbms_session.set_nls?
0
 
MoondancerCommented:
Please update and finalize this question.  I am happy to help split points or otherwise help you with special handling needs.  Expert input always appreciated.
Moondancer - EE Moderator
0
 
pennnnCommented:
Moondancer, nobody provided an answer so nobody should get the points...
Final comment on the question (in case someone is still interested):
Changing the NLS settings using ALTER SESSION or DBMS_SESSION changes the server NLS settings. Unfortunately the Forms on Windows are using only the NLS settings stored in the Windows registry. The registry can be read in runtime (using d2kwutl.pll) but I'm not sure if one can modify it, and even if it can be modified, the Form has already started and initialized using the current settings.
The only solution would be to try and run a scriptprogram BEFORE starting the From. The script would prompt the user for an ID and based on it would modify the Windows registry... I'm not sure if that can be implemented and how...
Hope that helps!
0
 
MoondancerCommented:
Thank you for going that extra mile to help here, I have finalized this.  If Asker returns with needs for clarification, please respond.
Moondancer - EE Moderator
0
 
Ehab SalemAuthor Commented:
I solved my problem in the following way:
1- I exported the registry key with the first calendar(cal1.reg)
2- I changed the registry to the second calendar
3- I exported the registry with the 2nd calendar (cal2.reg)
4- Instead of opening the Form, I changed the Environment of the users to start a script that will import the cal1.reg if the user is using the 1st calendar. If the user is using the 2nd calendar the script will import cal2.reg.

Thanks for all of you
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

  • 5
  • 4
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now