dbTalk Databases Forums  

PLS-00382 expression is of wrong type

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss PLS-00382 expression is of wrong type in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Tim Slattery
 
Posts: n/a

Default PLS-00382 expression is of wrong type - 08-11-2011 , 10:24 AM






I'm getting a PLS-00382 error and cannot decrypt the message.

I'm invoking a synonym of a function from a java program. This
database has recently been jiggled so that instead of directly
invoking the function, I have to call a synonym. The synonym is
(apparently) properly defined, when I do:

select SOII_getSurveyControl from dual;

in SQLDeveloper, I get correct results. But when I invoke it from
Java, I get the error. The Java code has not changed from when I was
invoking the function directly instead of the synonym. It looks like
this:

CallableStatement sproc_stmt = dbConnection.prepareCall("{? = call
SOII_getSurveyControl}");
sproc_stmt.registerOutParameter(1, OracleTypes.CURSOR);
sproc_stmt.execute();
result = (ResultSet)sproc_stmt.getObject(1);

It blows up trying to run the execute() method. The exact error being
reported is:

java.sql.SQLException: [BEA][Oracle JDBC Driver][Oracle]ORA-06550:
line 1, column 18:
PLS-00382: expression is of wrong type
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored

It references two columns in line 1, neither of which makes any sense.

--
Tim Slattery
Slattery_T (AT) bls (DOT) gov
http://members.cox.net/slatteryt

Reply With Quote
  #2  
Old   
joel garry
 
Posts: n/a

Default Re: PLS-00382 expression is of wrong type - 08-11-2011 , 11:27 AM






On Aug 11, 8:24*am, Tim Slattery <Slatter... (AT) bls (DOT) gov> wrote:
Quote:
I'm getting a PLS-00382 error and cannot decrypt the message.

I'm invoking a synonym of a function from a java program. This
database has recently been jiggled so that instead of directly
invoking the function, I have to call a synonym. The synonym is
(apparently) properly defined, when I do:

select SOII_getSurveyControl from dual;

in SQLDeveloper, I get correct results. But when I invoke it from
Java, I get the error. The Java code has not changed from when I was
invoking the function directly instead of the synonym. It looks like
this:

CallableStatement sproc_stmt = dbConnection.prepareCall("{? = call
* * * SOII_getSurveyControl}");
sproc_stmt.registerOutParameter(1, OracleTypes.CURSOR);
sproc_stmt.execute();
result = (ResultSet)sproc_stmt.getObject(1);

It blows up trying to run the execute() method. The exact error being
reported is:

java.sql.SQLException: [BEA][Oracle JDBC Driver][Oracle]ORA-06550:
line 1, column 18:
PLS-00382: expression is of wrong type
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored

It references two columns in line 1, neither of which makes any sense.

--
Tim Slattery
Slatter... (AT) bls (DOT) govhttp://members.cox.net/slatteryt
No idea about any of this stuff, but I do note maybe you have a
scoping error (perhaps some combo of jdbc and synonyms), see MOS
1019403.102 for what I'm referring to. Searching on the two errors
with && between them on MOS may give other clues.

Also googling +ORA-06550 +PLS-00382 +jdbc gives things like
http://forums.oracle.com/forums/thre...hreadID=936149 which
refers to workarounds for some jdbc limitations.

jg
--
@home.com is bogus.
http://www.itproportal.com/2011/08/1...700-employees/
Expect recruiting spam on twitter.

Reply With Quote
  #3  
Old   
Tim Slattery
 
Posts: n/a

Default Re: PLS-00382 expression is of wrong type - 08-11-2011 , 12:38 PM



joel garry <joel-garry (AT) home (DOT) com> wrote:


Quote:
No idea about any of this stuff, but I do note maybe you have a
scoping error (perhaps some combo of jdbc and synonyms), see MOS
1019403.102 for what I'm referring to. Searching on the two errors
with && between them on MOS may give other clues.
I've solved it. This is a web system running under a WebLogic server.
I was using a Weblogic driver in my connection pool, when I switched
to an Oracle driver the problem vanished.

--
Tim Slattery
Slattery_T (AT) bls (DOT) gov
http://members.cox.net/slatteryt

Reply With Quote
  #4  
Old   
Robert Klemme
 
Posts: n/a

Default Re: PLS-00382 expression is of wrong type - 08-13-2011 , 04:56 AM



On 11.08.2011 19:38, Tim Slattery wrote:
Quote:
joel garry<joel-garry (AT) home (DOT) com> wrote:


No idea about any of this stuff, but I do note maybe you have a
scoping error (perhaps some combo of jdbc and synonyms), see MOS
1019403.102 for what I'm referring to. Searching on the two errors
with&& between them on MOS may give other clues.

I've solved it. This is a web system running under a WebLogic server.
I was using a Weblogic driver in my connection pool, when I switched
to an Oracle driver the problem vanished.
Then the reason was OracleTypes.CURSOR which is specific to Oracle.
With JBoss similar things can happen: the JEE container wraps JDBC
connections with its own wrapper class to be able to cache
PreparedStatement and handle XA logic. Whenever you need functionality
which is specific to the real driver used underneath you need to obtain
the wrapped connection and work with that.

Kind regards

robert

--
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.