• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

java.sql.SQLException: invalid name pattern

 
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Bartender
Posts: 2658
19
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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"
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic