Home » Developer & Programmer » Precompilers, OCI & OCCI » OCI OBJECT CREATION IN JAVA (jdk1.6, ojdbc14.jar,solaris)
icon4.gif  OCI OBJECT CREATION IN JAVA [message #535460] Wed, 14 December 2011 04:03
sucheth
Messages: 1
Registered: December 2011
Location: Bangalore
Junior Member
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


Previous Topic: oracle Pro C (2 Merged)
Next Topic: Recompile required when upgrading from Oracle 9i to 11g
Goto Forum:
  


Current Time: Thu Nov 20 17:45:26 CST 2014

Total time taken to generate the page: 0.09194 seconds