Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

owa_util.get_cgi_env('REMOTE_ADDR');

632909Feb 4 2010 — edited Jul 23 2010
Hi guys,

I am using the following code for returning IP address, however it's not working as it's suppose to when I am executing my package. My main intent is to return the IP address of the user who is executing the package. When I am printing the IP address, it returns blank as shown below. Is there any settings related to Apache? Here's the code:

PROCEDURE ERROR_PROC (p_proc_name IN VARCHAR2,
p_OPERATOR IN VARCHAR2,
p_ORA_ERROR IN VARCHAR2,
p_INS_VALUES IN VARCHAR2,
p_USER_ID IN VARCHAR2 DEFAULT NULL)
IS
PRAGMA autonomous_transaction;
V_USER_ID VARCHAR2(4000);
V_IP_Address VARCHAR2(4000);
BEGIN
BEGIN
V_IP_Address:=owa_util.get_cgi_env('REMOTE_ADDR');
EXCEPTION WHEN OTHERS THEN
V_IP_Address:=NULL;
dbms_output.put_line('IP Address is:'||V_IP_Address);
END;
END;

Also, what tags to use here to enter the formatted code please? Looks like the above code will be unformatted after I submit the same here on the forum. Thanks for all your help.
This post has been answered by damorgan on Feb 4 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 20 2010
Added on Feb 4 2010
10 comments
11,232 views