[Koha] importing issues table

Marty ontariowolf64 at yahoo.com
Sun Feb 1 05:25:40 NZDT 2009


Thanks all, slowly I am getting Koha 3 to work. I have the patrons loaded and the biblios in. Of course I got stuck somewhere else, nothing is ever easy around here...
So how do I get the issues loaded? At the moment nobody has anything out, which is not actually the case.

I tried this:
debian:~# mysqldump Koha.issues > Koha_issues09.sql
mysqldump: Got error: 1102: Incorrect database name 'Koha.issues' when selecting the database

Then I tried this:
mysql> SELECT borrowernumber,itemnumber,date_due,branchcode,issuingbranch,returndate,lastreneweddate,return,renewals,timestamp INTO OUTFILE 'issues.csv' FIELDS TERMINATED BY ',' ENCLOSED BY '"' FROM issues;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'return,renewals,timestamp INTO OUTFILE 'issues.csv' FIELDS TERMINATED BY ',' EN' at line 1

However, it works when I remove the return table;
mysql> SELECT borrowernumber,itemnumber,date_due,branchcode,issuingbranch,returndate,lastreneweddate,renewals,timestamp INTO OUTFILE 'issues.csv' FIELDS TERMINATED BY ',' ENCLOSED BY '"' FROM issues;
Query OK, 6163 rows affected (0.16 sec)

Importing this does NOT work;
mysql> use koha;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> LOAD DATA INFILE "/home/marty/issues.csv" INTO TABLE issues FIELDS TERMINATED BY ',' ENCLOSED BY "";
ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint fails (`koha/issues`, CONSTRAINT `issues_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE SET NULL)

I also modified the table to match the issues table in Koha 3 by adding the issuedate but that doesn't seem to help either.
So I am stuck again... Any help is appreciated, as I am more a librarian than a database expert...

Thanks again,

Marty



      


More information about the Koha mailing list