Reputation: 7766
I've got a long string an sql statement, which I want to wrap onto the next line in the xcode editor, how do I wrap it round e.g.
[db executeUpdate:@"insert into test (rid, one, two, amount, startdate, recurrance) values (nil, ?, ?, ?, ?, ?)",
Upvotes: 3
Views: 1385
Reputation: 21
I had similar issue... call me paranoid.. but i like my sqlstring to look pretty and easy to trace in case something went wrong i used the stringWithFormat
example:
NSString sqlString = [NSString stringWithFormat: @"%@ %@ %@ %@ %@",
@"SELECT name, address, phone",
@"FROM whateverDatabase",
@"LEFT JOIN ...",
@"WHERE ...",
@"AND ...."];
hopefully if this is what you are looking for (i figured i posted on the wrong page... maybe here is better)
Upvotes: 0
Reputation: 170829
Try:
[db executeUpdate:@"insert into test (rid, one, two, amount, values"
" startdate, recurrance)(nil, ?, ?, ?, ?, ?)",...
Upvotes: 6