Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Passing an array to a Stored Procedure yield "Fail to convert to internal representation" (ORA-17059)

Passing an array to a Stored Procedure yield "Fail to convert to internal representation" (ORA-17059)

From: Soeren Gerlach <soeren_at_all-about-shift.com>
Date: 12 Nov 2004 07:29:18 -0800
Message-ID: <9a61a4db.0411120729.713307b0@posting.google.com>


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:



CREATE TYPE "DIVIDEND_DETAIL_OBJECT" AS OBJECT (
"HV_DAY" NUMBER(8, 0),
"EX_DAY" NUMBER(8, 0),
"PAY_DAY" NUMBER(8, 0),
"AMOUNT" FLOAT(64) );
CREATE TYPE "DIVIDEND_DETAIL_COLLECTION" AS    TABLE OF "DIVIDEND_DETAIL_OBJECT"; CREATE OR REPLACE PROCEDURE "SP_UPDATE_INSERT_DIVIDEND_LIST"
 (  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
curvesbeta.SP_UPDATE_INSERT_DIVIDEND_LIST(?,?,?,?,?,?,?,?)}");

      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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US