What does it mean when Statement.executeUpdate() returns -1?

前端 未结 5 2007
被撕碎了的回忆
被撕碎了的回忆 2020-12-14 07:25

A query that works in management studio and in the executeUpdatemakes that same executeUpdate return -1, which is undefined in any doc

5条回答
  •  失恋的感觉
    2020-12-14 07:40

    For executeUpdate statements against a DB2 for z/OS server, the value that is returned depends on the type of SQL statement that is being executed:

    For an SQL statement that can have an update count, such as an INSERT, UPDATE, or DELETE statement, the returned value is the number of affected rows. It can be:

    A positive number, if a positive number of rows are affected by the operation, and the operation is not a mass delete on a segmented table space.

    0, if no rows are affected by the operation.

    -1, if the operation is a mass delete on a segmented table space.

    For a DB2 CALL statement, a value of -1 is returned, because the DB2 database server cannot determine the number of affected rows. Calls to getUpdateCount or getMoreResults for a CALL statement also return -1. For any other SQL statement, a value of -1 is returned.

提交回复
热议问题