0
我有表格,其中包含圖像的名稱和URLS。如何在每次使用sqlite的情況下獲取新記錄?
[db executeQuery:"drop table ImagesTable;"];
[db executeQuery:"create table ImagesTable ('no' INTEGER PRIMARY KEY AUTOINCREMENT, 'img_name' text, 'img_url' text);"];
現在我取的記錄像這樣使用限制
NSMutableArray *recordSet=[db getRecordSet:"select * from ImagesTable limit 0,10;"];
當上述10幅圖像被下載那麼我刪除上述10個記錄,以便下次再來我有新的10條記錄,類似這
NSString *sqlQuery=[NSString stringWithFormat:@"delete from ImagesTable where no=%d;",[[[imgArr objectAtIndex:i] objectAtIndex:0] intValue]];
[db executeQuery:(char *)[sqlQuery cStringUsingEncoding:NSUTF8StringEncoding]];
[img release];
counter++;
現在我的問題是不刪除記錄我怎樣才能獲得新的記錄與10像下面 例的increament每次: - 0到10,10到20,20到30等等。提前感謝
感謝您的答覆,但我沒有固定的記錄表,將是動態的,那我該怎麼像這樣寫LIMIT 0,10,10,10,20,10,10? – jamil