Hi,
In my iPhone app, I'm trying to delete a row from an SQLite database. After the delete statement is executed the row seems to be deleted correctly, but after I restart the application the row is still there. I'm using the code blow to delete the record. Any idea what could be the problem?
NSString *deleteSQL = [NSString stringWithFormat:@"DELETE FROM table1 WHERE actId=%d", actId];
char *errorMsg;
if (database == nil) {
NSLog(@"ERROR db not initialized but trying to delete record!!!");
}else{
if (sqlite3_exec(database, [deleteSQL UTF8String], NULL, NULL, &errorMsg) != SQLITE_OK){
NSAssert1(0, @"Error updating tables: %s", errorMsg);
sqlite3_free(errorMsg);
return NO;
}
}
NSLog([NSString stringWithFormat:@"DELETE Successful"]);