SQLite Forum

.selecttrace unknown and strange errors
Login
A1_INDEX INTEGER,
    A1_CAT VARCHAR(1) DEFAULT 'W',
These columns are defined as the primary key like this:
   CONSTRAINT A1_PK PRIMARY KEY (
        A1_INDEX,
        A1_CAT
    ),
    UNIQUE (
        A1_INDEX,
        A1_CAT
    )
Please note that there shouldn't be a need for the unique statement.

Table C1 the foreign key column is defined as
    C1_INDEX INTEGER,

and the foreign key definition is:
  CONSTRAINT C1_INDEX_FK FOREIGN KEY (
        C1_INDEX
    )
    REFERENCES A1 (
        A1_INDEX
    ),
    UNIQUE (
        C1_INDEX
    )

Result: It fails to build (Error foreign key mismatch).