sir_arcturua — 2011-11-07T13:59:41-05:00 — #1
I have created a MySQL database wuth the following tables and relationships:
Using "load data local infile" instructions, I have loaded data in Schools, Classes and Books.
When try to do it for Lists table, the following error message is generated:
1452 - Cannot add or update a child row: a foreign key constraint fails (
Lists_ibfk_1 FOREIGN KEY (
Any help would be very appreciated.
Thanks a lot.
r937 — 2011-11-07T14:58:41-05:00 — #2
the message means that one of the rows you're loading into the lists table has a value in the ClassID column that isn't in the classes table
sir_arcturua — 2011-11-07T15:09:26-05:00 — #3
Here is the file I intended to load into Lists table:
And the classes table is:
I see there is classes with identifiers from i to 73 in both files.
Thanks a lot!!!
r937 — 2011-11-07T21:13:34-05:00 — #4
how do i know which columns are supposed to reference which columns?