bulk import of authorised values?
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-tp3281514... Sent from the Koha - Discuss mailing list archive at Nabble.com.
Peter, 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.
"Koha" is not an acronym, so it need not be entirely capitalized. The name comes from a Maori tradition. See http://en.wikipedia.org/wiki/Koha_(custom)
If there is no user interface support for this, then can I *safely* add new authorised values to the SQL authorised_values table directly?
Absolutely. This is how we populated our database with authorised values for our locations.
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);
Skip step 1. id will automatically be incremented. Use a query like the following: INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('LOC', 'MILITARY', 'Military'), ('LOC', 'ANOTHER', 'Another location...'); Regards, Jared Camins-Esakov -- Jared Camins-Esakov Freelance bibliographer, C & P Bibliography Services, LLC (phone) +1 (917) 727-3445 (e-mail) jcamins@cpbibliography.com (web) http://www.cpbibliography.com/
participants (2)
-
Jared Camins-Esakov -
Peter Huerter