How to get client machine name from database ? [message #345590] |
Thu, 04 September 2008 04:49  |
shahmayur
Messages: 22 Registered: November 2007 Location: London, UK
|
Junior Member |
|
|
Hiya
As part of the user authentication in our application, the requirement is that if a user has logged in from one machine, the same user cannnot login from different machine at the same time.
In Forms6i, we had accomplished this using the following query:
Select Terminal
From v$session
Where username = v_username
And terminal <> v_terminal;
where
v_username = USER -> Oracle Forms Reserve Word
v_terminal = Client_Win_API_Environment.Get_Windows_Username
In Forms 6i, the Terminal column of V$Session used to return the name of the local client machine.
However, in Forms 10g, it returns the machine name on which Oracle Application Server is installed, which I believe is correct.
So my question is how do we get the client machine name from database in the context of Oracle Forms 10g ? Is there another view/table or database package that returns the client machine name ?
Your suggestions/comments will be much appreciated.
Cheers
Mayur
|
|
|
Re: How to get client machine name from database ? [message #345608 is a reply to message #345590] |
Thu, 04 September 2008 05:10   |
|
Quote: | In Forms6i, we had accomplished this using the following query:
Select Terminal
From v$session
Where username = v_username
And terminal <> v_terminal;
where
v_username = USER -> Oracle Forms Reserve Word
v_terminal = Client_Win_API_Environment.Get_Windows_Username
|
I'm sure you couldnt have done this cuz Client_Win_API_Environment is used in 10g not by 6i.
Client_Win_API_Environment.Get_Computer_Name will get the computer name for you.
|
|
|
Re: How to get client machine name from database ? [message #345615 is a reply to message #345590] |
Thu, 04 September 2008 05:26   |
shahmayur
Messages: 22 Registered: November 2007 Location: London, UK
|
Junior Member |
|
|
Hi Mudabbir
Many thanks for your quick reply.
Yes, I know Client_Win_API_Environment is not available in Forms 6i. In Forms 6i, we were using Win_API_Environment.Get_Windows_Username.
What I meant to say in my original thread was that if we use the query in Forms 6i,
Select Terminal
From v$session;
it returns the client machine name, for e.g. "MC0001", if you have executed this query from "MC0001".
But if you execute the same query from "MC0001" from Forms 10g, you will get the machine name on which you have installed Oracle Forms Services 10g.
Hope this will clear the ambiguity.
Cheers
Mayur
|
|
|
Re: How to get client machine name from database ? [message #345628 is a reply to message #345615] |
Thu, 04 September 2008 05:47   |
|
But ofcourse you will get the Application server name when you execute that command.
When you are running a 10g Form, The client is only a thin client and processing is done on Application Server. so it would be as if you would be executing the sql command on the Application Server.
I hope you understood what i am pointing at.
Mudabbir
|
|
|
|
|