0
我想添加雙列的組合中的唯一查詢。我正在使用此功能,但這不能使Unique。請幫忙任何幫助都會有問題。Table not Alter
updateSQL = [NSString stringWithFormat:@"CREATE TABLE IF NOT EXISTS NewsData (id INTEGER PRIMARY KEY AUTOINCREMENT,NewsId TEXT ,NewsValue TEXT,Title TEXT,Region INTEGER)"];
update_stmt = [updateSQL UTF8String];
sqlite3_prepare_v2(database, update_stmt, -1, &addStatement, NULL);
sqlite3_step(addStatement);
sqlite3_reset(addStatement);
updateSQL = [NSString stringWithFormat:@"ALTER TABLE NewsData ADD UNIQUE (NewsId, Region)"];
update_stmt = [updateSQL UTF8String];
sqlite3_prepare_v2(database, update_stmt, -1, &addStatement, NULL);
sqlite3_step(addStatement);
sqlite3_reset(addStatement);