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 -> Help - Long Raw column and Stored Procedure from JDBC

Help - Long Raw column and Stored Procedure from JDBC

From: The Nomad <nobody_at_nowhere.com>
Date: Mon, 07 May 2001 15:55:22 GMT
Message-ID: <KzzJ6.169184$fs3.28595292@typhoon.tampabay.rr.com>

Hey all,

I have a table defined with a LONG RAW column. I'll need to store at least 500k in this field. To insulate the Java application from differences in RDBMS' (we have to support MSSQL, DB2 and Oracle), I have all updates and queries going through Stored Procedures/Stored Functions.

The problem I'm having is this: I'm using callableStatement.setBinaryStream to set the data in the LONG RAW Field. However, when there is more than 32k of data to set, Oracle is complaining with:

java.sql.SQLException: ORA-01460: unimplemented or unreasonable conversion requested

Looking that up, I don't see anything remotely concerning my problem.

How can I send this much data to a LONG RAW - it's supposed to handle values as large as 2GB - what's with a 32k limit?

I've also tried converting the field to a BLOB - but I get the message:

java.sql.SQLException: ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'ENTRYATTR_ADDUPD' ORA-06550: line 1, column 7:
PL/SQL: Statement ignored

The code looks like this:

...

      CallableStatement cs = con.prepareCall("{call ENTRYATTR_ADDUPD(?, ?, ?, ?, ?, ?, ?, ?)}");

...

      InputStream theBlob = new ByteArrayInputStream(getBinaryValue());
      cs.setBinaryStream(8, theBlob, binaryValue.length);
      cs.executeUpdate();


According to the JDBC Developers Guide:

Important: The JDBC 2.0 specification states that PreparedStatement methods setBinaryStream() and

setObject() can be used to input a stream value as a BLOB, and

that the PreparedStatement methods setAsciiStream(),

setUnicodeStream(), setCharacterStream(), and

setObject() can be used to input a stream value as a CLOB. This

bypasses the LOB locator, going directly to the LOB data itself.

In the implementation of the Oracle JDBC drivers, this functionality

is supported only for a configuration using an 8.1.6 and higher

database and 8.1.6 and higher JDBC OCI driver. Do not use this

functionality for any other configuration, as data corruption may

result.

I'm using the Oracle 8.1.7 OCI driver. What is wrong? Help!!!!! Received on Mon May 07 2001 - 10:55:22 CDT

Original text of this message

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