This is my code:
private static final String CREATE_VISIT_TABLE =
" create table " + VISIT_TABLE +
" (tripdayid integer REFERENCES TripDay(_id)," +
" poiid integer REFERENCES POI(_id)," +
" arrival_time text not null," +
" start_time text not null," +
" visiting_duration text not null," +
" leaving_time text not null,"
" PRIMARY KEY (tripdayid, poiid));";
…but it returns an error, at the end of line:
“Syntax error on token “” PRIMARY KEY (tripdayid, poiid));””, delete this token”
I’m guessing that the syntax error isn’t coming from SQLite but from your compiler, you’re missing a
+:Your compiler sees something like this:
and doesn’t know what to do about it, the double quotes in the error message:
are the give away.
Also, that PRIMARY KEY syntax is allowed in SQLite.