egdb3_11_7
.authority
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
extract_thesaurus(marcxml text)
Parameters
Name
Type
Mode
marcxml
text
IN
Definition
DECLARE thes_code TEXT; BEGIN thes_code := vandelay.marc21_extract_fixed_field(marcxml,'Subj'); IF thes_code IS NULL THEN thes_code := '|'; ELSIF thes_code = 'z' THEN thes_code := COALESCE( oils_xpath_string('//*[@tag="040"]/*[@code="f"][1]', marcxml), 'z' ); ELSE SELECT code INTO thes_code FROM authority.thesaurus WHERE short_code = thes_code; IF NOT FOUND THEN thes_code := '|'; -- default END IF; END IF; RETURN thes_code; END;