DB2 Version 10.1 for Linux, UNIX, and Windows

DB2DataReader.RecordsAffected Property

Gets the number of rows changed, inserted, or deleted by execution of the SQL statement.

Namespace:
IBM®.Data.DB2®
Assembly:
IBM.Data.DB2 (in IBM.Data.DB2.dll)

Syntax

[Visual Basic]
Public ReadOnly Property RecordsAffected As Integer
[C#]
public int RecordsAffected {get;}
[C++]
public: __property int get_RecordsAffected();
[JScript]
public function get RecordsAffected() : int;

Property value

The number of rows changed, inserted, or deleted. -1 for SELECT statements; 0 if no rows were affected, or the statement failed.

Remarks

The RecordsAffected property is not set until all rows are read and you close the DB2DataReader .

The value of this property is cumulative. For example, if two records are inserted in batch mode, the value of RecordsAffected will be 2.

IsClosed and RecordsAffected are the only properties that you can call after the DB2DataReader is closed.