If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > JAVA > Function sequence error when passing CLOB to DB2 Proc

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-22-06, 11:48
stscrc stscrc is offline
Registered User
 
Join Date: Oct 2004
Posts: 13
Function sequence error when passing CLOB to DB2 Proc

I have a stored proc that takes a CLOB is an input parameter. When I try to call that proc via JDBC, I get a "Function sequence error". I've tried setting the autoCommit to false as well as a number of other things with no success.



Here's the code...

CallableStatement l_oStmt = null;
Connection l_oConn = ConnectionFactory.getConn();
l_oConn.setAutoCommit(false);

l_oStmt = l_oConn.prepareCall("{ ? = CALL EH.SAVE_COMMENT_P(?,?,?) }");
l_oStmt.registerOutParameter(1, Types.INTEGER);
l_oStmt.setInt(2, a_iItemId);
l_oStmt.setInt(3, a_iTypeId);
l_oStmt.setBinaryStream(4, ConversionUtils.toInputStream(l_sComment), l_sComment.length());
l_oStmt.executeUpdate();

while (l_oStmt.getMoreResults() || (l_oStmt.getUpdateCount() != -1) );
l_iReturnCode = l_oStmt.getInt(1);

l_oConn.commit();


Another thing that's really throwing me for a loop is that if I add "println"s between every statement, the code seems to choke after the "executeUpdate" (Note: I took out the while and l_iReturnCode statements after the executeUpdate and it still failed after the executeUpdate)
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On