Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2004
    Posts
    13

    Unanswered: 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)

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Have you tried execute() instead of executeUpdate()?

  3. #3
    Join Date
    Oct 2004
    Posts
    13
    Yes. Then it actually fails on the "execute" (not after it)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •