Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- FOR source_part IN SELECT * FROM biblio.monograph_part WHERE record = source_record LOOP +
- +
- SELECT INTO target_part * +
- FROM biblio.monograph_part +
- WHERE label = source_part.label +
- AND record = target_record; +
- +
- -- ... and if there's a conflicting one on the target ... +
- IF FOUND THEN +
- +
- -- ... move the copy-part maps to that, and ... +
- UPDATE asset.copy_part_map +
- SET part = target_part.id +
- WHERE part = source_part.id; +
- +
- -- ... move P holds to the move-target part +
- FOR hold IN SELECT * FROM action.hold_request WHERE target = source_part.id AND hold_type = 'P' LOOP+
- +
- UPDATE action.hold_request +
- SET target = target_part.id +
- WHERE id = hold.id; +
- +
- moved_objects := moved_objects + 1; +
- END LOOP; +
- +
- ???END
- -- ... if not ... +
- ELSE +
- -- ... just move the part to the target record +
- UPDATE biblio.monograph_part +
- SET record = target_record +
- WHERE id = source_part.id; +
- END IF; +
- +
- moved_objects := moved_objects + 1; +
- END LOOP;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement