In my android project's SqLite database I have to create a foreign key which is the primery key of the table. I wrote the sql statement as below using SQLiteManager.
CREATE TABLE OBTTourVehicleUpdate
(
TourHeaderCode INT PRIMARY KEY NOT NULL,
TourVehicleProcessCode INT NOT NULL,
VehicleCode CHAR(10),
TourStart TEXT ,
TourEnd TEXT ,
LastMilage DOUBLE,
NewMilage DOUBLE,
CONSTRAINT FOREIGN KEY (TourHeaderCode) REFERENCES OBTTourHeader(TourHeaderCode)
);
It gives me an error message saying that
Internal Error. near FOREIGN: syntax error.
The table structure of two tables are as below.
how can I fix this.