Hi, On 31/01/13 13:09, Lighton Phiri wrote: > I am trying to pull out handles for collections I've defined in a > DSpace instance by joining the handle and collection tables. I am > expecting to get unique collection details but my query's returning > duplicates. How do I filter out get this collection information? > > Query > > SELECT h.handle, c.name > FROM ((SELECT resource_id, handle FROM handle) as h JOIN > (SELECT collection_id, name FROM collection) as c ON > h.resource_id = c.collection_id);
You need to throw in WHERE h.resource_type_id = 3 to get only collections with that ID -- right now you're also getting the handles for communities and/or items that happen to have the same numeric ID as your collection. The "3" is defined in Constants.jave (https://github.com/DSpace/DSpace/blob/master/dspace-api/src/main/java/org/dspace/core/Constants.java#L29) > Incidentally, I couldn't find a command-line utility to do this or is > there? I'm not aware of a command-line tool for this. cheers, Andrea -- Dr Andrea Schweer IRR Technical Specialist, ITS Information Systems The University of Waikato, Hamilton, New Zealand ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_jan _______________________________________________ DSpace-tech mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/dspace-tech List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette

