Home » Developer & Programmer » Forms » How to get client machine name from database ? (Forms 10.1.2.0.2, Oracle 10.2.0.3.0)
How to get client machine name from database ? [message #345590] Thu, 04 September 2008 04:49 Go to next message
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 Go to previous messageGo to next message
mudabbir
Messages: 235
Registered: April 2006
Location: Kuwait
Senior Member

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 Go to previous messageGo to next message
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 Go to previous messageGo to next message
mudabbir
Messages: 235
Registered: April 2006
Location: Kuwait
Senior Member

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
Re: How to get client machine name from database ? [message #345631 is a reply to message #345590] Thu, 04 September 2008 05:58 Go to previous messageGo to next message
shahmayur
Messages: 22
Registered: November 2007
Location: London, UK
Junior Member
Yes I understood you and you are right in your point.

But I am not interested to get the Application Server name.

All I want is client machine name from database.

Cheers
Mayur
Re: How to get client machine name from database ? [message #345636 is a reply to message #345631] Thu, 04 September 2008 06:16 Go to previous message
mudabbir
Messages: 235
Registered: April 2006
Location: Kuwait
Senior Member

Quote:
Client_Win_API_Environment.Get_Computer_Name will get the computer name for you.


Previous Topic: OC4J Instance
Next Topic: How to get data in multi item blocks when linked to single item block
Goto Forum:
  


Current Time: Wed Dec 07 18:36:22 CST 2016

Total time taken to generate the page: 0.23518 seconds