Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Getting IP address of client
On Mon, 12 Oct 1998 01:03:30 GMT, tkyte_at_us.oracle.com (Thomas Kyte)
wrote:
>SQL> declare
> 2 tmp varchar2(15);
> 3 begin
> 4 tmp := owa_util.get_cgi_env( 'remote_addr' );
> 5 end;
> 6 /
>declare
>*
>ERROR at line 1:
>ORA-06502: PL/SQL: numeric or value error
>ORA-06512: at "OWS2.OWA_UTIL", line 160
>ORA-06512: at line 4
>
>
>You see, owa_util is initialized by the webserver -- if you are not using the
>webserver then owa_util has NULLS all over it and it will attempt to:
>
>....
> for i in 1 .. NUM_CGI_VARS loop
> ...
>
>but num_cgi_vars is NULL and that throws the exception...
Grrr. Thank you.
I keep trying to log this as a bug, but I get told that you're not supposed to run web procedures from within sqlplus, only via the web server.
Which of course, means that supplying the owa_util.showpage procedure makes no sense at all, since this is supposed to be run after you run your web procedure from within sqlplus.
And the fix for this (when they get round to fixing it)?
Change
num_cgi_vars number;
to
num_cgi_vars number:=0;
in the package specification for owa.
(The file is pubowa.sql)
--
Tommy Wareing
MIS Group
Learning Resources
Oxford Brookes University
01865 483389
Received on Wed Oct 14 1998 - 07:00:34 CDT