I'd like to know how is possible to pass a BLOB to a stored procedure using
CallableStatement, I tried to use method setBinaryInputStream and setBlob
with the same result, that is:
java.sql.SQLException: ORA-06550: riga 1, colonna 12:
PLS-00306: numero o tipi di argomenti sbagliati nella chiamata di
'INSERT_SUPPORTO_BY_ID'
ORA-06550: riga 1, colonna 7:
PL/SQL: Statement ignored
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:543)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1405)
at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:822)
at
oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:1446)
at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1371)
at
oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1900)
at
oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:363)
at
oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:407)
at
com.cedac.ibkrouter.connection.ConnectionPoolUtility.executeProcedure(ConnectionPoolUtility.java:50)
at
com.cedac.ibkrouter.plugins.bt.xml.TaskDynamicJobXMLImport.backupFlow(Unknown
Source)
at com.cedac.ibkrouter.plugins.bt.xml.TaskDynamicJobXMLImport.doJob(Unknown
Source)
at com.cedac.ibkrouter.Task.run(Task.java:70)
seems that the BLOB parameter is not recognized, so type mismatch occurs.
CODE:
byte[] cbiArray=cbiContent.getBytes();
InputStream is=new ByteArrayInputStream(cbiArray);
String proc="{ ? = call
parser.insert_supporto_by_id?,?,?,?,?,?,?,?,?) }";
callableStmt = conn.prepareCall(proc);
callableStmt.registerOutParameter(1, OracleTypes.VARCHAR);
callableStmt.setObject(2, parameters[0]);
callableStmt.setObject(3, parameters[1]);
callableStmt.setObject(4, parameters[2]);
callableStmt.setObject(5, parameters[3]);
callableStmt.setObject(6, parameters[4]);
callableStmt.setObject(7, parameters[5]);
callableStmt.setObject(8, parameters[6]);
callableStmt.setObject(9, parameters[7]);
callableStmt.setBinaryStream(10,is,cbiArray.length);
callableStmt.execute();
id_supporto = (String) callableStmt.getObject(1);
Stored procedure signature:
FUNCTION insert_supporto_by_id (p_id_supporto IN NUMBER,
p_location IN NUMBER,
p_abi_proponente IN VARCHAR2,
p_tipo_mittente IN VARCHAR2,
p_tipo_destinatario IN VARCHAR2,
p_codice_mittente IN VARCHAR2,
p_codice_destinatario IN VARCHAR2,
p_tipo_servizio IN VARCHAR2,
p_flusso IN BLOB) RETURN VARCHAR2;
I'm using the thin driver, oracle 8.1.7
Thanks in advance for any help!
Riccardo
==========================================================================To
unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".