Suppose I have an execquery statement like this:
db1.execSQL("insert into "+TABLE_NAME+" values('"name"')");
where name is a string variable which contains an apostrophe. For example:
name = "tom's database";
In this case, I get an SQLITEexception near this statement. I am certain that this is because of that single quote.
How to modify this such that the statement does not cause a crash and the name get stored in the db with the single quote intact?
I read online that every such single quote has to be prefixed by another single quote.
Can someone provide the code for the same?