[Koha] foreign key constraint fails when importing csv

Marty ontariowolf64 at yahoo.com
Sat Jan 31 10:09:43 NZDT 2009


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 at liblime.com> wrote:

> From: Galen Charlton <galen.charlton at liblime.com>
> Subject: Re: [Koha] foreign key constraint fails when importing csv
> To: ontariowolf64 at yahoo.com
> Cc: "koha koha" <koha at lists.katipo.co.nz>
> Date: Thursday, January 29, 2009, 1:34 PM
> Hi,
> 
> On Thu, Jan 29, 2009 at 1:05 PM, Marty
> <ontariowolf64 at 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 at liblime.com
> p: 1-888-564-2457 x709
> skype: gmcharlt


      


More information about the Koha mailing list