Jason Etheridge wrote:
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 );


Thanks Jason, this works!

Geoff

Reply via email to