Hello, We (Addis Ababa University Libraries) have insatalled Koha 2.2.0RC1 on solaries OS. Now we are trying to add items to the biblio but it accepts the same barcode number for different items. Can any body help us? Cheers, Yohannes Mulugeta Addis Ababa University Libraries __________________________________ Do you Yahoo!? Yahoo! Mail - Easier than ever with enhanced search. Learn more. http://info.mail.yahoo.com/mail_250
On Thu, 16 Dec 2004 17:27:20 -0800 (PST), Yohannes Mulugeta <yohannesmulu@yahoo.com> wrote:
we are trying to add items to the biblio but it accepts the same barcode number for different items. Can any body help us?
you can run the following sql statement to enforce uniqueness of barcodes. alter table items change barcode barcode varchar(20) not null unique; you must of course do this from the mysql client - example $ mysql -u root -p Koha Password: ....... mysql> alter table items change barcode barcode varchar(20) not null unique; ERROR 1062: Duplicate entry '' for key 2 mysql> if you have any duplicates or empty barcodes when you try to run the sql command, it will stop with an error like this. you must fix all the duplicates before it will work. unfortunately NULL == NULL, so if you want to require that all barcodes be unique, you must also require that they be supplied (not null). that's what the error in the example above means: the first record has a null barcode, and so does the second. that's not unique! so "fixing all the duplicates" as i said above also means making sure every item has a barcode. the requirement to enter barcodes (and to have unique ones) was removed in Sept. 2003, for those who don't wish to use them in their libraries i presume (anyone else, jump in here...). you can see the changes to the code of the updater script at http://cvs.sourceforge.net/viewcvs.py/koha/koha/updater/updatedatabase?r1=1.58&r2=1.59
I have a similar problem, but regarding different items with the same barcode number but from different branches Say I have branches A and B there's an item with barcode 1234 at branch A and a completely different item at branch B with barcode 1234 both items were "bulmarkimported" into Koha If I search the catalogue for barcode '1234' I find both items, with their correspondig 'holdingbranch' *BUT* when I try to issue item 1234 ... Koha always issues item 1234 from branch A... and I never get to choose item 1234 from branch B.. changing my configuration to Branch B is useless.. Any ideas? Jared Jennings escribió:
On Thu, 16 Dec 2004 17:27:20 -0800 (PST), Yohannes Mulugeta <yohannesmulu@yahoo.com> wrote:
we are trying to add items to the biblio but it accepts the same barcode number for different items. Can any body help us?
you can run the following sql statement to enforce uniqueness of barcodes.
alter table items change barcode barcode varchar(20) not null unique;
you must of course do this from the mysql client - example
$ mysql -u root -p Koha Password: ....... mysql> alter table items change barcode barcode varchar(20) not null unique; ERROR 1062: Duplicate entry '' for key 2 mysql>
if you have any duplicates or empty barcodes when you try to run the sql command, it will stop with an error like this. you must fix all the duplicates before it will work.
unfortunately NULL == NULL, so if you want to require that all barcodes be unique, you must also require that they be supplied (not null). that's what the error in the example above means: the first record has a null barcode, and so does the second. that's not unique! so "fixing all the duplicates" as i said above also means making sure every item has a barcode.
the requirement to enter barcodes (and to have unique ones) was removed in Sept. 2003, for those who don't wish to use them in their libraries i presume (anyone else, jump in here...). you can see the changes to the code of the updater script at http://cvs.sourceforge.net/viewcvs.py/koha/koha/updater/updatedatabase?r1=1.58&r2=1.59 _______________________________________________ Koha mailing list Koha@lists.katipo.co.nz http://lists.katipo.co.nz/mailman/listinfo/koha
-- J. Martin Longo Informatica SID - UNCuyo http://sid.uncu.edu.ar
On Wed, Dec 22, 2004 at 05:20:09PM +0100, Martin Longo said:
I have a similar problem, but regarding different items with the same barcode number but from different branches
Say I have branches A and B
there's an item with barcode 1234 at branch A and a completely different item at branch B with barcode 1234
both items were "bulmarkimported" into Koha
If I search the catalogue for barcode '1234' I find both items, with their correspondig 'holdingbranch'
*BUT*
when I try to issue item 1234 ... Koha always issues item 1234 from branch A... and I never get to choose item 1234 from branch B..
Hmm, unfortunately no easy fix. Koha is built on the assumption every item you will want to circulate (issue/return) will have a unique barcode. So its going to always get the first one. This is so you can return an item at another branch and it will get its holdingrbanch set to there. IE it allows people to borrow from one branch and return at another. Barcode to Koha should be unique .. if you are going to do any issuing. As Jared said, the restriction on unique was removed earlier to allow for people who didnt have barcodes. Which was perhaps a mistake. Think of barcode as being id .. it needs to be unique, its the only way koha can tell items apart. Chris -- Chris Cormack Programmer 027 4500 789 Katipo Communications Ltd chris@katipo.co.nz www.katipo.co.nz
participants (4)
-
Chris Cormack -
Jared Jennings -
Martin Longo -
Yohannes Mulugeta