I have the following structure: (Sorry for awkward names, it is because it is a sqlite database for my iPhone app which is not released yet)
CREATE TABLE klb
Foreign key support is not enabled in SQLite by default. You need to enable it manually each time you connect to the database using the pragma:
PRAGMA foreign_keys = ON
Do you have foreign key support enabled?
query PRAGMA foreign_keys = ON; to turn it on
PRAGMA foreign_keys = ON;