On 27 Sep 2011, at 11:58am, Madhan Kumar wrote: > In sqlite (version 3.7.7.1), I created two tables with foreign keys > as shown below > > CREATE TABLE [*Employee*] ( > [*EmpId*] INT NOT NULL, > [EmpName] VARCHAR2(50)); > > CREATE TABLE [*Department*] ( > [DeptID] INTEGER NOT NULL, > [DeptName] VARCHAR2(20), > [*EmpID*] INTEGER NOT NULL CONSTRAINT [FK_EMP_Dept] REFERENCES > [Employee]([*EmpId*])); > > Using sqlite Expert Tool, > I inserted a row in *Employee* Table - Success > when i want to delete the same row from Employee table - gives error > "foreign key mismatch". > > When i try to insert a row in *Department* Table, gives error "foreign key > mismatch".
Can you please show us the 'INSERT' and 'DELETE FROM' statements you are using for the records which give this problem ? Ideally, starting from a blank database, INSERT a few records then try to DELETE one and show us the error you didn't expect to get. If you can use the sqlite3 shell tool to demonstrate the problem that would be even better than using the 'Expert Tool' you are talking about. But we'll try from the Expert Tool. Simon. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users