Reputation: 151
Hi I try to use SQLite Parameterized query but in the column name is a DOT (.)
INSERT INTO Data (`test.1`, `test.2`, `test.3`) VALUES (@test.1, @test.3,@test.3)
Returns
"SQL logic error or missing database near ".": syntax error"
INSERT INTO Data (`test.1`, `test.2`, `test.3`) VALUES ([@test.1], [@test.3],[@test.3])
Returns
"SQL logic error or missing database no such column: @test.1"
how can i escape the dot and still use the names as parameters!?
Upvotes: 0
Views: 2374
Reputation: 1269603
The "proper" escape character in SQLite is double quotes:
INSERT INTO Data("test.1", "test.2", "Test.3")
VALUES ([@test1], [@test3], [@test3])
Leave the .
out of the parameter name -- presumably, you have control over that.
SQLite explicitly supports the backtick for compatibility with MySQL and the square braces for compatibility with MS Access and SQL Server. (As you can see in the documentation.)
Upvotes: 3