Basically I have to enter all textfield values in database then have to use for sending to webservice. So when the one column details send to service then have to delete that column. I have done this:
-(void)deleteTableDataFromSavedDataTable:(NSString *)lastID {
NSString *sql_str=[NSString stringWithFormat:@"DELETE FROM FormInfoValues where Phone = %@",lastID];
const char *sql = [sql_str UTF8String];
if(sqlite3_open([databasePath UTF8String], &database) == SQLITE_OK)
{
NSLog(@"sql delete statement is ");
sqlite3_stmt *deleteStmt;
if(sqlite3_prepare_v2(database, sql, -1, &deleteStmt, NULL) == SQLITE_OK)
{
NSLog(@"sql delete statement is %@", deleteStmt);
if(sqlite3_step(deleteStmt) != SQLITE_DONE )
{
NSLog( @"Error: %s", sqlite3_errmsg(database) );
}
else
{
NSLog( @"row id = %lld", (sqlite3_last_insert_rowid(database)+1));
NSLog(@"No Error");
}
}
sqlite3_finalize(deleteStmt);
}
sqlite3_close(database);
}
but its not deleting after sending. Why its not calling? give me ideas..