This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of Real-World Software Development: A Project-Driven Guide to Fundamentals in Java and have Dr. Raoul-Gabriel Urma & Richard Warburton on-line!
See this thread for details.
Win a flower (🌹) or copy of Real-World Software Development: A Project-Driven Guide to Fundamentals in Java (📚) this week in the Agile and Other Processes forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
master stewards:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
garden masters:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
gardeners:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

java.sql.SQLException: invalid name pattern

 
Timothy Sam
pioneer
Posts: 751
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

I have a Java app accessing an oracle stored procedure. The arguments to the stored procedure include an array type. I do it like the following...



Now, I am getting this Exception...


java.sql.SQLException: invalid name pattern: MY_PKG.VARCHAR2_ARR



VARCHAR2_ARR is a TYPE I defined inside an Oracle Package like the following:



And used as such in my stored proc...



Any ideas? Thanks!
[ March 10, 2008: Message edited by: Timothy Sam ]
 
Jan Cumps
gardener
Posts: 2657
19
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
At what line does the error happen?

Can you try ArrayDescriptor.createDescriptor("MY_PKG.VARCHAR2_ARR", narrowdConn); ?

Regards, Jan
[ March 10, 2008: Message edited by: Jan Cumps ]
 
Timothy Sam
pioneer
Posts: 751
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jan,

Thanks but I've tried that before, it doesn't work. I even tried putting the schema and still it doesn't work...
 
Sebastien David
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Timothy Sam,

I would like to know if you have solved your problem. I'm currently facing the similar problem.

Thanks for your help.
 
Piyush Mattoo
pioneer
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Me Too.
My Procedure is:-
CREATE OR REPLACE PROCEDURE PROCESS_ARRAY(v_str_array IN Str_Array)
IS
TYPE Str_Array IS VARRAY(7) OF VARCHAR2(50);
v_array Str_Array;
BEGIN
FOR i IN v_str_array.first .. v_str_array.last LOOP
DBMS_OUTPUT.PUT_LINE('Output '||v_str_array(i));
END LOOP;
END;

The JDBC code to call the procedure is:-

proc_stmt = con.prepareCall("{ call PROCESS_ARRAY(?) }");
ArrayDescriptor descriptor =
ArrayDescriptor.createDescriptor("Str_Array", con);
ARRAY array_to_pass =
new ARRAY(descriptor, con, strArray);
proc_stmt.setArray(1, array_to_pass);

And i see the error- "java.sql.SQLException: invalid name pattern: <Schema-Name>.Str_Array"
 
Tad Smith
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was having the same problem. I had code like this:
storedProc.registerOutParameter(5, Types.ARRAY, "TEXT_ARRAY");

This also did not work:
storedProc.registerOutParameter(5, Types.ARRAY, schema + ".TEXT_ARRAY");

It turns out the variable schema had my schema name in lower case. This fixed my problem:
storedProc.registerOutParameter(5, Types.ARRAY, schema.toUpperCase() + ".TEXT_ARRAY");

I hope this helps,
-- Tad
 
Today's lesson is that you can't wear a jetpack AND a cape. I should have read this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!