I have to run a very simple query like this in SQLite3.
INSERT OR REPLACE INTO tblPhoneList(Phone, PeopleId, StorageType) VALUES('+91912345789', '1','1');
But whatever I do, the number is stored as 91912345789. The + prefix is ignored.
The field Phone is a String. Why does it ignore the + prefix?
Is there anyway to avoid this?
P.S. This code is run inside Android
EDIT:
This is the schema of the table
CREATE TABLE tblPhoneList(Phone STRING PRIMARY KEY ON CONFLICT REPLACE, StorageT
ype INTEGER, PeopleId INTEGER, FOREIGN KEY(PeopleId) references tblPeople(id));
<UPDATE> from the manual:
so please change the type of this column to
TEXT, and you should be done. </UPDATE END>what is the type of your
Phonecolumn (tryPRAGMA table_info (tblPhoneList))?. if it isTEXT(orBLOB), you shouldn’t have any problems – just tried this here. if it isINTEGERorREAL, you should convert it toTEXT– you cannot expect anINTEGERorREALcolumn to store the+string.for all the details, see Datatypes In SQLite Version 3.