Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Utl_inaddr
Hi,
I also like to say I am using version 8.1.7.0. Is that the reason, that the error comes during running this?
Thanks
Amit
utl_inaddr.get_host_name(sys_context('USERENV','IP_ADDRESS')));
> >*
> >ERROR at line 10:
> >ORA-06550: line 10, column 2:
> >PLS-00306: wrong number or types of arguments in call to 'GET_HOST_NAME'
> >ORA-06550: line 9, column 2:
> >PL/SQL: Statement ignored
> >
> >declare
> >v_gname varchar2(256);
Andy Hassall <andy_at_andyh.co.uk> wrote in message news:<vim650d70n4u3ms233rd4vtmv73icgdnsa_at_4ax.com>...
> On 11 Mar 2004 23:34:43 -0800, kumar_929_at_yahoo.co.uk (AMIT) wrote:
>
> >After running the following Pl/SQl block I am getting the following error.
> >Could some one suggest about it what’s wrong in it?
> >
> >utl_inaddr.get_host_name(sys_context('USERENV','IP_ADDRESS')));
> >*
> >ERROR at line 10:
> >ORA-06550: line 10, column 2:
> >PLS-00306: wrong number or types of arguments in call to 'GET_HOST_NAME'
> >ORA-06550: line 9, column 2:
> >PL/SQL: Statement ignored
> >
> >declare
> >v_gname varchar2(256);
> >begin
> > select global_name into v_gname from global_name;
> > dbms_output.put_line('User: '||user);
> > dbms_output.put_line('Database: '||v_gname);
> > dbms_output.put_line('Client IP: '||
> > sys_context('USERENV','IP_ADDRESS'));
> > dbms_output.put_line('Client Name: '||
> > utl_inaddr.get_host_name(sys_context('USERENV','IP_ADDRESS')));
> > dbms_output.put_line('DB Server IP: '||utl_inaddr.get_host_address);
> > dbms_output.put_line('DB Server Name: '||utl_inaddr.get_host_name);
> >end;
> >/
>
> Works fine for me, code unchanged from your post:
>
> Connected to Oracle Database 10g Enterprise Edition Release 10.1.0.2.0
> Connected as test
>
> SQL> set serveroutput on
> SQL>
> SQL> declare
> 2 v_gname varchar2(256);
> 3 begin
> 4 select global_name into v_gname from global_name;
> 5 dbms_output.put_line('User: '||user);
> 6 dbms_output.put_line('Database: '||v_gname);
> 7 dbms_output.put_line('Client IP: '||
> 8 sys_context('USERENV','IP_ADDRESS'));
> 9 dbms_output.put_line('Client Name: '||
> 10 utl_inaddr.get_host_name(sys_context('USERENV','IP_ADDRESS')));
> 11 dbms_output.put_line('DB Server IP: '||utl_inaddr.get_host_address);
> 12 dbms_output.put_line('DB Server Name: '||utl_inaddr.get_host_name);
> 13 end;
> 14 /
> User: TEST
> Database: DEV101
> Client IP: 192.168.1.14
> Client Name: excession.localhost
> DB Server IP: 127.0.0.1
> DB Server Name: testbox.localhost
>
> PL/SQL procedure successfully completed
>
>
> Your Oracle version is?
>
> Try:
>
> SQL> desc utl_inaddr.get_host_name;
> Parameter Type Mode Default?
> --------- -------- ---- --------
> (RESULT) VARCHAR2
> IP VARCHAR2 IN Y
>
> Does your version, for some reason, have a differing argument list? Perhaps it
> changed in some version.
Received on Sat Mar 13 2004 - 23:15:47 CST