Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

UTL_TCP.OPEN_CONNECTION RETURNS ORA-20002: INVALID ARGUMENT

Posted on 2002-05-31
8
Medium Priority
?
1,735 Views
Last Modified: 2008-02-20
SQL> set serveroutput on size 100000
SQL> Declare
2 con UTL_TCP.connection;
3 ret PLS_INTEGER;
4 Begin
5 con := UTL_TCP.open_connection ('c7pc1248',7788);
6 dbms_output.put_line('Connection Opened');
7 UTL_TCP.close_connection(con);
8 dbms_output.put_line('Fini.');
9 exception
10 when others then
11 UTL_TCP.close_all_connections;
12 raise;
13 End;
14 /
Declare
*
ERROR at line 1:
ORA-20002: Invalid argument
Invalid argument
ORA-06512: at line 12
.
.
Note that UTL_SMTP works fine from the same server.

Any ideas?
0
Comment
Question by:rkogelhe
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 4

Expert Comment

by:asimkovsky
ID: 7046745
The RAISE keyword should not be there.


Andrew
0
 
LVL 4

Expert Comment

by:jtrifts
ID: 7047073
To elaborate on Andrew's comment...the raise statement "RAISE;" is inappropriate for an anonymous PL/SQL block.  It's intended use is to propagate an error back to the calling procedure (which does not exist in an anonymous block).
Regards,
JT
0
 
LVL 3

Expert Comment

by:mnicoras
ID: 7047208
Hi,

first of all I want to say that's really strange guys to say that RAISE is the problem here!!! hey, come-on, you must be kidding!

I'm just looking to the error and it's 20002 which means that is a user-defined exception inside utl_tcp package. So I think that probably the utl_tcp is not proper installed. Did you installed directly from the kit or take it from another server type!!! It's about CRLF I think!

Anybody has another suggestion,
Marius Nicoras
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
LVL 3

Author Comment

by:rkogelhe
ID: 7047325
It was installed during the install of Oracle 8.1.7 on HP/UX 11.

I think I agree that it is probably an installation problem as it worked from a Win2000 install of 8.1.7. I wonder if there is an easy way to reinstall it.
0
 
LVL 1

Expert Comment

by:Pakshay
ID: 7048335
Try running the initplsj.sql as SYS to make necessary Java components accessible via PL/SQL

Pradeep
0
 
LVL 5

Expert Comment

by:sora
ID: 7050370
I ran your code exactly as you posted it, just changed the server name to my SMTP server and it worked just fine!!


zgeda1_GEDAC2> Declare
  2   con UTL_TCP.connection;
  3   ret PLS_INTEGER;
  4   Begin
  5   con := UTL_TCP.open_connection ('www.xxx.com',25);
  6   dbms_output.put_line('Connection Opened');
  7   UTL_TCP.close_connection(con);
  8   dbms_output.put_line('Fini.');
  9   exception
 10   when others then
 11   UTL_TCP.close_all_connections;
 12   raise;
 13  End;
 14  /
Connection Opened
Fini.

PL/SQL procedure successfully completed.



sora
0
 
LVL 5

Accepted Solution

by:
sora earned 800 total points
ID: 7050371
Maybe you want to run these once again, just to make sure that all the java classes are loaded properly.


$ORACLE_HOME/javavm/install/initjvm.sql => skip if you've done this
$ORACLE_HOME/javavm/install/init_security.sql
$ORACLE_HOME/rdbms/admin/initplsj.sql



sora
0
 
LVL 3

Author Comment

by:rkogelhe
ID: 7053378
The reinstallation of the jvm did it I think. I tried just the initplsj.sql before and that didn't help.

Thanks very much all of you for your help. :)

Ryan
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…

718 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question