[OPEN-ILS-DEV] Functions for updating the call number label or owning_lib associated with a copy

Galen Charlton gmc at esilibrary.com
Thu Apr 14 09:59:50 EDT 2011


Hi,

On Apr 14, 2011, at 9:36 AM, Dan Scott wrote:
> I would probably just bash out something like:
> 
> UPDATE asset.call_number SET label = 'MYS ' || label
>  WHERE id IN (
>    SELECT acn.id
>      FROM asset.call_number acn
>        INNER JOIN asset.copy ac ON ac.call_number = acn.id
>        INNER JOIN asset.copy_location acl ON acl.id = ac.location
>      WHERE acl.name = 'Mysteries'
>  ) AND label NOT LIKE 'MYS %';
> ;

Which is fine as a one-shot; what Ben's proposing is more generally useful.

> I'm not sure we have many utility functions defined as part of the stock
> schema that are intended to be invoked directly by humans, rather than
> to support the application. To date, most of these things have lived in
> the wiki (ye olde "Magic spells") and have had a corresponding level of
> support. 

And in same cases could stand to have a better level of support.  Needing to change call numbers en masse is a very common situation; having some utility functions in the database to do certain types of maintenance the Right Way, for various values of "Right Way", would be useful even if they don't necessarily have an exposed UI yet.

That said, such utility routines can easily live in another schema.  Since we've just about finished going through the pain of adding a new schema, shall we just stick such functions into 'evergreen', or is it worth defining yet another schema?

Regards,

Galen
--
Galen Charlton
VP, Data Services
Equinox Software, Inc. / Your Library's Guide to Open Source
email:  gmc at esilibrary.com
direct: +1 352-215-7548
skype:  gmcharlt
web:    http://www.esilibrary.com/



More information about the Open-ils-dev mailing list