• 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
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Getting array of Oracle Objects

 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I am using CallableStatements . The Oracle object I have is testobjtype and the package is testpkg. How do I register the outParameter of a varray type? I am getting error when I create a ArrayDescriptor ...

The code is below.

OracleCallableStatement callableStatement = (OracleCallableStatement)
con.prepareCall ("{ ? = call TESTPKG.testf(?)}");

callableStatement.setString(2, "test");

Object elements[] = new Object[20];

ArrayDescriptor desc = ArrayDescriptor.createDescriptor("TYPE_VARRAY", con);
/*
I tried with this also
ArrayDescriptor desc = ArrayDescriptor.createDescriptor("testobjtype", con);
*/

ARRAY newArray = new ARRAY(desc, con, elements);
callableStatement.registerOutParameter(1, OracleTypes.ARRAY, "newArray");
callableStatement.execute();

ResultSet rs = (ResultSet)callableStatement.getObject (1);

ERROR:
SQLException java.sql.SQLException: invalid name pattern: TEST.TYPE_VARRAY
java.sql.SQLException: invalid name pattern: TEST.TYPE_VARRAY
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
at oracle.jdbc.oracore.OracleTypeADT.initMetadata(OracleTypeADT.java:424)
at oracle.jdbc.oracore.OracleTypeADT.init(OracleTypeADT.java:343)
at oracle.sql.ArrayDescriptor.initPickler(ArrayDescriptor.java:1002)
at oracle.sql.ArrayDescriptor.<init>(ArrayDescriptor.java:132)
at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:97)
at com.busch.wms.interfaces.TestVarray.main(TestVarray.java:75)
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic