All,

I am new to SQLITE. Here's the challenge:

sqlite> .dump
BEGIN TRANSACTION;
CREATE TABLE people(
        id integer,
        nm text);
INSERT INTO "people" VALUES(1,'Jack');
INSERT INTO "people" VALUES(2,'Jill');
CREATE TABLE activity(
        aid integer,
        act  text,
        foreign key (aid) references people(id)
);
COMMIT;
PRAGMA foreign_keys=On;
sqlite> .import ac.in activity
Error: foreign key mismatch

This is ac.in

1|eat
2|sleep
3|run
1|drink
2|dream

id 3 doesn't exist, the insertion fails. Now, this was easy. what if
ac.inhad millions of rows? I am looking for some way to get a message
like "error
in line 3: foreign key mismatch".
preferably, the import would go on without actually inserting, but report
ALL errors in one pass.

Any ideas?

Thanks


-- 
Shalom Elkin
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to