foreign key constraint fails when importing csv
Me again. Trying to get borrowers from old koha to koah 3 I get this error message; mysql> LOAD DATA INFILE "/home/marty/patronz.csv" INTO TABLE borrowers FIELDS TERMINATED BY ',' ENCLOSED BY ""; ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint fails (`koha/borrowers`, CONSTRAINT `borrowers_ibfk_1` FOREIGN KEY (`categorycode`) REFERENCES `categories` (`categorycode`)) Not sure about this foreign key constraint, did I fail to set some value in Koha?
Hi, On Thu, Jan 29, 2009 at 1:05 PM, Marty <ontariowolf64@yahoo.com> wrote:
Me again. Trying to get borrowers from old koha to koah 3 I get this error message;
mysql> LOAD DATA INFILE "/home/marty/patronz.csv" INTO TABLE borrowers FIELDS TERMINATED BY ',' ENCLOSED BY "";
ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint fails (`koha/borrowers`, CONSTRAINT `borrowers_ibfk_1` FOREIGN KEY (`categorycode`) REFERENCES `categories` (`categorycode`))
Not sure about this foreign key constraint, did I fail to set some value in Koha?
This means that there are patron categories in your data that are not defined in administration, and thus not present in the categories table. Check your data and make sure that all of the patron category codes that you use are defined. Regards, Galen - Galen Charlton VP, Research & Development, LibLime galen.charlton@liblime.com p: 1-888-564-2457 x709 skype: gmcharlt
Thanks, that worked, after some playing around (also had a space in zipcodes that threw off things a bit) Now on to the biblios... Marty --- On Thu, 1/29/09, Galen Charlton <galen.charlton@liblime.com> wrote:
From: Galen Charlton <galen.charlton@liblime.com> Subject: Re: [Koha] foreign key constraint fails when importing csv To: ontariowolf64@yahoo.com Cc: "koha koha" <koha@lists.katipo.co.nz> Date: Thursday, January 29, 2009, 1:34 PM Hi,
Me again. Trying to get borrowers from old koha to koah 3 I get
On Thu, Jan 29, 2009 at 1:05 PM, Marty <ontariowolf64@yahoo.com> wrote: this error message;
mysql> LOAD DATA INFILE
"/home/marty/patronz.csv" INTO TABLE borrowers FIELDS TERMINATED BY ',' ENCLOSED BY "";
ERROR 1452 (23000): Cannot add or update a child row:
a foreign key constraint fails (`koha/borrowers`, CONSTRAINT `borrowers_ibfk_1` FOREIGN KEY (`categorycode`) REFERENCES `categories` (`categorycode`))
Not sure about this foreign key constraint, did I fail
to set some value in Koha?
This means that there are patron categories in your data that are not defined in administration, and thus not present in the categories table. Check your data and make sure that all of the patron category codes that you use are defined.
Regards,
Galen - Galen Charlton VP, Research & Development, LibLime galen.charlton@liblime.com p: 1-888-564-2457 x709 skype: gmcharlt
participants (2)
-
Galen Charlton -
Marty