[logging] near "value": syntax error
// 创建表
[self createWithProperies:propNames propertyTypes:propTypes];
NSMutableArray *propValue = [NSMutableArray array];
for (int i = 0; i < propNames.count; i++) {
id value = [self valueForKey:propNames[i]];
if ([value isKindOfClass:[NSString class]]) {
value = [NSString stringWithFormat:@"\"%@\"",value];
}
[propValue addObject:value];
}
NSLog(@"%@",propValue);
// 构造插入语句
NSString *insertStr = [NSString stringWithFormat:@"insert into %@ (%@) value(%@)",[self getTableName],[propNames componentsJoinedByString:@","],[propValue componentsJoinedByString:@","]];
[db executeUpdate:insertStr];
控制台打印如下:
2017-11-12 09:51:26.687829+0800 Runtime_Sqlite[1851:85839] [logging] near "value": syntax error
2017-11-12 09:51:26.688034+0800 Runtime_Sqlite[1851:85839] DB Error: 1 "near "value": syntax error"
2017-11-12 09:51:26.688147+0800 Runtime_Sqlite[1851:85839] DB Query: insert into Student (name,age) value(james,32)
这是什么错误?谁能帮我看看?