17: -- should fetch one row of purpose_id
18: CURSOR C_purpose IS
19: select a.default_rule_set_id
20: , a.rule_set_level
21: from fa_asset_hierarchy_purpose a
22: , fa_asset_hierarchy b
23: where a.asset_hierarchy_purpose_id = b.asset_hierarchy_purpose_id
24: and b.asset_hierarchy_id = x_parent_node_id
25: and a.book_type_code = x_book_type_code ;
32: and p_rule_set_level = 'ASSET_CATEGORY'
33: UNION
34: select a.hierarchy_rule_set_id
35: from fa_asset_hierarchy a
36: , fa_asset_hierarchy_purpose b
37: where a.asset_hierarchy_purpose_id = b.asset_hierarchy_purpose_id
38: and a.asset_hierarchy_id = x_parent_node_id
39: and b.book_type_code = x_book_type_code
40: and p_rule_set_level = 'TOP_NODE'
44: from fa_asset_hierarchy
45: where parent_hierarchy_id IS NULL
46: start with asset_hierarchy_id = x_parent_node_id
47: connect by prior asset_hierarchy_id = parent_hierarchy_id ) a
48: , fa_asset_hierarchy_purpose b
49: where a.asset_hierarchy_purpose_id = b.asset_hierarchy_purpose_id
50: and b.book_type_code = x_book_type_code
51: and p_rule_set_level = 'LOWEST_NODE';
52: