Solved

nls_calendar for a specific user

Posted on 2002-05-13
14
953 Views
Last Modified: 2007-12-19
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
Comment
Question by:Ehab Salem
  • 5
  • 4
  • 3
  • +1
14 Comments
 
LVL 2

Expert Comment

by:AllaI
ID: 7007828
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
 
LVL 14

Author Comment

by:Ehab Salem
ID: 7008776
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
 
LVL 11

Expert Comment

by:pennnn
ID: 7009796
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
 
LVL 2

Expert Comment

by:AllaI
ID: 7010294
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
 
LVL 14

Author Comment

by:Ehab Salem
ID: 7013906
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
 
LVL 11

Expert Comment

by:pennnn
ID: 7015384
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
 
LVL 14

Author Comment

by:Ehab Salem
ID: 7018303
i TRIED FORMS_DLL BUT IT HAS NO EFFECT, JUST AS IS DBMS_SESSION.SET_NLS... NO EFFECT AT ALL
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 11

Expert Comment

by:pennnn
ID: 7019012
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
 
LVL 14

Author Comment

by:Ehab Salem
ID: 7019279
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
 
LVL 2

Expert Comment

by:AllaI
ID: 7020555
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
 
LVL 1

Expert Comment

by:Moondancer
ID: 7096954
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
 
LVL 11

Accepted Solution

by:
pennnn earned 200 total points
ID: 7097505
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
 
LVL 1

Expert Comment

by:Moondancer
ID: 7100897
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
 
LVL 14

Author Comment

by:Ehab Salem
ID: 7107637
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video shows how to recover a database from a user managed backup

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now