Created
April 14, 2014 02:38
-
-
Save LincolnUniLTL/10611972 to your computer and use it in GitHub Desktop.
DSpace handle returning function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- PostgresSQL pure SQL function to return handle, given an id | |
-- assumes handle is uniquely in element "identifier(.uri)", uncomment non-standard uri qualifier to enforce that | |
CREATE OR REPLACE FUNCTION DHandle(p_id INTEGER) RETURNS text AS $$ | |
SELECT text_value | |
FROM metadatavalue V, metadatafieldregistry R | |
WHERE R.metadata_field_id = V.metadata_field_id | |
AND element ILIKE 'identifier' | |
-- AND qualifier ILIKE 'uri' | |
AND item_id=$1; | |
$$ LANGUAGE SQL; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment