Home » Fusion Middleware & Colab Suite » Weblogic & Application Server » How to get Client IP from stored Procedure/Function
How to get Client IP from stored Procedure/Function [message #438761] Tue, 12 January 2010 02:05 Go to next message
oralover2006
Messages: 123
Registered: January 2010
Location: India
Senior Member
hi all experts,

I am using Application Server 10, Database 10g, Oracle Developer Forms 10g ( NOT USING JDeveloper ).
I want to get Client IP address from a stored Procedure/Function, when using SYS_CONTEXT it returns App Server IP, WebUtil is, I have to use in Form but I want to write a stored procedure/function in DB and calling it from Form to get Client's IP address, how I can do it?? please help with an example.

thanks and regards.

[Updated on: Tue, 12 January 2010 02:07]

Report message to a moderator

Re: How to get Client IP from stored Procedure/Function [message #438763 is a reply to message #438761] Tue, 12 January 2010 02:19 Go to previous messageGo to next message
ramoradba
Messages: 2454
Registered: January 2009
Location: AndhraPradesh,Hyderabad,I...
Senior Member
Hope the following will help you...

http://dbaforums.org/oracle/index.php?showtopic=2764

http://www.oracle.com/technology/sample_code/products/forms/extracted/getclientinfo/readme.html



SQL> SELECT SYS_CONTEXT('USERENV', 'IP_ADDRESS') FROM dual;


select UTL_INADDR.GET_HOST_ADDRESS (('MACHINE_NAME')) from dual;

Re: How to get Client IP from stored Procedure/Function [message #438766 is a reply to message #438761] Tue, 12 January 2010 02:33 Go to previous messageGo to next message
oralover2006
Messages: 123
Registered: January 2010
Location: India
Senior Member
first, thanks for a very prompt reply Smile

secondly, I already mentioned about SYS_CONTEXT, its not working as I need, and for UTL_INADDR.GET_HOST_ADDRESS its working same as SYS_CONTEXT, so problem not solved...

third, I will check the links you have provided, with much thanks.

regards.
Re: How to get Client IP from stored Procedure/Function [message #438774 is a reply to message #438766] Tue, 12 January 2010 03:28 Go to previous messageGo to next message
ramoradba
Messages: 2454
Registered: January 2009
Location: AndhraPradesh,Hyderabad,I...
Senior Member
SQL> SELECT SYS_CONTEXT('USERENV', 'IP_ADDRESS') FROM dual;
it returns clients IP_ADDRESS(from which PC its executed) show me what`s your need

sriram Smile
Re: How to get Client IP from stored Procedure/Function [message #438780 is a reply to message #438774] Tue, 12 January 2010 03:47 Go to previous messageGo to next message
Littlefoot
Messages: 20897
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
ramoradba wrote on Tue, 12 January 2010 10:28
SQL> SELECT SYS_CONTEXT('USERENV', 'IP_ADDRESS') FROM dual;
it returns clients IP_ADDRESS(from which PC its executed) show me what`s your need

It does, but - when executed in Forms (@oralover2006 wants to use it in Forms) - it returns IP address of the Forms Server, not client IP address.
Re: How to get Client IP from stored Procedure/Function [message #438781 is a reply to message #438780] Tue, 12 January 2010 03:53 Go to previous messageGo to next message
ramoradba
Messages: 2454
Registered: January 2009
Location: AndhraPradesh,Hyderabad,I...
Senior Member
I am not using Forms so ....i agree.
Thats why i provided two links over there to refer...

And even hope these will help the OP.
http://kr.forums.oracle.com/forums/thread.jspa?threadID=990909

http://www.oracle.com/technology/products/forms/htdocs/webutil/webutil.htm


sriram Smile
Re: How to get Client IP from stored Procedure/Function [message #438785 is a reply to message #438781] Tue, 12 January 2010 04:16 Go to previous messageGo to next message
oralover2006
Messages: 123
Registered: January 2010
Location: India
Senior Member
Webutil also need to include .PLL and a code in Forms... but do not want this kind of solution as mentioned in first post here.

thanks ramoradba for your struggle to help me out... Smile

also thanks Littlefoot for your correct understanding. Smile

still seeking for the right solution.
Re: How to get Client IP from stored Procedure/Function [message #438787 is a reply to message #438785] Tue, 12 January 2010 04:23 Go to previous messageGo to next message
ThomasG
Messages: 3189
Registered: April 2005
Location: Heilbronn, Germany
Senior Member
To the database the Forms Server server is the client. That's the only client the database is able to see.

The only technical possible solution is the solution you "don't want".

[Updated on: Tue, 12 January 2010 04:23]

Report message to a moderator

Re: How to get Client IP from stored Procedure/Function [message #438789 is a reply to message #438787] Tue, 12 January 2010 04:29 Go to previous message
oralover2006
Messages: 123
Registered: January 2010
Location: India
Senior Member
ThomasG wrote on Tue, 12 January 2010 15:53

The only technical possible solution is the solution you "don't want".



well said dear, thanks.

[Updated on: Tue, 12 January 2010 04:30]

Report message to a moderator

Previous Topic: error with FRM-92101
Next Topic: Forms/Reports Server
Goto Forum:
  


Current Time: Wed Dec 07 06:55:44 CST 2016

Total time taken to generate the page: 0.10672 seconds