118: --
119: l_strg := 'update '||p_table_name||' t set drvbl_fctr_prtn_elig_flag = :1
120:
121: where '||p_col_name|| '= :2 and (
122: exists (select null from ben_elig_age_prte_f eap, ben_prtn_elig_f epa,
123: ben_prtn_elig_prfl_f cep
124: where epa.'||p_col_name||' = :3 and epa.prtn_elig_id = cep.prtn_elig_id and
125: cep.eligy_prfl_id = eap.eligy_prfl_id) or
126: exists (select null from ben_elig_cmbn_age_los_prte_f ecp, ben_prtn_elig_f epa,
122: exists (select null from ben_elig_age_prte_f eap, ben_prtn_elig_f epa,
123: ben_prtn_elig_prfl_f cep
124: where epa.'||p_col_name||' = :3 and epa.prtn_elig_id = cep.prtn_elig_id and
125: cep.eligy_prfl_id = eap.eligy_prfl_id) or
126: exists (select null from ben_elig_cmbn_age_los_prte_f ecp, ben_prtn_elig_f epa,
127: ben_prtn_elig_prfl_f cep
128: where epa.'||p_col_name||' = :4 and epa.prtn_elig_id = cep.prtn_elig_id and
129: cep.eligy_prfl_id = ecp.eligy_prfl_id) or
130: exists (select null from ben_elig_comp_lvl_prte_f ecl, ben_prtn_elig_f epa,
126: exists (select null from ben_elig_cmbn_age_los_prte_f ecp, ben_prtn_elig_f epa,
127: ben_prtn_elig_prfl_f cep
128: where epa.'||p_col_name||' = :4 and epa.prtn_elig_id = cep.prtn_elig_id and
129: cep.eligy_prfl_id = ecp.eligy_prfl_id) or
130: exists (select null from ben_elig_comp_lvl_prte_f ecl, ben_prtn_elig_f epa,
131: ben_prtn_elig_prfl_f cep
132: where epa.'||p_col_name||'= :5 and epa.prtn_elig_id = cep.prtn_elig_id and
133: cep.eligy_prfl_id = ecl.eligy_prfl_id) or
134: exists (select null from ben_elig_hrs_wkd_prte_f ehw, ben_prtn_elig_f epa,
130: exists (select null from ben_elig_comp_lvl_prte_f ecl, ben_prtn_elig_f epa,
131: ben_prtn_elig_prfl_f cep
132: where epa.'||p_col_name||'= :5 and epa.prtn_elig_id = cep.prtn_elig_id and
133: cep.eligy_prfl_id = ecl.eligy_prfl_id) or
134: exists (select null from ben_elig_hrs_wkd_prte_f ehw, ben_prtn_elig_f epa,
135: ben_prtn_elig_prfl_f cep
136: where epa.'||p_col_name||'= :6 and epa.prtn_elig_id = cep.prtn_elig_id and
137: cep.eligy_prfl_id = ehw.eligy_prfl_id) or
138: exists (select null from ben_elig_los_prte_f els, ben_prtn_elig_f epa,
134: exists (select null from ben_elig_hrs_wkd_prte_f ehw, ben_prtn_elig_f epa,
135: ben_prtn_elig_prfl_f cep
136: where epa.'||p_col_name||'= :6 and epa.prtn_elig_id = cep.prtn_elig_id and
137: cep.eligy_prfl_id = ehw.eligy_prfl_id) or
138: exists (select null from ben_elig_los_prte_f els, ben_prtn_elig_f epa,
139: ben_prtn_elig_prfl_f cep
140: where epa.'||p_col_name||'= :7 and epa.prtn_elig_id = cep.prtn_elig_id and
141: cep.eligy_prfl_id = els.eligy_prfl_id) or
142: exists (select null from ben_elig_pct_fl_tm_prte_f epf, ben_prtn_elig_f epa,
138: exists (select null from ben_elig_los_prte_f els, ben_prtn_elig_f epa,
139: ben_prtn_elig_prfl_f cep
140: where epa.'||p_col_name||'= :7 and epa.prtn_elig_id = cep.prtn_elig_id and
141: cep.eligy_prfl_id = els.eligy_prfl_id) or
142: exists (select null from ben_elig_pct_fl_tm_prte_f epf, ben_prtn_elig_f epa,
143: ben_prtn_elig_prfl_f cep
144: where epa.'||p_col_name||'= :8 and epa.prtn_elig_id = cep.prtn_elig_id and
145: cep.eligy_prfl_id = epf.eligy_prfl_id))';
146: execute immediate l_strg using 'Y',p_col_id,p_col_id,p_col_id,p_col_id,p_col_id,p_col_id,p_col_id;
148: elsif p_event = 'DELETE' then
149: hr_utility.set_location('update event ',10);
150: l_strg := 'update '||p_table_name||' t set drvbl_fctr_prtn_elig_flag = :1
151: where '||p_col_name|| '= :2 and
152: not exists (select null from ben_elig_age_prte_f eap, ben_prtn_elig_f epa,
153: ben_prtn_elig_prfl_f cep
154: where epa.'||p_col_name||' = :3 and epa.prtn_elig_id = cep.prtn_elig_id and
155: cep.eligy_prfl_id = eap.eligy_prfl_id) and
156: not exists (select null from ben_elig_cmbn_age_los_prte_f ecp, ben_prtn_elig_f epa,
152: not exists (select null from ben_elig_age_prte_f eap, ben_prtn_elig_f epa,
153: ben_prtn_elig_prfl_f cep
154: where epa.'||p_col_name||' = :3 and epa.prtn_elig_id = cep.prtn_elig_id and
155: cep.eligy_prfl_id = eap.eligy_prfl_id) and
156: not exists (select null from ben_elig_cmbn_age_los_prte_f ecp, ben_prtn_elig_f epa,
157: ben_prtn_elig_prfl_f cep
158: where epa.'||p_col_name||' = :4 and epa.prtn_elig_id = cep.prtn_elig_id and
159: cep.eligy_prfl_id = ecp.eligy_prfl_id) and
160: not exists (select null from ben_elig_comp_lvl_prte_f ecl, ben_prtn_elig_f epa,
156: not exists (select null from ben_elig_cmbn_age_los_prte_f ecp, ben_prtn_elig_f epa,
157: ben_prtn_elig_prfl_f cep
158: where epa.'||p_col_name||' = :4 and epa.prtn_elig_id = cep.prtn_elig_id and
159: cep.eligy_prfl_id = ecp.eligy_prfl_id) and
160: not exists (select null from ben_elig_comp_lvl_prte_f ecl, ben_prtn_elig_f epa,
161: ben_prtn_elig_prfl_f cep
162: where epa.'||p_col_name||'= :5 and epa.prtn_elig_id = cep.prtn_elig_id and
163: cep.eligy_prfl_id = ecl.eligy_prfl_id) and
164: not exists (select null from ben_elig_hrs_wkd_prte_f ehw, ben_prtn_elig_f epa,
160: not exists (select null from ben_elig_comp_lvl_prte_f ecl, ben_prtn_elig_f epa,
161: ben_prtn_elig_prfl_f cep
162: where epa.'||p_col_name||'= :5 and epa.prtn_elig_id = cep.prtn_elig_id and
163: cep.eligy_prfl_id = ecl.eligy_prfl_id) and
164: not exists (select null from ben_elig_hrs_wkd_prte_f ehw, ben_prtn_elig_f epa,
165: ben_prtn_elig_prfl_f cep
166: where epa.'||p_col_name||'= :6 and epa.prtn_elig_id = cep.prtn_elig_id and
167: cep.eligy_prfl_id = ehw.eligy_prfl_id) and
168: not exists (select null from ben_elig_los_prte_f els, ben_prtn_elig_f epa,
164: not exists (select null from ben_elig_hrs_wkd_prte_f ehw, ben_prtn_elig_f epa,
165: ben_prtn_elig_prfl_f cep
166: where epa.'||p_col_name||'= :6 and epa.prtn_elig_id = cep.prtn_elig_id and
167: cep.eligy_prfl_id = ehw.eligy_prfl_id) and
168: not exists (select null from ben_elig_los_prte_f els, ben_prtn_elig_f epa,
169: ben_prtn_elig_prfl_f cep
170: where epa.'||p_col_name||'= :7 and epa.prtn_elig_id = cep.prtn_elig_id and
171: cep.eligy_prfl_id = els.eligy_prfl_id) and
172: not exists (select null from ben_elig_pct_fl_tm_prte_f epf, ben_prtn_elig_f epa,
168: not exists (select null from ben_elig_los_prte_f els, ben_prtn_elig_f epa,
169: ben_prtn_elig_prfl_f cep
170: where epa.'||p_col_name||'= :7 and epa.prtn_elig_id = cep.prtn_elig_id and
171: cep.eligy_prfl_id = els.eligy_prfl_id) and
172: not exists (select null from ben_elig_pct_fl_tm_prte_f epf, ben_prtn_elig_f epa,
173: ben_prtn_elig_prfl_f cep
174: where epa.'||p_col_name||'= :8 and epa.prtn_elig_id = cep.prtn_elig_id and
175: cep.eligy_prfl_id = epf.eligy_prfl_id)';
176: execute immediate l_strg using 'N',p_col_id,p_col_id,p_col_id,p_col_id,p_col_id,p_col_id,p_col_id;
187: --
188: l_proc varchar2(80) := g_package||'derivable factor handler';
189: --
190: cursor c1 is select pgm_id,pl_id,ptip_id,plip_id,oipl_id
191: from ben_prtn_elig_f epa, ben_prtn_elig_prfl_f cep
192: where cep.eligy_prfl_id = p_eligy_prfl_id and
193: cep.prtn_elig_id = epa.prtn_elig_id;
194:
195: --
249: If i.pgm_id is not null then
250:
251: update ben_pgm_f set drvbl_fctr_prtn_elig_flag = 'N'
252: where pgm_id = i.pgm_id and
253: not exists (select null from ben_elig_age_prte_f eap, ben_prtn_elig_f epa,
254: ben_prtn_elig_prfl_f cep
255: where epa.pgm_id = i.pgm_id and epa.prtn_elig_id = cep.prtn_elig_id and
256: cep.eligy_prfl_id = eap.eligy_prfl_id) and
257: not exists (select null from ben_elig_cmbn_age_los_prte_f ecp, ben_prtn_elig_f epa,
253: not exists (select null from ben_elig_age_prte_f eap, ben_prtn_elig_f epa,
254: ben_prtn_elig_prfl_f cep
255: where epa.pgm_id = i.pgm_id and epa.prtn_elig_id = cep.prtn_elig_id and
256: cep.eligy_prfl_id = eap.eligy_prfl_id) and
257: not exists (select null from ben_elig_cmbn_age_los_prte_f ecp, ben_prtn_elig_f epa,
258: ben_prtn_elig_prfl_f cep
259: where epa.pgm_id = i.pgm_id and epa.prtn_elig_id = cep.prtn_elig_id and
260: cep.eligy_prfl_id = ecp.eligy_prfl_id) and
261: not exists (select null from ben_elig_comp_lvl_prte_f ecl, ben_prtn_elig_f epa,
257: not exists (select null from ben_elig_cmbn_age_los_prte_f ecp, ben_prtn_elig_f epa,
258: ben_prtn_elig_prfl_f cep
259: where epa.pgm_id = i.pgm_id and epa.prtn_elig_id = cep.prtn_elig_id and
260: cep.eligy_prfl_id = ecp.eligy_prfl_id) and
261: not exists (select null from ben_elig_comp_lvl_prte_f ecl, ben_prtn_elig_f epa,
262: ben_prtn_elig_prfl_f cep
263: where epa.pgm_id = i.pgm_id and epa.prtn_elig_id = cep.prtn_elig_id and
264: cep.eligy_prfl_id = ecl.eligy_prfl_id) and
265: not exists (select null from ben_elig_hrs_wkd_prte_f ehw, ben_prtn_elig_f epa,
261: not exists (select null from ben_elig_comp_lvl_prte_f ecl, ben_prtn_elig_f epa,
262: ben_prtn_elig_prfl_f cep
263: where epa.pgm_id = i.pgm_id and epa.prtn_elig_id = cep.prtn_elig_id and
264: cep.eligy_prfl_id = ecl.eligy_prfl_id) and
265: not exists (select null from ben_elig_hrs_wkd_prte_f ehw, ben_prtn_elig_f epa,
266: ben_prtn_elig_prfl_f cep
267: where epa.pgm_id = i.pgm_id and epa.prtn_elig_id = cep.prtn_elig_id and
268: cep.eligy_prfl_id = ehw.eligy_prfl_id) and
269: not exists (select null from ben_elig_los_prte_f els, ben_prtn_elig_f epa,
265: not exists (select null from ben_elig_hrs_wkd_prte_f ehw, ben_prtn_elig_f epa,
266: ben_prtn_elig_prfl_f cep
267: where epa.pgm_id = i.pgm_id and epa.prtn_elig_id = cep.prtn_elig_id and
268: cep.eligy_prfl_id = ehw.eligy_prfl_id) and
269: not exists (select null from ben_elig_los_prte_f els, ben_prtn_elig_f epa,
270: ben_prtn_elig_prfl_f cep
271: where epa.pgm_id = i.pgm_id and epa.prtn_elig_id = cep.prtn_elig_id and
272: cep.eligy_prfl_id = els.eligy_prfl_id) and
273: not exists (select null from ben_elig_pct_fl_tm_prte_f epf, ben_prtn_elig_f epa,
269: not exists (select null from ben_elig_los_prte_f els, ben_prtn_elig_f epa,
270: ben_prtn_elig_prfl_f cep
271: where epa.pgm_id = i.pgm_id and epa.prtn_elig_id = cep.prtn_elig_id and
272: cep.eligy_prfl_id = els.eligy_prfl_id) and
273: not exists (select null from ben_elig_pct_fl_tm_prte_f epf, ben_prtn_elig_f epa,
274: ben_prtn_elig_prfl_f cep
275: where epa.pgm_id = i.pgm_id and epa.prtn_elig_id = cep.prtn_elig_id and
276: cep.eligy_prfl_id = epf.eligy_prfl_id);
277: End If;
279: If i.pl_id is not null then
280:
281: update ben_pl_f set drvbl_fctr_prtn_elig_flag = 'N'
282: where pl_id = i.pl_id and
283: not exists (select null from ben_elig_age_prte_f eap, ben_prtn_elig_f epa,
284: ben_prtn_elig_prfl_f cep
285: where epa.pl_id = i.pl_id and epa.prtn_elig_id = cep.prtn_elig_id and
286: cep.eligy_prfl_id = eap.eligy_prfl_id) and
287: not exists (select null from ben_elig_cmbn_age_los_prte_f ecp, ben_prtn_elig_f epa,
283: not exists (select null from ben_elig_age_prte_f eap, ben_prtn_elig_f epa,
284: ben_prtn_elig_prfl_f cep
285: where epa.pl_id = i.pl_id and epa.prtn_elig_id = cep.prtn_elig_id and
286: cep.eligy_prfl_id = eap.eligy_prfl_id) and
287: not exists (select null from ben_elig_cmbn_age_los_prte_f ecp, ben_prtn_elig_f epa,
288: ben_prtn_elig_prfl_f cep
289: where epa.pl_id = i.pl_id and epa.prtn_elig_id = cep.prtn_elig_id and
290: cep.eligy_prfl_id = ecp.eligy_prfl_id) and
291: not exists (select null from ben_elig_comp_lvl_prte_f ecl, ben_prtn_elig_f epa,
287: not exists (select null from ben_elig_cmbn_age_los_prte_f ecp, ben_prtn_elig_f epa,
288: ben_prtn_elig_prfl_f cep
289: where epa.pl_id = i.pl_id and epa.prtn_elig_id = cep.prtn_elig_id and
290: cep.eligy_prfl_id = ecp.eligy_prfl_id) and
291: not exists (select null from ben_elig_comp_lvl_prte_f ecl, ben_prtn_elig_f epa,
292: ben_prtn_elig_prfl_f cep
293: where epa.pl_id = i.pl_id and epa.prtn_elig_id = cep.prtn_elig_id and
294: cep.eligy_prfl_id = ecl.eligy_prfl_id) and
295: not exists (select null from ben_elig_hrs_wkd_prte_f ehw, ben_prtn_elig_f epa,
291: not exists (select null from ben_elig_comp_lvl_prte_f ecl, ben_prtn_elig_f epa,
292: ben_prtn_elig_prfl_f cep
293: where epa.pl_id = i.pl_id and epa.prtn_elig_id = cep.prtn_elig_id and
294: cep.eligy_prfl_id = ecl.eligy_prfl_id) and
295: not exists (select null from ben_elig_hrs_wkd_prte_f ehw, ben_prtn_elig_f epa,
296: ben_prtn_elig_prfl_f cep
297: where epa.pl_id = i.pl_id and epa.prtn_elig_id = cep.prtn_elig_id and
298: cep.eligy_prfl_id = ehw.eligy_prfl_id) and
299: not exists (select null from ben_elig_los_prte_f els, ben_prtn_elig_f epa,
295: not exists (select null from ben_elig_hrs_wkd_prte_f ehw, ben_prtn_elig_f epa,
296: ben_prtn_elig_prfl_f cep
297: where epa.pl_id = i.pl_id and epa.prtn_elig_id = cep.prtn_elig_id and
298: cep.eligy_prfl_id = ehw.eligy_prfl_id) and
299: not exists (select null from ben_elig_los_prte_f els, ben_prtn_elig_f epa,
300: ben_prtn_elig_prfl_f cep
301: where epa.pl_id = i.pl_id and epa.prtn_elig_id = cep.prtn_elig_id and
302: cep.eligy_prfl_id = els.eligy_prfl_id) and
303: not exists (select null from ben_elig_pct_fl_tm_prte_f epf, ben_prtn_elig_f epa,
299: not exists (select null from ben_elig_los_prte_f els, ben_prtn_elig_f epa,
300: ben_prtn_elig_prfl_f cep
301: where epa.pl_id = i.pl_id and epa.prtn_elig_id = cep.prtn_elig_id and
302: cep.eligy_prfl_id = els.eligy_prfl_id) and
303: not exists (select null from ben_elig_pct_fl_tm_prte_f epf, ben_prtn_elig_f epa,
304: ben_prtn_elig_prfl_f cep
305: where epa.pl_id = i.pl_id and epa.prtn_elig_id = cep.prtn_elig_id and
306: cep.eligy_prfl_id = epf.eligy_prfl_id);
307: End If;
309: If i.plip_id is not null then
310:
311: update ben_plip_f set drvbl_fctr_prtn_elig_flag = 'N'
312: where plip_id = i.plip_id and
313: not exists (select null from ben_elig_age_prte_f eap, ben_prtn_elig_f epa,
314: ben_prtn_elig_prfl_f cep
315: where epa.plip_id = i.plip_id and epa.prtn_elig_id = cep.prtn_elig_id and
316: cep.eligy_prfl_id = eap.eligy_prfl_id) and
317: not exists (select null from ben_elig_cmbn_age_los_prte_f ecp, ben_prtn_elig_f epa,
313: not exists (select null from ben_elig_age_prte_f eap, ben_prtn_elig_f epa,
314: ben_prtn_elig_prfl_f cep
315: where epa.plip_id = i.plip_id and epa.prtn_elig_id = cep.prtn_elig_id and
316: cep.eligy_prfl_id = eap.eligy_prfl_id) and
317: not exists (select null from ben_elig_cmbn_age_los_prte_f ecp, ben_prtn_elig_f epa,
318: ben_prtn_elig_prfl_f cep
319: where epa.plip_id = i.plip_id and epa.prtn_elig_id = cep.prtn_elig_id and
320: cep.eligy_prfl_id = ecp.eligy_prfl_id) and
321: not exists (select null from ben_elig_comp_lvl_prte_f ecl, ben_prtn_elig_f epa,
317: not exists (select null from ben_elig_cmbn_age_los_prte_f ecp, ben_prtn_elig_f epa,
318: ben_prtn_elig_prfl_f cep
319: where epa.plip_id = i.plip_id and epa.prtn_elig_id = cep.prtn_elig_id and
320: cep.eligy_prfl_id = ecp.eligy_prfl_id) and
321: not exists (select null from ben_elig_comp_lvl_prte_f ecl, ben_prtn_elig_f epa,
322: ben_prtn_elig_prfl_f cep
323: where epa.plip_id = i.plip_id and epa.prtn_elig_id = cep.prtn_elig_id and
324: cep.eligy_prfl_id = ecl.eligy_prfl_id) and
325: not exists (select null from ben_elig_hrs_wkd_prte_f ehw, ben_prtn_elig_f epa,
321: not exists (select null from ben_elig_comp_lvl_prte_f ecl, ben_prtn_elig_f epa,
322: ben_prtn_elig_prfl_f cep
323: where epa.plip_id = i.plip_id and epa.prtn_elig_id = cep.prtn_elig_id and
324: cep.eligy_prfl_id = ecl.eligy_prfl_id) and
325: not exists (select null from ben_elig_hrs_wkd_prte_f ehw, ben_prtn_elig_f epa,
326: ben_prtn_elig_prfl_f cep
327: where epa.plip_id = i.plip_id and epa.prtn_elig_id = cep.prtn_elig_id and
328: cep.eligy_prfl_id = ehw.eligy_prfl_id) and
329: not exists (select null from ben_elig_los_prte_f els, ben_prtn_elig_f epa,
325: not exists (select null from ben_elig_hrs_wkd_prte_f ehw, ben_prtn_elig_f epa,
326: ben_prtn_elig_prfl_f cep
327: where epa.plip_id = i.plip_id and epa.prtn_elig_id = cep.prtn_elig_id and
328: cep.eligy_prfl_id = ehw.eligy_prfl_id) and
329: not exists (select null from ben_elig_los_prte_f els, ben_prtn_elig_f epa,
330: ben_prtn_elig_prfl_f cep
331: where epa.plip_id = i.plip_id and epa.prtn_elig_id = cep.prtn_elig_id and
332: cep.eligy_prfl_id = els.eligy_prfl_id) and
333: not exists (select null from ben_elig_pct_fl_tm_prte_f epf, ben_prtn_elig_f epa,
329: not exists (select null from ben_elig_los_prte_f els, ben_prtn_elig_f epa,
330: ben_prtn_elig_prfl_f cep
331: where epa.plip_id = i.plip_id and epa.prtn_elig_id = cep.prtn_elig_id and
332: cep.eligy_prfl_id = els.eligy_prfl_id) and
333: not exists (select null from ben_elig_pct_fl_tm_prte_f epf, ben_prtn_elig_f epa,
334: ben_prtn_elig_prfl_f cep
335: where epa.plip_id = i.plip_id and epa.prtn_elig_id = cep.prtn_elig_id and
336: cep.eligy_prfl_id = epf.eligy_prfl_id);
337: End If;
339: If i.ptip_id is not null then
340:
341: update ben_ptip_f set drvbl_fctr_prtn_elig_flag = 'N'
342: where ptip_id = i.ptip_id and
343: not exists (select null from ben_elig_age_prte_f eap, ben_prtn_elig_f epa,
344: ben_prtn_elig_prfl_f cep
345: where epa.ptip_id = i.ptip_id and epa.prtn_elig_id = cep.prtn_elig_id and
346: cep.eligy_prfl_id = eap.eligy_prfl_id) and
347: not exists (select null from ben_elig_cmbn_age_los_prte_f ecp, ben_prtn_elig_f epa,
343: not exists (select null from ben_elig_age_prte_f eap, ben_prtn_elig_f epa,
344: ben_prtn_elig_prfl_f cep
345: where epa.ptip_id = i.ptip_id and epa.prtn_elig_id = cep.prtn_elig_id and
346: cep.eligy_prfl_id = eap.eligy_prfl_id) and
347: not exists (select null from ben_elig_cmbn_age_los_prte_f ecp, ben_prtn_elig_f epa,
348: ben_prtn_elig_prfl_f cep
349: where epa.ptip_id = i.ptip_id and epa.prtn_elig_id = cep.prtn_elig_id and
350: cep.eligy_prfl_id = ecp.eligy_prfl_id) and
351: not exists (select null from ben_elig_comp_lvl_prte_f ecl, ben_prtn_elig_f epa,
347: not exists (select null from ben_elig_cmbn_age_los_prte_f ecp, ben_prtn_elig_f epa,
348: ben_prtn_elig_prfl_f cep
349: where epa.ptip_id = i.ptip_id and epa.prtn_elig_id = cep.prtn_elig_id and
350: cep.eligy_prfl_id = ecp.eligy_prfl_id) and
351: not exists (select null from ben_elig_comp_lvl_prte_f ecl, ben_prtn_elig_f epa,
352: ben_prtn_elig_prfl_f cep
353: where epa.ptip_id = i.ptip_id and epa.prtn_elig_id = cep.prtn_elig_id and
354: cep.eligy_prfl_id = ecl.eligy_prfl_id) and
355: not exists (select null from ben_elig_hrs_wkd_prte_f ehw, ben_prtn_elig_f epa,
351: not exists (select null from ben_elig_comp_lvl_prte_f ecl, ben_prtn_elig_f epa,
352: ben_prtn_elig_prfl_f cep
353: where epa.ptip_id = i.ptip_id and epa.prtn_elig_id = cep.prtn_elig_id and
354: cep.eligy_prfl_id = ecl.eligy_prfl_id) and
355: not exists (select null from ben_elig_hrs_wkd_prte_f ehw, ben_prtn_elig_f epa,
356: ben_prtn_elig_prfl_f cep
357: where epa.ptip_id = i.ptip_id and epa.prtn_elig_id = cep.prtn_elig_id and
358: cep.eligy_prfl_id = ehw.eligy_prfl_id) and
359: not exists (select null from ben_elig_los_prte_f els, ben_prtn_elig_f epa,
355: not exists (select null from ben_elig_hrs_wkd_prte_f ehw, ben_prtn_elig_f epa,
356: ben_prtn_elig_prfl_f cep
357: where epa.ptip_id = i.ptip_id and epa.prtn_elig_id = cep.prtn_elig_id and
358: cep.eligy_prfl_id = ehw.eligy_prfl_id) and
359: not exists (select null from ben_elig_los_prte_f els, ben_prtn_elig_f epa,
360: ben_prtn_elig_prfl_f cep
361: where epa.ptip_id = i.ptip_id and epa.prtn_elig_id = cep.prtn_elig_id and
362: cep.eligy_prfl_id = els.eligy_prfl_id) and
363: not exists (select null from ben_elig_pct_fl_tm_prte_f epf, ben_prtn_elig_f epa,
359: not exists (select null from ben_elig_los_prte_f els, ben_prtn_elig_f epa,
360: ben_prtn_elig_prfl_f cep
361: where epa.ptip_id = i.ptip_id and epa.prtn_elig_id = cep.prtn_elig_id and
362: cep.eligy_prfl_id = els.eligy_prfl_id) and
363: not exists (select null from ben_elig_pct_fl_tm_prte_f epf, ben_prtn_elig_f epa,
364: ben_prtn_elig_prfl_f cep
365: where epa.ptip_id = i.ptip_id and epa.prtn_elig_id = cep.prtn_elig_id and
366: cep.eligy_prfl_id = epf.eligy_prfl_id);
367: End If;
369: If i.oipl_id is not null then
370:
371: update ben_oipl_f set drvbl_fctr_prtn_elig_flag = 'N'
372: where oipl_id = i.oipl_id and
373: not exists (select null from ben_elig_age_prte_f eap, ben_prtn_elig_f epa,
374: ben_prtn_elig_prfl_f cep
375: where epa.oipl_id = i.oipl_id and epa.prtn_elig_id = cep.prtn_elig_id and
376: cep.eligy_prfl_id = eap.eligy_prfl_id) and
377: not exists (select null from ben_elig_cmbn_age_los_prte_f ecp, ben_prtn_elig_f epa,
373: not exists (select null from ben_elig_age_prte_f eap, ben_prtn_elig_f epa,
374: ben_prtn_elig_prfl_f cep
375: where epa.oipl_id = i.oipl_id and epa.prtn_elig_id = cep.prtn_elig_id and
376: cep.eligy_prfl_id = eap.eligy_prfl_id) and
377: not exists (select null from ben_elig_cmbn_age_los_prte_f ecp, ben_prtn_elig_f epa,
378: ben_prtn_elig_prfl_f cep
379: where epa.oipl_id = i.oipl_id and epa.prtn_elig_id = cep.prtn_elig_id and
380: cep.eligy_prfl_id = ecp.eligy_prfl_id) and
381: not exists (select null from ben_elig_comp_lvl_prte_f ecl, ben_prtn_elig_f epa,
377: not exists (select null from ben_elig_cmbn_age_los_prte_f ecp, ben_prtn_elig_f epa,
378: ben_prtn_elig_prfl_f cep
379: where epa.oipl_id = i.oipl_id and epa.prtn_elig_id = cep.prtn_elig_id and
380: cep.eligy_prfl_id = ecp.eligy_prfl_id) and
381: not exists (select null from ben_elig_comp_lvl_prte_f ecl, ben_prtn_elig_f epa,
382: ben_prtn_elig_prfl_f cep
383: where epa.oipl_id = i.oipl_id and epa.prtn_elig_id = cep.prtn_elig_id and
384: cep.eligy_prfl_id = ecl.eligy_prfl_id) and
385: not exists (select null from ben_elig_hrs_wkd_prte_f ehw, ben_prtn_elig_f epa,
381: not exists (select null from ben_elig_comp_lvl_prte_f ecl, ben_prtn_elig_f epa,
382: ben_prtn_elig_prfl_f cep
383: where epa.oipl_id = i.oipl_id and epa.prtn_elig_id = cep.prtn_elig_id and
384: cep.eligy_prfl_id = ecl.eligy_prfl_id) and
385: not exists (select null from ben_elig_hrs_wkd_prte_f ehw, ben_prtn_elig_f epa,
386: ben_prtn_elig_prfl_f cep
387: where epa.oipl_id = i.oipl_id and epa.prtn_elig_id = cep.prtn_elig_id and
388: cep.eligy_prfl_id = ehw.eligy_prfl_id) and
389: not exists (select null from ben_elig_los_prte_f els, ben_prtn_elig_f epa,
385: not exists (select null from ben_elig_hrs_wkd_prte_f ehw, ben_prtn_elig_f epa,
386: ben_prtn_elig_prfl_f cep
387: where epa.oipl_id = i.oipl_id and epa.prtn_elig_id = cep.prtn_elig_id and
388: cep.eligy_prfl_id = ehw.eligy_prfl_id) and
389: not exists (select null from ben_elig_los_prte_f els, ben_prtn_elig_f epa,
390: ben_prtn_elig_prfl_f cep
391: where epa.oipl_id = i.oipl_id and epa.prtn_elig_id = cep.prtn_elig_id and
392: cep.eligy_prfl_id = els.eligy_prfl_id) and
393: not exists (select null from ben_elig_pct_fl_tm_prte_f epf, ben_prtn_elig_f epa,
389: not exists (select null from ben_elig_los_prte_f els, ben_prtn_elig_f epa,
390: ben_prtn_elig_prfl_f cep
391: where epa.oipl_id = i.oipl_id and epa.prtn_elig_id = cep.prtn_elig_id and
392: cep.eligy_prfl_id = els.eligy_prfl_id) and
393: not exists (select null from ben_elig_pct_fl_tm_prte_f epf, ben_prtn_elig_f epa,
394: ben_prtn_elig_prfl_f cep
395: where epa.oipl_id = i.oipl_id and epa.prtn_elig_id = cep.prtn_elig_id and
396: cep.eligy_prfl_id = epf.eligy_prfl_id);
397: End If;