javasqldb2sqlj

Get the number of affected rows in SQLJ update statement


I am executing an update statement through SQLJ:

#sql [connCtx] {
    UPDATE
        MYTABLE 
    SET
        MYCOLUMN = null
    WHERE
       MYCOLUMN IS NOT NULL
};

Is there a way to retrieve the number of affected rows?


Solution

  • without having your java code I think that is the correct way:

    System.out.println(exec_context.getUpdateCount( ));