[OPEN-ILS-DEV] Removing records - Training Opportunity...
Mike Rylander
mrylander at gmail.com
Wed Oct 22 19:28:57 EDT 2008
On Wed, Oct 22, 2008 at 4:54 PM, Grant Johnson <FGJohnson at upei.ca> wrote:
> I don't want to change the table constraints in Evergreen.
> But have a training opportunity for someone. :-)
>
> We need to delete some electronic records without items from the catalog.(for now).
> These records have a biblio.record_entry.tcn_source of LIKE 'cis'.
>
> I can't delete from biblio.record_entry as it's referenced as a foreign_key in .metarecord.
> I can't delete from .metarecord as it's referenced as a foreign key in .metarecord_source_map.
> I CAN remove the rows one at a time from the msm -> m -> re and the record is gone.
If /all/ you want to do is make sure that these can never show up in
search results (opac or staff client) and you're on 1.2.2.0 or higher
(you are, of course, but for list memory...) then deleting from msm is
enough, actually. IFF that's the case, then your first DELETE
statement below, adjusted as mentioned by James, is all you'll need.
--miker
>
> Can someone help with the syntax on how to batch delete the following..... and let me know if this is all wrong!
>
> I know what this means - and am looking up how to build the syntax tonight:
> - ERROR: more than one row returned by a subquery used as an expression... :-)
>
> # DELETE from metabib.metarecord_source_map where source = (SELECT id FROM biblio.record_entry where tcn_value like 'cis%');
> # DELETE from metabib.metarecord where master_record = ((SELECT id FROM biblio.record_entry where tcn_value like 'cis%');
> # DELETE from biblio.record_entry where tcn_value like 'cis%');
>
>
> Table References:
> biblio.record_entry
> id = 14497
>
> metabib.metarecord
> id=17448 master_record=14497
>
> metaib.metarecord_source_map
> id=14710 metarecord=17448 source=14497
> --
>
> F. Grant Johnson
> Systems Coordinator
> Robertson Library
> University of Prince Edward Island
>
>
--
Mike Rylander
| VP, Research and Design
| Equinox Software, Inc. / The Evergreen Experts
| phone: 1-877-OPEN-ILS (673-6457)
| email: miker at esilibrary.com
| web: http://www.esilibrary.com
More information about the Open-ils-dev
mailing list