[Koha] Insert textbook with MySQL stored procedures

ISM KIS Ism at kis.in
Wed May 6 17:31:23 NZST 2009


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



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.katipo.co.nz/pipermail/koha/attachments/20090506/eb3b73cd/attachment.htm 


More information about the Koha mailing list