I am working in SQLite database for Iphone App.In Objecitve my following query is getting failed because of the value "This is user's profile" as it contains single quote.
INSERT INTO TEST(Code,Desc) VALUES开发者_运维知识库('Test','This is user's profile')
Because of the String my insert query is going failed.
Please suggest a solution
Thanks, Shradha harne
Oddly, to escape single quotes you have to add an other single quite 'This is a user''s profile'
Replace occurrence of ' with '' in your string and pass the value to your query,
i.e. INSERT INTO TEST(Code,Desc) VALUES('Test','This is user''s profile')
You could try to double the apostrophe sign in your text (i.e. '' instead of ').
精彩评论