Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Passing an array to a Stored Procedure yield "Fail to convert to internal representation" (ORA-17059)
Hi,
I want to pass an array to a very simple Oracle SP, but when trying to create the ARRAY object a "Fail to convert to internal representation" SQL exception pops up. I think I've done everything allright, but Oracle thinks I didn't... ,-))
The Oracle stuff look like that:
( in_div_id IN int, in_div_version IN int, in_div_udl_id IN int, in_div_list IN dividend_detail_collection, in_check_version IN int, version_success OUT int, new_version OUT int, new_div_id OUT int )
IS
[...and so goes the SP...]
The relevant Java stuff looks like this:
public static class ddo {
int HV_DAY;
int EX_DAY;
int PAY_DAY;
float AMOUNT;
};
[...other stuff ommitted...] OracleCallableStatement cstmt = (OracleCallableStatement)oconn.prepareCall("{call
ArrayDescriptor aDesc = new
ArrayDescriptor("DIVIDEND_DETAIL_COLLECTION", oconn);
int size = 2; ddo[] elements = new ddo[size]; elements[0] = new ddo(); [...now setting the array content...] ARRAY array = new ARRAY(aDesc, oconn, elements); -----------------------------------------------------------------------
The last line in the above code throws the Java exception. Can anybody shed some light on this? As from my understanding ddo is an exact representation of the oracle type DIVIDEND_DETAIL_OBJECT and elements is a java array of this "type", but Oracle claims there's an error - but what exactly?
Any help is greatly appreciated ,-)
Soeren Gerlach Received on Fri Nov 12 2004 - 09:29:18 CST
![]() |
![]() |