1 Reply Latest reply: Dec 20, 2011 4:08 AM by Sudheendra RSS

    Getting Inconsistent catalog view error  while invoking OCI.

    905216
      Hi,

      I am using OCI calls in my java application for communicating with the Oracle database. I am facing a problem while invoking the function "CHANGE_PACKAGE".

      The problem that i'm facing is:



      e :
      java.sql.SQLException: Internal Error: Inconsistent catalog view
           at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
           at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
           at oracle.sql.StructDescriptor.initMetaData1_9_0(StructDescriptor.java:1838)
           at oracle.sql.StructDescriptor.initMetaData1(StructDescriptor.java:1782)
           at oracle.sql.StructDescriptor.isInstantiable(StructDescriptor.java:1027)
           at oracle.sql.STRUCT.<init>(STRUCT.java:126)
           at com.comviva.irancell.test.LoyaltyService.main(LoyaltyService.java:273)


      Description of the function is as follows:

      Oracle Function Script
      CREATE OR REPLACE FUNCTION CHANGE_PACKAGE
      (
      I_CHANGE_PACKAGE IN TI_CHANGE_PACKAGE,
      O_CHANGE_PACKAGE OUT T_ABILLITY_OUTPUT
      )
      RETURN NUMBER;


      CREATE OR REPLACE TYPE TI_CHANGE_PACKAGE
      UNDER T_ENTITY_ID
      (
      PACKAGE_CODE VARCHAR (7),
      REASON_CODE VARCHAR2(10)
      );



      CREATE OR REPLACE TYPE T_ENTITY_ID
      UNDER T_ABILLITY_INPUT
      (
      ENTITY_ID NUMBER(16)
      ) NOT FINAL;



      CREATE OR REPLACE TYPE T_ABILLITY_INPUT AS OBJECT
      (
      EXTERNAL_USER VARCHAR2(255),
      EXTERNAL_APPLICATION VARCHAR2(255),
      EXTERNAL_REFERENCE VARCHAR2(30)
      ) NOT FINAL;




      Below is the piece of code which i tried:


      StructDescriptor structdesc = StructDescriptor.createDescriptor("TI_CHANGE_PACKAGE", con);
      Object[] obj = new Object[structdesc.getLength()];
      obj[0] = new String("ussdapp");
      obj[1] = new String("ussdapp");
      obj[2] = new String("12345");
      obj[3] = new BigDecimal("123456789");
      obj[4] = new String("test");

      obj[5] = new String("test");
      oracle.sql.STRUCT inputobj = new oracle.sql.STRUCT(structdesc, con, obj);

      cstmt.setObject(2, obj, OracleTypes.STRUCT);
      cstmt.registerOutParameter(3, OracleTypes.STRUCT, sql_type_name);

      i'm facing the problem in the line:
      oracle.sql.STRUCT inputobj = new oracle.sql.STRUCT(structdesc, con, obj);




      Please help me out regarding this, Since i have to deliver this application on friday


      Thanks in Advance,
      Sucheth