[Koha] bulk import of authorised values?
Peter Huerter
pete.huerter at gmail.com
Sat Nov 27 05:24:32 NZDT 2010
Is there a way to do a bulk import of "authorized values"? I have not been
able to find KOHA user interface support for this.
If there is no user interface support for this, then can I *safely* add new
authorised values to the SQL authorised_values table directly?
I am wondering if I can do something like this:
In MYSQL, to add a new "MILITARY" authorised value to LOC:
1. SELECT * from authorised_values;
And determine the next 'id' available, call it <id> in what follows.
2. INSERT INTO authorised_values
VALUES (<id>, 'LOC', 'military', 'MILITARY', NULL);
Thanks,
Pete.
Context:
Specifically, I'm interested in adding "LOC" authorized values. I've added
two such values manually using the KOHA interface (Home › Administration ›
Authorized values). They are called "RARE", and "MILITARY".
These values are making it into the following SQL table:
(To dump all LOC authorised values I do this ..)
mysql> select * from authorised_values where category = "LOC";
+----+----------+------------------+----------------------+----------+
| id | category | authorised_value | lib | imageurl |
+----+----------+------------------+----------------------+----------+
| 12 | LOC | FIC | Fiction | NULL |
| 13 | LOC | CHILD | Children's Area | NULL |
| 14 | LOC | DISPLAY | On Display | NULL |
| 15 | LOC | RARE | Rare book collection | |
| 16 | LOC | STAFF | Staff Office | NULL |
| 17 | LOC | GEN | General Stacks | NULL |
| 18 | LOC | AV | Audio Visual | NULL |
| 19 | LOC | REF | Reference | NULL |
| 31 | LOC | military | Military | |
+----+----------+------------------+----------------------+----------+
9 rows in set (0.00 sec)
(To dump the structure of authorised_value table I do this ..)
mysql> show columns from authorised_values;
+------------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------------+--------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| category | varchar(10) | NO | MUL | | |
| authorised_value | varchar(80) | NO | | | |
| lib | varchar(80) | YES | | NULL | |
| imageurl | varchar(200) | YES | | NULL | |
+------------------+--------------+------+-----+---------+----------------+
5 rows in set (0.00 sec)
mysql>
--
View this message in context: http://koha.1045719.n5.nabble.com/bulk-import-of-authorised-values-tp3281514p3281514.html
Sent from the Koha - Discuss mailing list archive at Nabble.com.
More information about the Koha
mailing list