With a stored procedure, it would be a snap.

Larry


On 7/28/05, Juanpe <[EMAIL PROTECTED]> wrote:
Hello!

I have a problem with IBM Updatable Cursors (DB2), I need to associate
a cursor to a select sentence, to use it in another sentence (an
update sentence). The code would be the following one (SELECT FOR
UPDATE) in Java:

mCon.setAutoCommit(false);
stmt = mCon.createStatement();
stmt.setCursorName("UPDATABLESTATEMENT");
stmt2 = mCon.createStatement();
SQL = "SELECT * FROM T1 FOR UPDATE OF cod_number";
rs = stmt.executeQuery(SQL);
rs.next();
SQL2 = "UPDATE T1 set cod_number = cod_number + 1 WHERE CURRENT OF
UPDATABLESTATEMENT";
stmt2.executeUpdate(SQL2);
stmt.close();
stmt2.close();
mCon.commit ();
mCon.close();

Is possible to do this using Ibatis?

Thanks in advance.

JP

Reply via email to