Sqlite syntax error, please tell me where it is? -
can guys please point me error? and, way, there sqlite syntax highlighter? thanks.
sqlite> .schema recordtypes create table recordtypes (record_id text primary key); sqlite> .schema headers create table headers (header_id text primary key); sqlite> sqlite> sqlite> create table record_to_headers (id integer, recordid text, foreign key(recordid) references recordtypes(record_id), headerid text, foreign key(headerid) references headers(header_id)); error: near "headerid": syntax error
i believe need define field then map them foreign keys, so:
create table record_to_headers (id integer, recordid text, headerid text, foreign key(recordid) references recordtypes(record_id), foreign key(headerid) references headers(header_id));
let me know if works.
Comments
Post a Comment