Published in : 2022-03-01
I am using sqlite3 and created tables for the hybrid mobile applications. While executing insert query, it shows below error.
SQL error near line 16: near "s": syntax error
the line is,
INSERT INTO table_name (id, fullname) VALUES (98765, 'Robert O\'neils');
The issue is about escape character for a single quote.
I also tried double escaping the single quote (using \\\' instead of \' ), but that ain't work either.
What did I miss?
Mysql syntax: Working sqlfiddle, Replace single quote with single backward slash ("\") as given below.
INSERT INTO mytable values('98765','Robert O\'neils');
Sqlite syntax: Working sqlfiddle, Replace a single quote with another single quote.
INSERT INTO table_name (id, fullname) VALUES (98765, 'Robert O''neils');
Shilpa Date : 2022-03-02
Understood, the syntax is different in it! I see!
Join our community and get the chance to solve your code issues & share your opinion with usSign up Now