egdb3_14_1
.acq
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
extract_holding_attr_table(lineitem integer, tag text)
Parameters
Name
Type
Mode
lineitem
integer
IN
tag
text
IN
Definition
DECLARE counter INT; lida acq.flat_lineitem_holding_subfield%ROWTYPE; BEGIN SELECT COUNT(*) INTO counter FROM oils_xpath_table( 'id', 'marc', 'acq.lineitem', '//*[@tag="' || tag || '"]', 'id=' || lineitem ) as t(i int,c text); FOR i IN 1 .. counter LOOP FOR lida IN SELECT * FROM ( SELECT id,i,t,v FROM oils_xpath_table( 'id', 'marc', 'acq.lineitem', '//*[@tag="' || tag || '"][position()=' || i || ']/*[text()]/@code|' || '//*[@tag="' || tag || '"][position()=' || i || ']/*[@code and text()]', 'id=' || lineitem ) as t(id int,t text,v text) )x LOOP RETURN NEXT lida; END LOOP; END LOOP; RETURN; END;