74:
75: cursor c_origin_exists_cursor is
76: select 'Y'
77: from fte_lanes fl,
78: wsh_regions_tl wr,
79: hz_locations hl,
80: wsh_regions wrb
81: where fl.origin_id = wr.region_id
82: and wr.region_id = wrb.region_id
89: and nvl(wrb.state_code,'XX') = nvl(hl.state,wrb.state_code)
90: union
91: select 'Y'
92: from fte_lanes fl,
93: wsh_regions_tl wr,
94: hr_locations_all hl, hr_locations_all_tl hlt,
95: wsh_regions wrb
96: where fl.origin_id = wr.region_id
97: and wr.region_id = wrb.region_id
111:
112: cursor c_dest_exists_cursor is
113: select 'Y'
114: from fte_lanes fl,
115: wsh_regions_tl wr,
116: hz_locations hl,
117: wsh_regions wrb
118: where fl.destination_id = wr.region_id
119: and wr.region_id = wrb.region_id
126: and nvl(wrb.state_code,'XX') = nvl(hl.state,wrb.state_code)
127: union
128: select 'Y'
129: from fte_lanes fl,
130: wsh_regions_tl wr,
131: hr_locations_all hl, hr_locations_all_tl hlt,
132: wsh_regions wrb
133: where fl.destination_id = wr.region_id
134: and wr.region_id = wrb.region_id
147:
148: cursor c_any_exists_cursor is
149: select 'Y'
150: from fte_lanes fl,
151: wsh_regions_tl wr,
152: hz_locations hl,
153: wsh_regions wrb
154: where fl.destination_id = wr.region_id
155: and wr.region_id = wrb.region_id
162: and nvl(wrb.state_code,'XX') = nvl(hl.state,wrb.state_code)
163: union
164: select 'Y'
165: from fte_lanes fl,
166: wsh_regions_tl wr,
167: hr_locations_all hl, hr_locations_all_tl hlt,
168: wsh_regions wrb
169: where (fl.origin_id = wr.region_id or fl.DESTINATION_ID = wr.region_id)
170: and wr.region_id = wrb.region_id