SQLiteDatabase.TotalChangedRowCount Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Return the total number of database rows that have been inserted, updated, or deleted on the current connection since it was created.
public virtual long TotalChangedRowCount { [Android.Runtime.Register("getTotalChangedRowCount", "()J", "GetGetTotalChangedRowCountHandler", ApiSince=35)] get; }
[<get: Android.Runtime.Register("getTotalChangedRowCount", "()J", "GetGetTotalChangedRowCountHandler", ApiSince=35)>]
member this.TotalChangedRowCount : int64
Property Value
The number of rows changed on the current connection.
- Attributes
Remarks
Return the total number of database rows that have been inserted, updated, or deleted on the current connection since it was created. Due to Android's internal management of SQLite connections, the value may, or may not, include changes made in earlier transactions. Best practice is to compare values returned within a single transaction.
<pre> database.beginTransaction(); try { long initialValue = database.getTotalChangedRowCount(); // Execute SQL statements long changedRows = database.getTotalChangedRowCount() - initialValue; // changedRows counts the total number of rows updated in the transaction. } finally { database.endTransaction(); } </pre>
Java documentation for android.database.sqlite.SQLiteDatabase.getTotalChangedRowCount()
.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.