开发者

Problem with xCode programming SQL Table

开发者 https://www.devze.com 2023-03-01 05:56 出处:网络
NSString *sql = [NSString stringWithFormat:@\"CREATE TABLE IF NOT EXISTS \'%@\' (\'%@\' TEXT PRIMARY KEY, \'%@\' TEXT);\", tableName, field1, field2];
NSString *sql = [NSString stringWithFormat:@"CREATE TABLE IF NOT EXISTS '%@' ('%@' TEXT PRIMARY KEY, '%@' TEXT);", tableName, field1, field2];

I faced quite a lot of problems开发者_如何学Go with this line of programming, can anyone help me solve the problem? I'm new to Xcode. Thanks! :)


Try without the single quotes

SString *sql = [NSString stringWithFormat:@"CREATE TABLE IF NOT EXISTS %@ (%@ TEXT PRIMARY KEY, %@ TEXT);", tableName, field1, field2];
0

精彩评论

暂无评论...
验证码 换一张
取 消