Problem regarding passing data arrays from Oracle 8 to 8i and vice versa.


[ Follow Ups ] [ Post Followup ] [ Message Board ]

Posted by 'Neelam' on June 25, 2001 at 05:45:12 EST:

Hi,

We are facing some problems while passing data from one version of Oracle to anotehr version of oracle. It will be very helpful if anybody can tell us that what mistake we are doing or if there is other way of doing the same. Details of the problem are as under.


We are selecting some data and putting it into VARRAYs from one database d1 through stored procedure, these VARRAYs are passed to Java code and put into some objects of type oracle.sql.Array.
Oracle.sql.Array are then passed as parameters to a stored procedure in another database d2.
These oracle.sql.Array are in turn put into the VARRAYs of d2 database in the stored procedure.

Case 1 : when d1 is oracle 8i and d2 is Oracle 8
We get the following error :
java.sql.SQLException: ORA-00600: internal error code, arguments: [12760], [], [
], [], [], [], [], []

Case2 : when d1 is oracle 8 and d2 is Oracle 8i
java.sql.SQLException: ORA-00902: invalid datatype

Case3 : when d1 is oracle 8i and d2 is Oracle 8i
Data gets passed properly.

Case4 : when d1 is oracle 8 and d2 is Oracle 8
Data gets passed properly.


Following is the java code we have written.

public class EGMExecution {

oracle.sql.ARRAY cQueryArray = null;
oracle.sql.ARRAY cRecordArray = null;
oracle.sql.ARRAY cFieldArray = null;
oracle.sql.Datum cDatum= null;


//This function is to get data from one database through stored procedure.

public void getDefinition() throws Exception {

Connection lQueryConnect = null;
OracleCallableStatement lQueryCall= null;


try {

String lQueryUrl = "jdbc:oracle:thin:@georacle:1521:crs";
Class.forName("oracle.jdbc.driver.OracleDriver");
lQueryConnect = DriverManager.getConnection(lQueryUrl,"egm","egm");

if (lQueryConnect != null)
{

lQueryCall = (OracleCallableStatement) lQueryConnect.prepareCall("{CALL EGM_EXECUTE(?,?,?,?,?)}");//p_extract1 t_extract
lQueryCall.registerOutParameter(2, oracle.jdbc.driver.OracleTypes.ARRAY, EGMConstants.T_QUERY_INFO_ARR_OBJ);
lQueryCall.registerOutParameter(3, oracle.jdbc.driver.OracleTypes.STRUCT, EGMConstants.T_EXTRACT_INFO);
lQueryCall.registerOutParameter(4, oracle.jdbc.driver.OracleTypes.ARRAY, EGMConstants.T_RECORD_INFO_ARR_OBJ);
lQueryCall.registerOutParameter(5, oracle.jdbc.driver.OracleTypes.ARRAY, EGMConstants.T_FIELD_INFO_ARR_OBJ);
lQueryCall.setString(1,(String)hash.get(EGMConstants.EXTRACT_NAME));
lQueryCall.execute();

cQueryArray = (oracle.sql.ARRAY)lQueryCall.getArray(2);

cDatum=(oracle.sql.Datum)lQueryCall.getObject(3);
cRecordArray = (oracle.sql.ARRAY)lQueryCall.getArray(4);
cFieldArray = (oracle.sql.ARRAY)lQueryCall.getArray(5);

}
} catch(Exception e) {
e.printStackTrace();
}
}

//In this function we pass the data got from the previous function
//as parameters to the stored procdure into another database.

public void callExecution() throws Exception {

Connection lDataConnect = null;
OracleCallableStatement lDataCall= null;

try {
EGMPropRead props = EGMPropRead.getInstance();

String lDataUrl = "jdbc:oracle:thin:@gepsserver:1521:ORA";
Class.forName("oracle.jdbc.driver.OracleDriver");
lDataConnect = DriverManager.getConnection(lDataUrl,"egm","egm");


if (lDataConnect != null)
{
lDataCall = (OracleCallableStatement) lDataConnect.prepareCall("{CALL PKG_BIJAL_COPY.PROC_EGM_EXEC(?,?,?,?,?,?,?)}");

SPExtractInfo extractInfo=new SPExtractInfo(EGMConstants.T_EXTRACT_INFO);//(SPExtractInfo)lQueryCall.getObject(3);
extractInfo.create(cDatum);
lDataCall.setString(1,(String) hash.get(EGMConstants.OUTPUT_FILE));
lDataCall.setString(2,props.getOutputDir());
lDataCall.setString(3,props.getReportDir());
lDataCall.setARRAY(4,cQueryArray);
lDataCall.setObject(5,extractInfo);
lDataCall.setARRAY(6,cRecordArray);
lDataCall.setARRAY(7,cFieldArray);
lDataCall.execute();
}
} catch (Exception e) {
e.printStackTrace();
}
}
}





Follow Ups:



Post a Followup


Name:
E-Mail:
Subject:

Message:


[ Follow Ups ] [ Post Followup ] [ Message Board ]