I am trying to send CLOB data into a stored proc using JDBC. I am using oracle database 11g and ojdbc6.jar for driver. I am not able to send the data as it is greater than 32kb. I had tried various ways to send the data:
- Using Clob object
- Using characterStream
These all did not work for me. I got the following error: ORA-22828: input pattern or replacement parameters exceed 32K size limit
Is there some way to pass large data into oracle stored proc using jdbc(java), which may scale to 1MB. Code used is as follows:
CallableStatement cstmt = null;
String formedStr = "{CALL MAIL_PROC(?)}";
//Preparing statement
cstmt = con.prepareCall(formedStr);
cstmt.setCharacterStream(1, new StringReader(info.getContent()), info.getContent().length());
cstmt.execute();
setString()- more recent driver versions (11.x - you didn't specify your version) should handle that correctly. Another possibility is that the stored procedure somehow converts theCLOBto aVARCHARand while doing that, the error is thrown inside the procedure, not when passing the value.