0
基本上我必須輸入數據庫中的所有文本字段值,然後必須用於發送到webservice。因此,當一列詳細信息發送到服務時,必須刪除該列。 我已經這樣做了:從Sqlite數據庫刪除列
-(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);
}
但它發送後沒有刪除。爲什麼它不打電話? 給我出出主意..