SQLite.不能添加超过1000行 [英] SQLite. Can't add more than 1000 rows
本文介绍了SQLite.不能添加超过1000行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试将10k行添加到我的SQLite数据库(带有fmdb),但在1000行上停止写入.而且我没有任何错误或警告.我的代码:
I'm trying to add to my SQLite database (with fmdb) 10k rows but writing is stopped on 1000 row. And I have no any errors or warnings. My code:
NSString *queryString = [NSString stringWithFormat:@"insert into histories (storyid, text, date, storyurl) values (%li, ?, ?, ?)",history.storyIndex];
if ([self.db open]) {
if([self.db executeUpdate:queryString, history.storyText, history.storyDate, history.storyUrl]) {
NSLog(@"history added");
}
}
有什么建议吗?
推荐答案
您可以尝试以下代码,看看是否有任何更改:
Can you try the following code and see if there is any change:
NSString *queryString = @"INSERT INTO histories (storyid, text, date, storyurl)
VALUES ( ?, ?, ?, ?)";
BOOL executeUpdateStatus = NO;
if ([self.db open])
{
executeUpdateStatus = [self.db executeUpdate:queryString,
[NSNumber numberWithLong:history.storyIndex], history.storyText,
history.storyDate, history.storyUrl];
if(executeUpdateStatus == YES)
NSLog(@"history added");
else
NSLog(@"history NOT added");
}
这篇关于SQLite.不能添加超过1000行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文