[Koha] Insert textbook with MySQL stored procedures

savitra sirohi savitra.sirohi at osslabs.biz
Wed May 6 17:35:39 NZST 2009


Rudy,

Zebra takes data from the marcxml column in biblioitems table. It is best to
migrate using Marcedit (to create Marc files).

Thanks,
Savitra Sirohi
Nucsoft OSS Labs
http://www.osslabs.biz


2009/5/6 ISM KIS <Ism at kis.in>

>  I have to insert all our textbooks from a textfile.
>
> I have created the following stored procedures to do that:
>
> CREATE PROCEDURE `InsertBiblio`(IN MyTitle VARCHAR(120), IN MyEdition
> VARCHAR(120), IN MyAuthor VARCHAR(120), IN MyISBN VARCHAR(120), IN MyYear
> INTEGER(11), IN MyPublisher VARCHAR(120), IN MyVendor VARCHAR(20), IN
> MyBugetCategory VARCHAR(120), IN param9 VARCHAR(120), IN param10
> VARCHAR(120), IN param11 INTEGER(11), IN param12 INTEGER(11), IN param13
> VARCHAR(120), IN MyCost TEXT, IN param15 VARCHAR(120))
>     NOT DETERMINISTIC
>     SQL SECURITY DEFINER
>     COMMENT ''
> BEGIN
>
> declare MyBiblionumber   integer;
> declare MyBiblioitemnumber integer;
>
> insert into biblio (title,author,copyrightdate,frameworkcode)
> values(MyTitle,MyAuthor,MyYear,'BKS');
>
> set MyBiblionumber =   LAST_INSERT_ID() ;
>
> insert into biblioitems (biblionumber,isbn,itemtype)
> value(MyBiblionumber,MyISBN,'BK');
> set MyBiblioitemnumber =   LAST_INSERT_ID() ;
> select MyBiblionumber as Biblionumber, MyBiblioitemnumber as
> Biblioitemnumber ;
>
> END;
>
> CREATE PROCEDURE `InsertItem`(IN MyBiblionumber INTEGER(11), IN
> MyBiblioitemnnumber INTEGER(11), IN MyBarcode VARCHAR(120))
>     NOT DETERMINISTIC
>     SQL SECURITY DEFINER
>     COMMENT ''
> BEGIN
> insert into items (biblionumber,biblioitemnumber, barcode, homebranch)
> values(Mybiblionumber,MyBiblioitemnnumber,Mybarcode,'TextBook');
> END;
>
> But I must miss something because (after rebuild_zebra.pl) I can't find the
> textbook.
>
> *Are there more tables I have to update then (biblio, biblioitems, and
> items) ?*
>
> Rudy Wuthrich
> Kodaikanal International School
>
>
>
> _______________________________________________
> Koha mailing list
> Koha at lists.katipo.co.nz
> http://lists.katipo.co.nz/mailman/listinfo/koha
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.katipo.co.nz/pipermail/koha/attachments/20090506/7888f334/attachment-0001.htm 


More information about the Koha mailing list