wood burning stoves 2.0*
The moose likes JDBC and the fly likes java.sql.SQLException: invalid name pattern: pranaka.pre_hook_out_list Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "java.sql.SQLException: invalid name pattern: pranaka.pre_hook_out_list" Watch "java.sql.SQLException: invalid name pattern: pranaka.pre_hook_out_list" New topic
Author

java.sql.SQLException: invalid name pattern: pranaka.pre_hook_out_list

Manju Krishna
Ranch Hand

Joined: Apr 09, 2009
Posts: 48
    
    1
I am trying to call a stored procedure from java using JDBC. The stored procedure is having table type out parameter.



The Stored procedure is,


and created the type like,


When I run my jave class I get an SQLException,
java.sql.SQLException: invalid name pattern: pranaka.pre_hook_out_list

I tried going through existing forums, but did not get an answer to my current problem. Please help
Martin Vajsar
Sheriff

Joined: Aug 22, 2010
Posts: 3610
    
  60

We have a brief FAQ page on this subject.

Where does the typeName on line 30 come from? It's value is not shown. My guess is that the name is wrong (pre_hook_out_list instead of pre_hook_out_paramList), but you might also be missing a schema name there. I may be wrong, though, my experience in this area is limited.
Manju Krishna
Ranch Hand

Joined: Apr 09, 2009
Posts: 48
    
    1
I posted a different class's exception wrongly,

the exception is java.sql.SQLException: invalid name pattern: PRANAKA.pre_hook_out_paramList

and these two lines part of earlier code is not there,


Actual Class
Martin Vajsar
Sheriff

Joined: Aug 22, 2010
Posts: 3610
    
  60

Could you post the code - as you run it - again? I really cannot figure out how the code snippet in your last post relates to the rest of your code. And please make sure to show how the typeName variable is initialized, it is crucial to this question.
Manju Krishna
Ranch Hand

Joined: Apr 09, 2009
Posts: 48
    
    1
Per my last comment, the typeName variable is not used in my java class.

Re-posting all the java and SQL code


The type created as


Stored Procedure ,


Let me know od any further details
Manju Krishna
Ranch Hand

Joined: Apr 09, 2009
Posts: 48
    
    1
I changed the type Name used in below line ,



to upper case and it worked. I have the complete code which takes both IN and OUT param as a table type.

Can someone let me know on where I can post this code so that others can benefit from the same.

Cheers
Martin Vajsar
Sheriff

Joined: Aug 22, 2010
Posts: 3610
    
  60

I'm glad you worked it out, and thanks for sharing the solution!

If you want to post the code you've got now, you might do so it here.

If you want to help even more, you might update our wiki pages - either the How to use arrays of Oracle SQL objects, or add a new section to the Oracle FAQ page. Our Wiki FAQ says how to create a new page, should you need one. It's OK to include a code in the Wiki too, preferably a polished one, ie. SSCCE.

If you get into problems with editing the wiki, let me know - I'll be glad to help.
Manju Krishna
Ranch Hand

Joined: Apr 09, 2009
Posts: 48
    
    1
Posting the solution
Java Code,


SQL Table Types -



SQL Procedure,

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.sql.SQLException: invalid name pattern: pranaka.pre_hook_out_list