A adolleschal Member Licensed User Longtime User Feb 24, 2011 #1 Hi! I have String which includes the ' char, when i now try to insert this String in a Table i get an SQL-Error because the String must also be quoted in '. How can I "escape" the ' and / or use a Insert Statement which allows those chars? Example: MyString = "This is a ' test" SQLStmt = "INSERT INTO Testtable VALUES('" & MyString & "')" This fails because of the above written problem. Best regards Andreas
Hi! I have String which includes the ' char, when i now try to insert this String in a Table i get an SQL-Error because the String must also be quoted in '. How can I "escape" the ' and / or use a Insert Statement which allows those chars? Example: MyString = "This is a ' test" SQLStmt = "INSERT INTO Testtable VALUES('" & MyString & "')" This fails because of the above written problem. Best regards Andreas
Erel B4X founder Staff member Licensed User Longtime User Feb 24, 2011 #2 You should use ExecNonQuery2 instead of ExecNonQuery. See the tutorial for several examples: http://www.b4x.com/forum/basic4android-getting-started-tutorials/6736-sql-tutorial.html#post39108 Upvote 0
You should use ExecNonQuery2 instead of ExecNonQuery. See the tutorial for several examples: http://www.b4x.com/forum/basic4android-getting-started-tutorials/6736-sql-tutorial.html#post39108