[OPEN-ILS-GENERAL] Batch deleting records

Josh Stompro stomproj at exchange.larl.org
Fri Jun 17 11:09:55 EDT 2016


Thanks Jason,  I was looking at that function this morning and was thinking, "I wonder if Jason already created a script for this... didn't he just release an update for the pingest.pl script in the last few months?  I wonder what else is there?"  I found your script for deleting copies from a csv file, and the one for deleting copies from a copy bucket.  Thanks for the info and for sharing your code.

http://git.mvlcstaff.org/?p=jason/evergreen_utilities.git;a=blob;f=perl/copy_delete_from_csv.pl;hb=HEAD


Josh Stompro - LARL IT Director


-----Original Message-----
From: Open-ils-general [mailto:open-ils-general-bounces at list.georgialibraries.org] On Behalf Of Jason Stephenson
Sent: Thursday, June 16, 2016 4:10 PM
To: Evergreen Discussion Group
Subject: Re: [OPEN-ILS-GENERAL] Batch deleting records

On 06/16/2016 05:04 PM, Josh Stompro wrote:
> While we are on this subject.  What is the proper way to delete items, 
> then volumes/call number, bibs via sql?  I’m looking at deleting ~3000 
> withdrawn copies after we grab the ones that are last copies to tell 
> OCLC about.  I would rather not use the staff client since it seems to 
> have problems with that many records at once.

The best way is to use Perl to communicate with the OpenSRF services and to use

OpenILS::Application::Cat::AssetCommon->delete_copy

With the proper options, it will delete empty call numbers and bibs for you as well as return a list of holds that need to be retargeted if any copies remain.

--
Jason Stephenson
Assistant Director for Technology Services Merrimack Valley Library Consortium
4 High ST, Suite 175
North Andover, MA 01845
Phone: 978-557-5891
Email: jstephenson at mvlcstaff.org

Please note my new email address.


More information about the Open-ils-general mailing list