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
Regards
Kumar
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;
/
> Hi,
>
> 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
>
>
>
> Regards
>
> Kumar
Count your parenthesis.
--
Daniel Morgan
http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp
http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp
damo...@x.washington.edu
(replace 'x' with a 'u' to reply)
I think the parenthesis is correct.
dbms_output.put_line('Client Name:
'||utl_inaddr.get_host_name(sys_context('USERENV','IP_ADDRESS')));
Could you plz check it?
Thanks
Amit
<damo...@x.washington.edu> wrote in message news:<1079077597.344257@yasure>...
>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.
--
Andy Hassall <an...@andyh.co.uk> / Space: disk usage analysis tool
<http://www.andyh.co.uk> / <http://www.andyhsoftware.co.uk/space>
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 <an...@andyh.co.uk> wrote in message news:<vim650d70n4u3ms23...@4ax.com>...
I am using version 8.1.7.0.
I still got the same error.
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
Regards
Kumar
Code:
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;
Andy Hassall <an...@andyh.co.uk> wrote in message news:<vim650d70n4u3ms23...@4ax.com>...
>I am using version 8.1.7.0.
>I still got the same error.
>
>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
I don't have access to an 8i instance right now, just 9i and 10g where your
code works for me. Try just outputting the value of
sys_context('USERENV','IP_ADDRESS') on its own. And try:
select utl_inaddr.get_host_name('<put your IP address here>') from dual
... and see what it does. In other words, start cutting it down into smaller
chunks to try and isolate where the problem is.
Just do a desc on utl_inaddr and you would know your answer.
In 8i it does not take any parameters.
or just read the utlinad.sql in rdbms/admin ....
Anurag