Reputation: 1140
I am updating my table with FMDB. How can i get total number of rows that updated. (Actually i have an issue. My update query is returning "true", even i have no data in that table.)
Thanks in Advance. :)
Upvotes: 4
Views: 2075
Reputation: 16941
You are looking for:
- (int)changes;
Used like:
FMDatabase *db = [FMDatabase databaseWithPath:@"store.db"];
if ([db executeUpdate:@"UPDATE xy SET ..."]) {
NSLog(@"Did change %d rows", [db changes]);
}
else {
// handle error
}
Upvotes: 9