1 -- Copyright 2015, Equinox Software, Inc.
2 -- Author: Galen Charlton <gmc@esilibrary.com>
4 -- This program is free software; you can redistribute it and/or
5 -- modify it under the terms of the GNU General Public License
6 -- as published by the Free Software Foundation; either version 2
7 -- of the License, or (at your option) any later version.
9 -- This program is distributed in the hope that it will be useful,
10 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
11 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 -- GNU General Public License for more details.
14 -- You should have received a copy of the GNU General Public License
15 -- along with this program; if not, write to the Free Software
16 -- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 \set ou_to_del ''''EXAMPLE''''
19 \set vol_del_table ORGUNIT_volume_bibs
25 DELETE FROM authority.bib_linking WHERE bib IN
27 SELECT record FROM esi.:vol_del_table x
28 WHERE NOT EXISTS (select 1 from asset.call_number where record = x.record)
31 DELETE FROM metabib.browse_entry_def_map WHERE source IN
33 SELECT record FROM esi.:vol_del_table x
34 WHERE NOT EXISTS (select 1 from asset.call_number where record = x.record)
37 DELETE FROM acq.lineitem WHERE eg_bib_id IN
39 SELECT record FROM esi.:vol_del_table x
40 WHERE NOT EXISTS (select 1 from asset.call_number where record = x.record)
43 DELETE FROM biblio.monograph_part WHERE record IN
45 SELECT record FROM esi.:vol_del_table x
46 WHERE NOT EXISTS (select 1 from asset.call_number where record = x.record)
49 DELETE FROM biblio.peer_bib_copy_map WHERE peer_record IN
51 SELECT record FROM esi.:vol_del_table x
52 WHERE NOT EXISTS (select 1 from asset.call_number where record = x.record)
55 DELETE FROM acq.lineitem WHERE queued_record IN (
56 SELECT id FROM vandelay.queued_bib_record WHERE imported_as IN
58 SELECT record FROM esi.:vol_del_table x
59 WHERE NOT EXISTS (select 1 from asset.call_number where record = x.record)
63 DELETE FROM acq.acq_lineitem_history WHERE queued_record IN (
64 SELECT id FROM vandelay.queued_bib_record WHERE imported_as IN
66 SELECT record FROM esi.:vol_del_table x
67 WHERE NOT EXISTS (select 1 from asset.call_number where record = x.record)
71 DELETE FROM vandelay.queued_bib_record WHERE imported_as IN
73 SELECT record FROM esi.:vol_del_table x
74 WHERE NOT EXISTS (select 1 from asset.call_number where record = x.record)
77 DELETE FROM metabib.record_attr_vector_list WHERE source IN
79 SELECT record FROM esi.:vol_del_table x
80 WHERE NOT EXISTS (select 1 from asset.call_number where record = x.record)
83 DELETE FROM metabib.record_sorter WHERE source IN
85 SELECT record FROM esi.:vol_del_table x
86 WHERE NOT EXISTS (select 1 from asset.call_number where record = x.record)
89 DELETE FROM booking.resource_type WHERE record IN
91 SELECT record FROM esi.:vol_del_table x
92 WHERE NOT EXISTS (select 1 from asset.call_number where record = x.record)