[OPEN-ILS-GENERAL] Clean up holdings

Jason Etheridge jason at esilibrary.com
Tue Sep 29 17:28:05 EDT 2009


> This last part will be a problem if you introduce new shelving locations
> within the second batch.  If all the shelving locations in the second batch
> were already present in the first batch, I think you can safely comment out
> the first SQL statement in the file. Otherwise, if there are locations in
> the second batch file that aren't in the first, copies will not be created
> for those locations.
>
> Anyone know a better way to deal with this?

Geoff,

Try modifying that first INSERT statement in generate_copies.sql like so:

INSERT INTO asset.copy_location (name, owning_lib)
        SELECT  DISTINCT l.location, ou.id
          FROM  staging_items l JOIN actor.org_unit ou
                ON (l.owning_lib = ou.shortname)
          WHERE l.location NOT IN ( SELECT name FROM
asset.copy_location WHERE owning_lib = ou.id );

-- 
Jason Etheridge
 | VP, Tactical Development
 | Equinox Software, Inc. / The Evergreen Experts
 | phone:  1-877-OPEN-ILS (673-6457)
 | email:  jason at esilibrary.com
 | web:  http://www.esilibrary.com


More information about the Open-ils-general mailing list