代码如下
declare l_ip varchar2(15); begin if OWA_UTIL.GET_CGI_ENV('X-FORWARDED-FOR') is not null then l_ip:= OWA_UTIL.GET_CGI_ENV('X-FORWARDED-FOR'); else l_ip:= OWA_UTIL.GET_CGI_ENV('REMOTE_ADDR'); end if; end;