14:
15: --
16: -- Used to get rule data from the database for a particular group id
17: --
18: TYPE rules_record_type IS RECORD( rule_id FTE_SEL_RULE_RESTRICTIONS.rule_id%type,
19: attribute_name FTE_SEL_RULE_RESTRICTIONS.attribute_name%type,
20: attribute_value_from FTE_SEL_RULE_RESTRICTIONS.attribute_value_from%type,
21: attribute_value_to FTE_SEL_RULE_RESTRICTIONS.attribute_value_to%type,
22: attribute_value_from_number FTE_SEL_RULE_RESTRICTIONS.attribute_value_from_number%type,
15: --
16: -- Used to get rule data from the database for a particular group id
17: --
18: TYPE rules_record_type IS RECORD( rule_id FTE_SEL_RULE_RESTRICTIONS.rule_id%type,
19: attribute_name FTE_SEL_RULE_RESTRICTIONS.attribute_name%type,
20: attribute_value_from FTE_SEL_RULE_RESTRICTIONS.attribute_value_from%type,
21: attribute_value_to FTE_SEL_RULE_RESTRICTIONS.attribute_value_to%type,
22: attribute_value_from_number FTE_SEL_RULE_RESTRICTIONS.attribute_value_from_number%type,
23: attribute_value_to_number FTE_SEL_RULE_RESTRICTIONS.attribute_value_to_number%type,
16: -- Used to get rule data from the database for a particular group id
17: --
18: TYPE rules_record_type IS RECORD( rule_id FTE_SEL_RULE_RESTRICTIONS.rule_id%type,
19: attribute_name FTE_SEL_RULE_RESTRICTIONS.attribute_name%type,
20: attribute_value_from FTE_SEL_RULE_RESTRICTIONS.attribute_value_from%type,
21: attribute_value_to FTE_SEL_RULE_RESTRICTIONS.attribute_value_to%type,
22: attribute_value_from_number FTE_SEL_RULE_RESTRICTIONS.attribute_value_from_number%type,
23: attribute_value_to_number FTE_SEL_RULE_RESTRICTIONS.attribute_value_to_number%type,
24: overlap_flag FTE_SEL_RULE_RESTRICTIONS.range_overlap_flag%type);
17: --
18: TYPE rules_record_type IS RECORD( rule_id FTE_SEL_RULE_RESTRICTIONS.rule_id%type,
19: attribute_name FTE_SEL_RULE_RESTRICTIONS.attribute_name%type,
20: attribute_value_from FTE_SEL_RULE_RESTRICTIONS.attribute_value_from%type,
21: attribute_value_to FTE_SEL_RULE_RESTRICTIONS.attribute_value_to%type,
22: attribute_value_from_number FTE_SEL_RULE_RESTRICTIONS.attribute_value_from_number%type,
23: attribute_value_to_number FTE_SEL_RULE_RESTRICTIONS.attribute_value_to_number%type,
24: overlap_flag FTE_SEL_RULE_RESTRICTIONS.range_overlap_flag%type);
25:
18: TYPE rules_record_type IS RECORD( rule_id FTE_SEL_RULE_RESTRICTIONS.rule_id%type,
19: attribute_name FTE_SEL_RULE_RESTRICTIONS.attribute_name%type,
20: attribute_value_from FTE_SEL_RULE_RESTRICTIONS.attribute_value_from%type,
21: attribute_value_to FTE_SEL_RULE_RESTRICTIONS.attribute_value_to%type,
22: attribute_value_from_number FTE_SEL_RULE_RESTRICTIONS.attribute_value_from_number%type,
23: attribute_value_to_number FTE_SEL_RULE_RESTRICTIONS.attribute_value_to_number%type,
24: overlap_flag FTE_SEL_RULE_RESTRICTIONS.range_overlap_flag%type);
25:
26: TYPE rules_tab_type IS TABLE OF rules_record_type INDEX BY BINARY_INTEGER;
19: attribute_name FTE_SEL_RULE_RESTRICTIONS.attribute_name%type,
20: attribute_value_from FTE_SEL_RULE_RESTRICTIONS.attribute_value_from%type,
21: attribute_value_to FTE_SEL_RULE_RESTRICTIONS.attribute_value_to%type,
22: attribute_value_from_number FTE_SEL_RULE_RESTRICTIONS.attribute_value_from_number%type,
23: attribute_value_to_number FTE_SEL_RULE_RESTRICTIONS.attribute_value_to_number%type,
24: overlap_flag FTE_SEL_RULE_RESTRICTIONS.range_overlap_flag%type);
25:
26: TYPE rules_tab_type IS TABLE OF rules_record_type INDEX BY BINARY_INTEGER;
27:
20: attribute_value_from FTE_SEL_RULE_RESTRICTIONS.attribute_value_from%type,
21: attribute_value_to FTE_SEL_RULE_RESTRICTIONS.attribute_value_to%type,
22: attribute_value_from_number FTE_SEL_RULE_RESTRICTIONS.attribute_value_from_number%type,
23: attribute_value_to_number FTE_SEL_RULE_RESTRICTIONS.attribute_value_to_number%type,
24: overlap_flag FTE_SEL_RULE_RESTRICTIONS.range_overlap_flag%type);
25:
26: TYPE rules_tab_type IS TABLE OF rules_record_type INDEX BY BINARY_INTEGER;
27:
28: --
29: --Limit is a) 'L' - Lower limit.
30: -- b) 'U' - Upper limit
31: -- c) 'N' - Null (Added when range is not there)
32:
33: TYPE range_match_rule_rec IS RECORD( rule_id FTE_SEL_RULE_RESTRICTIONS.rule_id%type,
34: overlap_flag FTE_SEL_RULE_RESTRICTIONS.range_overlap_flag%type,
35: limit VARCHAR2(1));
36:
37: TYPE range_match_tab IS TABLE OF range_match_rule_rec INDEX BY BINARY_INTEGER;
30: -- b) 'U' - Upper limit
31: -- c) 'N' - Null (Added when range is not there)
32:
33: TYPE range_match_rule_rec IS RECORD( rule_id FTE_SEL_RULE_RESTRICTIONS.rule_id%type,
34: overlap_flag FTE_SEL_RULE_RESTRICTIONS.range_overlap_flag%type,
35: limit VARCHAR2(1));
36:
37: TYPE range_match_tab IS TABLE OF range_match_rule_rec INDEX BY BINARY_INTEGER;
38:
826: WSH_DEBUG_SV.logmsg(l_module_name,'From Region');
827: END IF;
828:
829: --
830: -- FTE_SEL_RULE_RESTRICTIONS has TO_REGION_ID
831: -- FTE_SEL_GROUP_ATTRIBUTES has 'TO_REGION_COUNTRY'
832: --
833: ELSIF (l_attr_tab(itr).attr_code IN ('TO_REGION_COUNTRY','TO_REGION_STATE','TO_REGION_CITY','TO_ZONE','TO_REGION')) THEN
834: l_group_attr(g_to_reg_idx) := g_value_present;
1154: attribute_value_to,
1155: attribute_value_from_number,
1156: attribute_value_to_number,
1157: range_overlap_flag
1158: FROM fte_sel_rule_restrictions
1159: WHERE group_id = p_group_id
1160: ORDER BY rule_id;
1161:
1162:
2226:
2227: l_prev_idx VARCHAR2(32767);
2228: l_next_idx VARCHAR2(32767);
2229: l_unique_rule BOOLEAN;
2230: l_rule_id FTE_SEL_RULE_RESTRICTIONS.rule_id%type;
2231: l_rule_tab range_match_tab;
2232: l_prev_tab range_match_tab;
2233: l_next_tab range_match_tab;
2234: l_prev_rec range_match_rule_rec;
2593: END IF;
2594:
2595: sql_string := 'SELECT rule_id FROM '
2596: || ' (SELECT rule_id'
2597: || ' FROM FTE_SEL_RULE_RESTRICTIONS '
2598: || ' WHERE attribute_name=''TRANSIT_TIME'' '--AND ROWNUM=1'
2599: || ' AND rule_id IN ('
2600: || l_rule_str
2601: || ')'