Syntax error near "#5018" in android sqlite database -


in android application, have database store contacts. in that, have "number" column of "text" type.
syntax error near: "#5018" (code 1) error while executing below query:

string passednumber = "#5018"; db.delete("contact_table, "number=" + passednumber, null);


if use quotte aroung number like:
db.delete("contact_table, "number='" + passednumber + "'", null);
working properly.

my concern why giving error although have number column of text type.

because #5018 syntactically not number or other valid construct. when enclose in single quotes '#5018' becomes string literal , syntactically correct. 5018 syntactically valid numeric literal.

column type affinities have nothing literal syntax.


Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -

Python Pig Latin Translator -