Solved

nls_calendar for a specific user

Posted on 2002-05-13
14
980 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
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
 
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

Independent Software Vendors: 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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

710 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