1 Package Body ben_dce_upd as
2 /* $Header: bedcerhi.pkb 120.0.12010000.2 2010/04/07 06:40:25 pvelvano ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' ben_dce_upd.'; -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |----------------------------< dt_update_dml >-----------------------------|
12 -- ----------------------------------------------------------------------------
13 -- {Start Of Comments}
14 --
15 -- Description:
16 -- This procedure controls the execution of dml from the datetrack mode
17 -- of CORRECTION only. It is important to note that the object version
18 -- number is only increment by 1 because the datetrack correction is
19 -- soley for one datetracked row.
20 -- This procedure controls the actual dml update logic. The functions of this
21 -- procedure are as follows:
22 -- 1) Get the next object_version_number.
23 -- 2) To set and unset the g_api_dml status as required (as we are about to
24 -- perform dml).
25 -- 3) To update the specified row in the schema using the primary key in
26 -- the predicates.
27 -- 4) To trap any constraint violations that may have occurred.
28 -- 5) To raise any other errors.
29 --
30 -- Prerequisites:
31 -- This is an internal private procedure which must be called from the
32 -- update_dml procedure.
33 --
34 -- In Parameters:
35 -- A Pl/Sql record structre.
36 --
37 -- Post Success:
38 -- The specified row will be updated in the schema.
39 --
40 -- Post Failure:
41 -- On the update dml failure it is important to note that we always reset the
42 -- g_api_dml status to false.
43 -- If a check or unique integrity constraint violation is raised the
44 -- constraint_error procedure will be called.
45 -- If any other error is reported, the error will be raised after the
46 -- g_api_dml status is reset.
47 --
48 -- Developer Implementation Notes:
49 -- The update 'set' arguments list should be modified if any of your
50 -- attributes are not updateable.
51 --
52 -- Access Status:
53 -- Internal Row Handler Use Only.
54 --
55 -- {End Of Comments}
56 -- ----------------------------------------------------------------------------
57 Procedure dt_update_dml
58 (p_rec in out nocopy ben_dce_shd.g_rec_type,
59 p_effective_date in date,
60 p_datetrack_mode in varchar2,
61 p_validation_start_date in date,
62 p_validation_end_date in date) is
63 --
64 l_proc varchar2(72) := g_package||'dt_update_dml';
65 --
66 Begin
67 hr_utility.set_location('Entering:'||l_proc, 5);
68 --
69 If (p_datetrack_mode = 'CORRECTION') then
70 hr_utility.set_location(l_proc, 10);
71 --
72 -- Because we are updating a row we must get the next object
73 -- version number.
74 --
75 p_rec.object_version_number :=
76 dt_api.get_object_version_number
77 (p_base_table_name => 'ben_dpnt_cvg_eligy_prfl_f',
78 p_base_key_column => 'dpnt_cvg_eligy_prfl_id',
79 p_base_key_value => p_rec.dpnt_cvg_eligy_prfl_id);
80 --
81 ben_dce_shd.g_api_dml := true; -- Set the api dml status
82 --
83 -- Update the ben_dpnt_cvg_eligy_prfl_f Row
84 --
85 update ben_dpnt_cvg_eligy_prfl_f
86 set
87 dpnt_cvg_eligy_prfl_id = p_rec.dpnt_cvg_eligy_prfl_id,
88 business_group_id = p_rec.business_group_id,
89 regn_id = p_rec.regn_id,
90 name = p_rec.name,
91 dpnt_cvg_eligy_prfl_stat_cd = p_rec.dpnt_cvg_eligy_prfl_stat_cd,
92 dce_desc = p_rec.dce_desc,
93 -- military_status_rqmt_ind = p_rec.military_status_rqmt_ind,
94 dpnt_cvg_elig_det_rl = p_rec.dpnt_cvg_elig_det_rl,
95 dce_attribute_category = p_rec.dce_attribute_category,
96 dce_attribute1 = p_rec.dce_attribute1,
97 dce_attribute2 = p_rec.dce_attribute2,
98 dce_attribute3 = p_rec.dce_attribute3,
99 dce_attribute4 = p_rec.dce_attribute4,
100 dce_attribute5 = p_rec.dce_attribute5,
101 dce_attribute6 = p_rec.dce_attribute6,
102 dce_attribute7 = p_rec.dce_attribute7,
103 dce_attribute8 = p_rec.dce_attribute8,
104 dce_attribute9 = p_rec.dce_attribute9,
105 dce_attribute10 = p_rec.dce_attribute10,
106 dce_attribute11 = p_rec.dce_attribute11,
107 dce_attribute12 = p_rec.dce_attribute12,
108 dce_attribute13 = p_rec.dce_attribute13,
109 dce_attribute14 = p_rec.dce_attribute14,
110 dce_attribute15 = p_rec.dce_attribute15,
111 dce_attribute16 = p_rec.dce_attribute16,
112 dce_attribute17 = p_rec.dce_attribute17,
113 dce_attribute18 = p_rec.dce_attribute18,
114 dce_attribute19 = p_rec.dce_attribute19,
115 dce_attribute20 = p_rec.dce_attribute20,
116 dce_attribute21 = p_rec.dce_attribute21,
117 dce_attribute22 = p_rec.dce_attribute22,
118 dce_attribute23 = p_rec.dce_attribute23,
119 dce_attribute24 = p_rec.dce_attribute24,
120 dce_attribute25 = p_rec.dce_attribute25,
121 dce_attribute26 = p_rec.dce_attribute26,
122 dce_attribute27 = p_rec.dce_attribute27,
123 dce_attribute28 = p_rec.dce_attribute28,
124 dce_attribute29 = p_rec.dce_attribute29,
125 dce_attribute30 = p_rec.dce_attribute30,
126 object_version_number = p_rec.object_version_number,
127 dpnt_rlshp_flag = p_rec.dpnt_rlshp_flag,
128 dpnt_age_flag = p_rec.dpnt_age_flag,
129 dpnt_stud_flag = p_rec.dpnt_stud_flag,
130 dpnt_dsbld_flag = p_rec.dpnt_dsbld_flag,
131 dpnt_mrtl_flag = p_rec.dpnt_mrtl_flag,
132 dpnt_mltry_flag = p_rec.dpnt_mltry_flag,
133 dpnt_pstl_flag = p_rec.dpnt_pstl_flag,
134 dpnt_cvrd_in_anthr_pl_flag = p_rec.dpnt_cvrd_in_anthr_pl_flag,
135 dpnt_dsgnt_crntly_enrld_flag = p_rec.dpnt_dsgnt_crntly_enrld_flag,
136 dpnt_crit_flag = p_rec.dpnt_crit_flag
137 where dpnt_cvg_eligy_prfl_id = p_rec.dpnt_cvg_eligy_prfl_id
138 and effective_start_date = p_validation_start_date
139 and effective_end_date = p_validation_end_date;
140 --
141 ben_dce_shd.g_api_dml := false; -- Unset the api dml status
142 --
143 -- Set the effective start and end dates
144 --
145 p_rec.effective_start_date := p_validation_start_date;
146 p_rec.effective_end_date := p_validation_end_date;
147 End If;
148 --
149 hr_utility.set_location(' Leaving:'||l_proc, 15);
150 Exception
151 When hr_api.check_integrity_violated Then
152 -- A check constraint has been violated
153 ben_dce_shd.g_api_dml := false; -- Unset the api dml status
154 ben_dce_shd.constraint_error
155 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
156 When hr_api.unique_integrity_violated Then
157 -- Unique integrity has been violated
158 ben_dce_shd.g_api_dml := false; -- Unset the api dml status
159 ben_dce_shd.constraint_error
160 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
161 When Others Then
162 ben_dce_shd.g_api_dml := false; -- Unset the api dml status
163 Raise;
164 End dt_update_dml;
165 --
166 -- ----------------------------------------------------------------------------
167 -- |------------------------------< update_dml >------------------------------|
168 -- ----------------------------------------------------------------------------
169 -- {Start Of Comments}
170 --
171 -- Description:
172 -- This procedure calls the dt_update_dml control logic which handles
173 -- the actual datetrack dml.
174 --
175 -- Prerequisites:
176 -- This is an internal private procedure which must be called from the upd
177 -- procedure.
178 --
179 -- In Parameters:
180 -- A Pl/Sql record structre.
181 --
182 -- Post Success:
183 -- Processing contines.
184 --
185 -- Post Failure:
186 -- No specific error handling is required within this procedure.
187 --
188 -- Developer Implementation Notes:
189 -- The update 'set' arguments list should be modified if any of your
190 -- attributes are not updateable.
191 --
192 -- Access Status:
193 -- Internal Row Handler Use Only.
194 --
195 -- {End Of Comments}
196 -- ----------------------------------------------------------------------------
197 Procedure update_dml
198 (p_rec in out nocopy ben_dce_shd.g_rec_type,
199 p_effective_date in date,
200 p_datetrack_mode in varchar2,
201 p_validation_start_date in date,
202 p_validation_end_date in date) is
203 --
204 l_proc varchar2(72) := g_package||'update_dml';
205 --
206 Begin
207 hr_utility.set_location('Entering:'||l_proc, 5);
208 --
209 dt_update_dml(p_rec => p_rec,
210 p_effective_date => p_effective_date,
211 p_datetrack_mode => p_datetrack_mode,
212 p_validation_start_date => p_validation_start_date,
213 p_validation_end_date => p_validation_end_date);
214 --
215 hr_utility.set_location(' Leaving:'||l_proc, 10);
216 End update_dml;
217 --
218 -- ----------------------------------------------------------------------------
219 -- |----------------------------< dt_pre_update >-----------------------------|
220 -- ----------------------------------------------------------------------------
221 -- {Start Of Comments}
222 --
223 -- Description:
224 -- The dt_pre_update procedure controls the execution
225 -- of dml for the datetrack modes of: UPDATE, UPDATE_OVERRIDE
226 -- and UPDATE_CHANGE_INSERT only. The execution required is as
227 -- follows:
228 --
229 -- 1) Providing the datetrack update mode is not 'CORRECTION'
230 -- then set the effective end date of the current row (this
231 -- will be the validation_start_date - 1).
232 -- 2) If the datetrack mode is 'UPDATE_OVERRIDE' then call the
233 -- corresponding delete_dml process to delete any future rows
234 -- where the effective_start_date is greater than or equal to
235 -- the validation_start_date.
236 -- 3) Call the insert_dml process to insert the new updated row
237 -- details..
238 --
239 -- Prerequisites:
240 -- This is an internal procedure which is called from the
241 -- pre_update procedure.
242 --
243 -- In Parameters:
244 --
245 -- Post Success:
246 -- Processing continues.
247 --
248 -- Post Failure:
249 -- If an error has occurred, an error message and exception will be raised
250 -- but not handled.
251 --
252 -- Developer Implementation Notes:
253 -- This is an internal procedure which is required by Datetrack. Don't
254 -- remove or modify.
255 --
256 -- Access Status:
257 -- Internal Row Handler Use Only.
258 --
259 -- {End Of Comments}
260 -- ----------------------------------------------------------------------------
261 Procedure dt_pre_update
262 (p_rec in out nocopy ben_dce_shd.g_rec_type,
263 p_effective_date in date,
264 p_datetrack_mode in varchar2,
265 p_validation_start_date in date,
266 p_validation_end_date in date) is
267 --
268 l_proc varchar2(72) := g_package||'dt_pre_update';
269 l_dummy_version_number number;
270 --
271 Begin
272 hr_utility.set_location('Entering:'||l_proc, 5);
273 If (p_datetrack_mode <> 'CORRECTION') then
274 hr_utility.set_location(l_proc, 10);
275 --
276 -- Update the current effective end date
277 --
278 ben_dce_shd.upd_effective_end_date
279 (p_effective_date => p_effective_date,
280 p_base_key_value => p_rec.dpnt_cvg_eligy_prfl_id,
281 p_new_effective_end_date => (p_validation_start_date - 1),
282 p_validation_start_date => p_validation_start_date,
283 p_validation_end_date => p_validation_end_date,
284 p_object_version_number => l_dummy_version_number);
285 --
286 If (p_datetrack_mode = 'UPDATE_OVERRIDE') then
287 hr_utility.set_location(l_proc, 15);
288 --
289 -- As the datetrack mode is 'UPDATE_OVERRIDE' then we must
290 -- delete any future rows
291 --
292 ben_dce_del.delete_dml
293 (p_rec => p_rec,
294 p_effective_date => p_effective_date,
295 p_datetrack_mode => p_datetrack_mode,
296 p_validation_start_date => p_validation_start_date,
297 p_validation_end_date => p_validation_end_date);
298 End If;
299 hr_utility.set_location(l_proc, 20);
300 --
301 -- We must now insert the updated row
302 --
303 ben_dce_ins.insert_dml
304 (p_rec => p_rec,
305 p_effective_date => p_effective_date,
306 p_datetrack_mode => p_datetrack_mode,
307 p_validation_start_date => p_validation_start_date,
308 p_validation_end_date => p_validation_end_date);
309 End If;
310 hr_utility.set_location(' Leaving:'||l_proc, 20);
311 End dt_pre_update;
312 --
313 -- ----------------------------------------------------------------------------
314 -- |------------------------------< pre_update >------------------------------|
315 -- ----------------------------------------------------------------------------
316 -- {Start Of Comments}
317 --
318 -- Description:
319 -- This private procedure contains any processing which is required before
320 -- the update dml.
321 --
322 -- Prerequisites:
323 -- This is an internal procedure which is called from the upd procedure.
324 --
325 -- In Parameters:
326 -- A Pl/Sql record structre.
327 --
328 -- Post Success:
329 -- Processing continues.
330 --
331 -- Post Failure:
332 -- If an error has occurred, an error message and exception will be raised
333 -- but not handled.
334 --
335 -- Developer Implementation Notes:
336 -- Any pre-processing required before the update dml is issued should be
337 -- coded within this procedure. It is important to note that any 3rd party
338 -- maintenance should be reviewed before placing in this procedure. The call
339 -- to the dt_update_dml procedure should NOT be removed.
340 --
341 -- Access Status:
342 -- Internal Row Handler Use Only.
343 --
344 -- {End Of Comments}
345 -- ----------------------------------------------------------------------------
346 Procedure pre_update
347 (p_rec in out nocopy ben_dce_shd.g_rec_type,
348 p_effective_date in date,
349 p_datetrack_mode in varchar2,
350 p_validation_start_date in date,
351 p_validation_end_date in date) is
352 --
353 l_proc varchar2(72) := g_package||'pre_update';
354 --
355 Begin
356 hr_utility.set_location('Entering:'||l_proc, 5);
357 --
358 --
359 --
360 dt_pre_update
361 (p_rec => p_rec,
362 p_effective_date => p_effective_date,
363 p_datetrack_mode => p_datetrack_mode,
364 p_validation_start_date => p_validation_start_date,
365 p_validation_end_date => p_validation_end_date);
366 --
367 hr_utility.set_location(' Leaving:'||l_proc, 10);
368 End pre_update;
369 --
370 -- ----------------------------------------------------------------------------
371 -- |-----------------------------< post_update >------------------------------|
372 -- ----------------------------------------------------------------------------
373 -- {Start Of Comments}
374 --
375 -- Description:
376 -- This private procedure contains any processing which is required after the
377 -- update dml.
378 --
379 -- Prerequisites:
380 -- This is an internal procedure which is called from the upd procedure.
381 --
382 -- In Parameters:
383 -- A Pl/Sql record structre.
384 --
385 -- Post Success:
386 -- Processing continues.
387 --
388 -- Post Failure:
389 -- If an error has occurred, an error message and exception will be raised
390 -- but not handled.
391 --
392 -- Developer Implementation Notes:
393 -- Any post-processing required after the update dml is issued should be
394 -- coded within this procedure. It is important to note that any 3rd party
395 -- maintenance should be reviewed before placing in this procedure.
396 --
397 -- Access Status:
398 -- Internal Row Handler Use Only.
399 --
400 -- {End Of Comments}
401 -- ----------------------------------------------------------------------------
402 Procedure post_update
403 (p_rec in ben_dce_shd.g_rec_type,
404 p_effective_date in date,
405 p_datetrack_mode in varchar2,
406 p_validation_start_date in date,
407 p_validation_end_date in date) is
408 --
409 l_proc varchar2(72) := g_package||'post_update';
410 --
411 Begin
412 hr_utility.set_location('Entering:'||l_proc, 5);
413 --
414 --
415 -- Start of API User Hook for post_update.
416 --
417 begin
418 --
419 ben_dce_rku.after_update
420 (
421 p_dpnt_cvg_eligy_prfl_id =>p_rec.dpnt_cvg_eligy_prfl_id
422 ,p_effective_end_date =>p_rec.effective_end_date
423 ,p_effective_start_date =>p_rec.effective_start_date
424 ,p_business_group_id =>p_rec.business_group_id
425 ,p_regn_id =>p_rec.regn_id
426 ,p_name =>p_rec.name
427 ,p_dpnt_cvg_eligy_prfl_stat_cd =>p_rec.dpnt_cvg_eligy_prfl_stat_cd
428 ,p_dce_desc =>p_rec.dce_desc
429 -- ,p_military_status_rqmt_ind =>p_rec.military_status_rqmt_ind
430 ,p_dpnt_cvg_elig_det_rl =>p_rec.dpnt_cvg_elig_det_rl
431 ,p_dce_attribute_category =>p_rec.dce_attribute_category
432 ,p_dce_attribute1 =>p_rec.dce_attribute1
433 ,p_dce_attribute2 =>p_rec.dce_attribute2
434 ,p_dce_attribute3 =>p_rec.dce_attribute3
435 ,p_dce_attribute4 =>p_rec.dce_attribute4
436 ,p_dce_attribute5 =>p_rec.dce_attribute5
437 ,p_dce_attribute6 =>p_rec.dce_attribute6
438 ,p_dce_attribute7 =>p_rec.dce_attribute7
439 ,p_dce_attribute8 =>p_rec.dce_attribute8
440 ,p_dce_attribute9 =>p_rec.dce_attribute9
441 ,p_dce_attribute10 =>p_rec.dce_attribute10
442 ,p_dce_attribute11 =>p_rec.dce_attribute11
443 ,p_dce_attribute12 =>p_rec.dce_attribute12
444 ,p_dce_attribute13 =>p_rec.dce_attribute13
445 ,p_dce_attribute14 =>p_rec.dce_attribute14
446 ,p_dce_attribute15 =>p_rec.dce_attribute15
447 ,p_dce_attribute16 =>p_rec.dce_attribute16
448 ,p_dce_attribute17 =>p_rec.dce_attribute17
449 ,p_dce_attribute18 =>p_rec.dce_attribute18
450 ,p_dce_attribute19 =>p_rec.dce_attribute19
451 ,p_dce_attribute20 =>p_rec.dce_attribute20
452 ,p_dce_attribute21 =>p_rec.dce_attribute21
453 ,p_dce_attribute22 =>p_rec.dce_attribute22
454 ,p_dce_attribute23 =>p_rec.dce_attribute23
455 ,p_dce_attribute24 =>p_rec.dce_attribute24
456 ,p_dce_attribute25 =>p_rec.dce_attribute25
457 ,p_dce_attribute26 =>p_rec.dce_attribute26
458 ,p_dce_attribute27 =>p_rec.dce_attribute27
459 ,p_dce_attribute28 =>p_rec.dce_attribute28
460 ,p_dce_attribute29 =>p_rec.dce_attribute29
461 ,p_dce_attribute30 =>p_rec.dce_attribute30
462 ,p_object_version_number =>p_rec.object_version_number
463 ,p_effective_date =>p_effective_date
464 ,p_datetrack_mode =>p_datetrack_mode
465 ,p_validation_start_date =>p_validation_start_date
466 ,p_validation_end_date =>p_validation_end_date
467 ,p_dpnt_rlshp_flag =>p_rec.dpnt_rlshp_flag
468 ,p_dpnt_age_flag =>p_rec.dpnt_age_flag
469 ,p_dpnt_stud_flag =>p_rec.dpnt_stud_flag
470 ,p_dpnt_dsbld_flag =>p_rec.dpnt_dsbld_flag
471 ,p_dpnt_mrtl_flag =>p_rec.dpnt_mrtl_flag
472 ,p_dpnt_mltry_flag =>p_rec.dpnt_mltry_flag
473 ,p_dpnt_pstl_flag =>p_rec.dpnt_pstl_flag
474 ,p_dpnt_cvrd_in_anthr_pl_flag =>p_rec.dpnt_cvrd_in_anthr_pl_flag
475 ,p_dpnt_dsgnt_crntly_enrld_flag =>p_rec.dpnt_dsgnt_crntly_enrld_flag
476 ,p_dpnt_crit_flag =>p_rec.dpnt_crit_flag
477 ,p_effective_end_date_o =>ben_dce_shd.g_old_rec.effective_end_date
478 ,p_effective_start_date_o =>ben_dce_shd.g_old_rec.effective_start_date
479 ,p_business_group_id_o =>ben_dce_shd.g_old_rec.business_group_id
480 ,p_regn_id_o =>ben_dce_shd.g_old_rec.regn_id
481 ,p_name_o =>ben_dce_shd.g_old_rec.name
482 ,p_dpnt_cvg_eligy_prfl_stat_c_o =>ben_dce_shd.g_old_rec.dpnt_cvg_eligy_prfl_stat_cd
483 ,p_dce_desc_o =>ben_dce_shd.g_old_rec.dce_desc
484 -- ,p_military_status_rqmt_ind_o =>ben_dce_shd.g_old_rec.military_status_rqmt_ind
485 ,p_dpnt_cvg_elig_det_rl_o =>ben_dce_shd.g_old_rec.dpnt_cvg_elig_det_rl
486 ,p_dce_attribute_category_o =>ben_dce_shd.g_old_rec.dce_attribute_category
487 ,p_dce_attribute1_o =>ben_dce_shd.g_old_rec.dce_attribute1
488 ,p_dce_attribute2_o =>ben_dce_shd.g_old_rec.dce_attribute2
489 ,p_dce_attribute3_o =>ben_dce_shd.g_old_rec.dce_attribute3
490 ,p_dce_attribute4_o =>ben_dce_shd.g_old_rec.dce_attribute4
491 ,p_dce_attribute5_o =>ben_dce_shd.g_old_rec.dce_attribute5
492 ,p_dce_attribute6_o =>ben_dce_shd.g_old_rec.dce_attribute6
493 ,p_dce_attribute7_o =>ben_dce_shd.g_old_rec.dce_attribute7
494 ,p_dce_attribute8_o =>ben_dce_shd.g_old_rec.dce_attribute8
495 ,p_dce_attribute9_o =>ben_dce_shd.g_old_rec.dce_attribute9
496 ,p_dce_attribute10_o =>ben_dce_shd.g_old_rec.dce_attribute10
497 ,p_dce_attribute11_o =>ben_dce_shd.g_old_rec.dce_attribute11
498 ,p_dce_attribute12_o =>ben_dce_shd.g_old_rec.dce_attribute12
499 ,p_dce_attribute13_o =>ben_dce_shd.g_old_rec.dce_attribute13
500 ,p_dce_attribute14_o =>ben_dce_shd.g_old_rec.dce_attribute14
501 ,p_dce_attribute15_o =>ben_dce_shd.g_old_rec.dce_attribute15
502 ,p_dce_attribute16_o =>ben_dce_shd.g_old_rec.dce_attribute16
503 ,p_dce_attribute17_o =>ben_dce_shd.g_old_rec.dce_attribute17
504 ,p_dce_attribute18_o =>ben_dce_shd.g_old_rec.dce_attribute18
505 ,p_dce_attribute19_o =>ben_dce_shd.g_old_rec.dce_attribute19
506 ,p_dce_attribute20_o =>ben_dce_shd.g_old_rec.dce_attribute20
507 ,p_dce_attribute21_o =>ben_dce_shd.g_old_rec.dce_attribute21
508 ,p_dce_attribute22_o =>ben_dce_shd.g_old_rec.dce_attribute22
509 ,p_dce_attribute23_o =>ben_dce_shd.g_old_rec.dce_attribute23
510 ,p_dce_attribute24_o =>ben_dce_shd.g_old_rec.dce_attribute24
511 ,p_dce_attribute25_o =>ben_dce_shd.g_old_rec.dce_attribute25
512 ,p_dce_attribute26_o =>ben_dce_shd.g_old_rec.dce_attribute26
513 ,p_dce_attribute27_o =>ben_dce_shd.g_old_rec.dce_attribute27
514 ,p_dce_attribute28_o =>ben_dce_shd.g_old_rec.dce_attribute28
515 ,p_dce_attribute29_o =>ben_dce_shd.g_old_rec.dce_attribute29
516 ,p_dce_attribute30_o =>ben_dce_shd.g_old_rec.dce_attribute30
517 ,p_object_version_number_o =>ben_dce_shd.g_old_rec.object_version_number
518 ,p_dpnt_rlshp_flag_o =>ben_dce_shd.g_old_rec.dpnt_rlshp_flag
519 ,p_dpnt_age_flag_o =>ben_dce_shd.g_old_rec.dpnt_age_flag
520 ,p_dpnt_stud_flag_o =>ben_dce_shd.g_old_rec.dpnt_stud_flag
521 ,p_dpnt_dsbld_flag_o =>ben_dce_shd.g_old_rec.dpnt_dsbld_flag
522 ,p_dpnt_mrtl_flag_o =>ben_dce_shd.g_old_rec.dpnt_mrtl_flag
523 ,p_dpnt_mltry_flag_o =>ben_dce_shd.g_old_rec.dpnt_mltry_flag
524 ,p_dpnt_pstl_flag_o =>ben_dce_shd.g_old_rec.dpnt_pstl_flag
525 ,p_dpnt_cvrd_in_anthr_pl_flag_o =>ben_dce_shd.g_old_rec.dpnt_cvrd_in_anthr_pl_flag
526 ,p_dpnt_dsgnt_crntly_enrld_fl_o =>ben_dce_shd.g_old_rec.dpnt_dsgnt_crntly_enrld_flag
527 ,p_dpnt_crit_flag_o =>ben_dce_shd.g_old_rec.dpnt_crit_flag
528 );
529 --
530 exception
531 --
532 when hr_api.cannot_find_prog_unit then
533 --
534 hr_api.cannot_find_prog_unit_error
535 (p_module_name => 'ben_dpnt_cvg_eligy_prfl_f'
536 ,p_hook_type => 'AU');
537 --
538 end;
539 --
540 -- End of API User Hook for post_update.
541 --
542 --
543 hr_utility.set_location(' Leaving:'||l_proc, 10);
544 End post_update;
545 --
546 -- ----------------------------------------------------------------------------
547 -- |-----------------------------< convert_defs >-----------------------------|
548 -- ----------------------------------------------------------------------------
549 -- {Start Of Comments}
550 --
551 -- Description:
552 -- The Convert_Defs procedure has one very important function:
553 -- It must return the record structure for the row with all system defaulted
554 -- values converted into its corresponding parameter value for update. When
555 -- we attempt to update a row through the Upd process , certain
556 -- parameters can be defaulted which enables flexibility in the calling of
557 -- the upd process (e.g. only attributes which need to be updated need to be
558 -- specified). For the upd process to determine which attributes
559 -- have NOT been specified we need to check if the parameter has a reserved
560 -- system default value. Therefore, for all parameters which have a
561 -- corresponding reserved system default mechanism specified we need to
562 -- check if a system default is being used. If a system default is being
563 -- used then we convert the defaulted value into its corresponding attribute
564 -- value held in the g_old_rec data structure.
565 --
566 -- Prerequisites:
567 -- This private function can only be called from the upd process.
568 --
569 -- In Parameters:
570 -- A Pl/Sql record structre.
571 --
572 -- Post Success:
573 -- The record structure will be returned with all system defaulted parameter
574 -- values converted into its current row attribute value.
575 --
576 -- Post Failure:
577 -- No direct error handling is required within this function. Any possible
578 -- errors within this procedure will be a PL/SQL value error due to conversion
579 -- of datatypes or data lengths.
580 --
581 -- Developer Implementation Notes:
582 -- None.
583 --
584 -- Access Status:
585 -- Internal Row Handler Use Only.
586 --
587 -- {End Of Comments}
588 -- ----------------------------------------------------------------------------
589 Procedure convert_defs(p_rec in out nocopy ben_dce_shd.g_rec_type) is
590 --
591 l_proc varchar2(72) := g_package||'convert_defs';
592 --
593 Begin
594 --
595 hr_utility.set_location('Entering:'||l_proc, 5);
596 --
597 -- We must now examine each argument value in the
598 -- p_rec plsql record structure
599 -- to see if a system default is being used. If a system default
600 -- is being used then we must set to the 'current' argument value.
601 --
602 If (p_rec.business_group_id = hr_api.g_number) then
603 p_rec.business_group_id :=
604 ben_dce_shd.g_old_rec.business_group_id;
605 End If;
606 If (p_rec.regn_id = hr_api.g_number) then
607 p_rec.regn_id :=
608 ben_dce_shd.g_old_rec.regn_id;
609 End If;
610 If (p_rec.name = hr_api.g_varchar2) then
611 p_rec.name :=
612 ben_dce_shd.g_old_rec.name;
613 End If;
614 If (p_rec.dpnt_cvg_eligy_prfl_stat_cd = hr_api.g_varchar2) then
615 p_rec.dpnt_cvg_eligy_prfl_stat_cd :=
616 ben_dce_shd.g_old_rec.dpnt_cvg_eligy_prfl_stat_cd;
617 End If;
618 If (p_rec.dce_desc = hr_api.g_varchar2) then
619 p_rec.dce_desc :=
620 ben_dce_shd.g_old_rec.dce_desc;
621 End If;
622 -- If (p_rec.military_status_rqmt_ind = hr_api.g_varchar2) then
623 -- p_rec.military_status_rqmt_ind :=
624 -- ben_dce_shd.g_old_rec.military_status_rqmt_ind;
625 -- End If;
626 If (p_rec.dpnt_cvg_elig_det_rl = hr_api.g_number) then
627 p_rec.dpnt_cvg_elig_det_rl :=
628 ben_dce_shd.g_old_rec.dpnt_cvg_elig_det_rl;
629 End If;
630 If (p_rec.dce_attribute_category = hr_api.g_varchar2) then
631 p_rec.dce_attribute_category :=
632 ben_dce_shd.g_old_rec.dce_attribute_category;
633 End If;
634 If (p_rec.dce_attribute1 = hr_api.g_varchar2) then
635 p_rec.dce_attribute1 :=
636 ben_dce_shd.g_old_rec.dce_attribute1;
637 End If;
638 If (p_rec.dce_attribute2 = hr_api.g_varchar2) then
639 p_rec.dce_attribute2 :=
640 ben_dce_shd.g_old_rec.dce_attribute2;
641 End If;
642 If (p_rec.dce_attribute3 = hr_api.g_varchar2) then
643 p_rec.dce_attribute3 :=
644 ben_dce_shd.g_old_rec.dce_attribute3;
645 End If;
646 If (p_rec.dce_attribute4 = hr_api.g_varchar2) then
647 p_rec.dce_attribute4 :=
648 ben_dce_shd.g_old_rec.dce_attribute4;
649 End If;
650 If (p_rec.dce_attribute5 = hr_api.g_varchar2) then
651 p_rec.dce_attribute5 :=
652 ben_dce_shd.g_old_rec.dce_attribute5;
653 End If;
654 If (p_rec.dce_attribute6 = hr_api.g_varchar2) then
655 p_rec.dce_attribute6 :=
656 ben_dce_shd.g_old_rec.dce_attribute6;
657 End If;
658 If (p_rec.dce_attribute7 = hr_api.g_varchar2) then
659 p_rec.dce_attribute7 :=
660 ben_dce_shd.g_old_rec.dce_attribute7;
661 End If;
662 If (p_rec.dce_attribute8 = hr_api.g_varchar2) then
663 p_rec.dce_attribute8 :=
664 ben_dce_shd.g_old_rec.dce_attribute8;
665 End If;
666 If (p_rec.dce_attribute9 = hr_api.g_varchar2) then
667 p_rec.dce_attribute9 :=
668 ben_dce_shd.g_old_rec.dce_attribute9;
669 End If;
670 If (p_rec.dce_attribute10 = hr_api.g_varchar2) then
671 p_rec.dce_attribute10 :=
672 ben_dce_shd.g_old_rec.dce_attribute10;
673 End If;
674 If (p_rec.dce_attribute11 = hr_api.g_varchar2) then
675 p_rec.dce_attribute11 :=
676 ben_dce_shd.g_old_rec.dce_attribute11;
677 End If;
678 If (p_rec.dce_attribute12 = hr_api.g_varchar2) then
679 p_rec.dce_attribute12 :=
680 ben_dce_shd.g_old_rec.dce_attribute12;
681 End If;
682 If (p_rec.dce_attribute13 = hr_api.g_varchar2) then
683 p_rec.dce_attribute13 :=
684 ben_dce_shd.g_old_rec.dce_attribute13;
685 End If;
686 If (p_rec.dce_attribute14 = hr_api.g_varchar2) then
687 p_rec.dce_attribute14 :=
688 ben_dce_shd.g_old_rec.dce_attribute14;
689 End If;
690 If (p_rec.dce_attribute15 = hr_api.g_varchar2) then
691 p_rec.dce_attribute15 :=
692 ben_dce_shd.g_old_rec.dce_attribute15;
693 End If;
694 If (p_rec.dce_attribute16 = hr_api.g_varchar2) then
695 p_rec.dce_attribute16 :=
696 ben_dce_shd.g_old_rec.dce_attribute16;
697 End If;
698 If (p_rec.dce_attribute17 = hr_api.g_varchar2) then
699 p_rec.dce_attribute17 :=
700 ben_dce_shd.g_old_rec.dce_attribute17;
701 End If;
702 If (p_rec.dce_attribute18 = hr_api.g_varchar2) then
703 p_rec.dce_attribute18 :=
704 ben_dce_shd.g_old_rec.dce_attribute18;
705 End If;
706 If (p_rec.dce_attribute19 = hr_api.g_varchar2) then
707 p_rec.dce_attribute19 :=
708 ben_dce_shd.g_old_rec.dce_attribute19;
709 End If;
710 If (p_rec.dce_attribute20 = hr_api.g_varchar2) then
711 p_rec.dce_attribute20 :=
712 ben_dce_shd.g_old_rec.dce_attribute20;
713 End If;
714 If (p_rec.dce_attribute21 = hr_api.g_varchar2) then
715 p_rec.dce_attribute21 :=
716 ben_dce_shd.g_old_rec.dce_attribute21;
717 End If;
718 If (p_rec.dce_attribute22 = hr_api.g_varchar2) then
719 p_rec.dce_attribute22 :=
720 ben_dce_shd.g_old_rec.dce_attribute22;
721 End If;
722 If (p_rec.dce_attribute23 = hr_api.g_varchar2) then
723 p_rec.dce_attribute23 :=
724 ben_dce_shd.g_old_rec.dce_attribute23;
725 End If;
726 If (p_rec.dce_attribute24 = hr_api.g_varchar2) then
727 p_rec.dce_attribute24 :=
728 ben_dce_shd.g_old_rec.dce_attribute24;
729 End If;
730 If (p_rec.dce_attribute25 = hr_api.g_varchar2) then
731 p_rec.dce_attribute25 :=
732 ben_dce_shd.g_old_rec.dce_attribute25;
733 End If;
734 If (p_rec.dce_attribute26 = hr_api.g_varchar2) then
735 p_rec.dce_attribute26 :=
736 ben_dce_shd.g_old_rec.dce_attribute26;
737 End If;
738 If (p_rec.dce_attribute27 = hr_api.g_varchar2) then
739 p_rec.dce_attribute27 :=
740 ben_dce_shd.g_old_rec.dce_attribute27;
741 End If;
742 If (p_rec.dce_attribute28 = hr_api.g_varchar2) then
743 p_rec.dce_attribute28 :=
744 ben_dce_shd.g_old_rec.dce_attribute28;
745 End If;
746 If (p_rec.dce_attribute29 = hr_api.g_varchar2) then
747 p_rec.dce_attribute29 :=
748 ben_dce_shd.g_old_rec.dce_attribute29;
749 End If;
750 If (p_rec.dce_attribute30 = hr_api.g_varchar2) then
751 p_rec.dce_attribute30 :=
752 ben_dce_shd.g_old_rec.dce_attribute30;
753 End If;
754 If (p_rec.dpnt_rlshp_flag = hr_api.g_varchar2) then
755 p_rec.dpnt_rlshp_flag :=
756 ben_dce_shd.g_old_rec.dpnt_rlshp_flag;
757 End If;
758 If (p_rec.dpnt_age_flag = hr_api.g_varchar2) then
759 p_rec.dpnt_age_flag :=
760 ben_dce_shd.g_old_rec.dpnt_age_flag;
761 End If;
762 If (p_rec.dpnt_stud_flag = hr_api.g_varchar2) then
763 p_rec.dpnt_stud_flag :=
764 ben_dce_shd.g_old_rec.dpnt_stud_flag;
765 End If;
766 If (p_rec.dpnt_dsbld_flag = hr_api.g_varchar2) then
767 p_rec.dpnt_dsbld_flag :=
768 ben_dce_shd.g_old_rec.dpnt_dsbld_flag;
769 End If;
770 If (p_rec.dpnt_mrtl_flag = hr_api.g_varchar2) then
771 p_rec.dpnt_mrtl_flag :=
772 ben_dce_shd.g_old_rec.dpnt_mrtl_flag;
773 End If;
774 If (p_rec.dpnt_mltry_flag = hr_api.g_varchar2) then
775 p_rec.dpnt_mltry_flag :=
776 ben_dce_shd.g_old_rec.dpnt_mltry_flag;
777 End If;
778 If (p_rec.dpnt_pstl_flag = hr_api.g_varchar2) then
779 p_rec.dpnt_pstl_flag :=
780 ben_dce_shd.g_old_rec.dpnt_pstl_flag;
781 End If;
782 If (p_rec.dpnt_cvrd_in_anthr_pl_flag = hr_api.g_varchar2) then
783 p_rec.dpnt_cvrd_in_anthr_pl_flag :=
784 ben_dce_shd.g_old_rec.dpnt_cvrd_in_anthr_pl_flag;
785 End If;
786 If (p_rec.dpnt_dsgnt_crntly_enrld_flag = hr_api.g_varchar2) then
787 p_rec.dpnt_dsgnt_crntly_enrld_flag :=
788 ben_dce_shd.g_old_rec.dpnt_dsgnt_crntly_enrld_flag;
789 End If;
790 If (p_rec.dpnt_crit_flag = hr_api.g_varchar2) then
791 p_rec.dpnt_crit_flag :=
792 ben_dce_shd.g_old_rec.dpnt_crit_flag;
793 End If;
794 --
795 hr_utility.set_location(' Leaving:'||l_proc, 10);
796 --
797 End convert_defs;
798 --
799 -- ----------------------------------------------------------------------------
800 -- |---------------------------------< upd >----------------------------------|
801 -- ----------------------------------------------------------------------------
802 Procedure upd
803 (
804 p_rec in out nocopy ben_dce_shd.g_rec_type,
805 p_effective_date in date,
806 p_datetrack_mode in varchar2
807 ) is
808 --
809 l_proc varchar2(72) := g_package||'upd';
810 l_validation_start_date date;
811 l_validation_end_date date;
812 --
813 Begin
814 hr_utility.set_location('Entering:'||l_proc, 5);
815 --
816 -- Ensure that the DateTrack update mode is valid
817 --
818 dt_api.validate_dt_upd_mode(p_datetrack_mode => p_datetrack_mode);
819 --
820 -- We must lock the row which we need to update.
821 --
822 ben_dce_shd.lck
823 (p_effective_date => p_effective_date,
824 p_datetrack_mode => p_datetrack_mode,
825 p_dpnt_cvg_eligy_prfl_id => p_rec.dpnt_cvg_eligy_prfl_id,
826 p_object_version_number => p_rec.object_version_number,
827 p_validation_start_date => l_validation_start_date,
828 p_validation_end_date => l_validation_end_date);
829 --
830 -- 1. During an update system defaults are used to determine if
831 -- arguments have been defaulted or not. We must therefore
832 -- derive the full record structure values to be updated.
833 --
834 -- 2. Call the supporting update validate operations.
835 --
836 convert_defs(p_rec);
837 ben_dce_bus.update_validate
838 (p_rec => p_rec,
839 p_effective_date => p_effective_date,
840 p_datetrack_mode => p_datetrack_mode,
841 p_validation_start_date => l_validation_start_date,
842 p_validation_end_date => l_validation_end_date);
843 --
844 -- Call the supporting pre-update operation
845 --
846 pre_update
847 (p_rec => p_rec,
848 p_effective_date => p_effective_date,
849 p_datetrack_mode => p_datetrack_mode,
850 p_validation_start_date => l_validation_start_date,
851 p_validation_end_date => l_validation_end_date);
852 --
853 -- Update the row.
854 --
855 update_dml
856 (p_rec => p_rec,
857 p_effective_date => p_effective_date,
858 p_datetrack_mode => p_datetrack_mode,
859 p_validation_start_date => l_validation_start_date,
860 p_validation_end_date => l_validation_end_date);
861 --
862 -- Call the supporting post-update operation
863 --
864 post_update
865 (p_rec => p_rec,
866 p_effective_date => p_effective_date,
867 p_datetrack_mode => p_datetrack_mode,
868 p_validation_start_date => l_validation_start_date,
869 p_validation_end_date => l_validation_end_date);
870 End upd;
871 --
872 -- ----------------------------------------------------------------------------
873 -- |---------------------------------< upd >----------------------------------|
874 -- ----------------------------------------------------------------------------
875 Procedure upd
876 (
877 p_dpnt_cvg_eligy_prfl_id in number,
878 p_effective_end_date out nocopy date,
879 p_effective_start_date out nocopy date,
880 p_business_group_id in number default hr_api.g_number,
881 p_regn_id in number default hr_api.g_number,
882 p_name in varchar2 default hr_api.g_varchar2,
883 p_dpnt_cvg_eligy_prfl_stat_cd in varchar2 default hr_api.g_varchar2,
884 p_dce_desc in varchar2 default hr_api.g_varchar2,
885 -- p_military_status_rqmt_ind in varchar2 default hr_api.g_varchar2,
886 p_dpnt_cvg_elig_det_rl in number default hr_api.g_number,
887 p_dce_attribute_category in varchar2 default hr_api.g_varchar2,
888 p_dce_attribute1 in varchar2 default hr_api.g_varchar2,
889 p_dce_attribute2 in varchar2 default hr_api.g_varchar2,
890 p_dce_attribute3 in varchar2 default hr_api.g_varchar2,
891 p_dce_attribute4 in varchar2 default hr_api.g_varchar2,
892 p_dce_attribute5 in varchar2 default hr_api.g_varchar2,
893 p_dce_attribute6 in varchar2 default hr_api.g_varchar2,
894 p_dce_attribute7 in varchar2 default hr_api.g_varchar2,
895 p_dce_attribute8 in varchar2 default hr_api.g_varchar2,
896 p_dce_attribute9 in varchar2 default hr_api.g_varchar2,
897 p_dce_attribute10 in varchar2 default hr_api.g_varchar2,
898 p_dce_attribute11 in varchar2 default hr_api.g_varchar2,
899 p_dce_attribute12 in varchar2 default hr_api.g_varchar2,
900 p_dce_attribute13 in varchar2 default hr_api.g_varchar2,
901 p_dce_attribute14 in varchar2 default hr_api.g_varchar2,
902 p_dce_attribute15 in varchar2 default hr_api.g_varchar2,
903 p_dce_attribute16 in varchar2 default hr_api.g_varchar2,
904 p_dce_attribute17 in varchar2 default hr_api.g_varchar2,
905 p_dce_attribute18 in varchar2 default hr_api.g_varchar2,
906 p_dce_attribute19 in varchar2 default hr_api.g_varchar2,
907 p_dce_attribute20 in varchar2 default hr_api.g_varchar2,
908 p_dce_attribute21 in varchar2 default hr_api.g_varchar2,
909 p_dce_attribute22 in varchar2 default hr_api.g_varchar2,
910 p_dce_attribute23 in varchar2 default hr_api.g_varchar2,
911 p_dce_attribute24 in varchar2 default hr_api.g_varchar2,
912 p_dce_attribute25 in varchar2 default hr_api.g_varchar2,
913 p_dce_attribute26 in varchar2 default hr_api.g_varchar2,
914 p_dce_attribute27 in varchar2 default hr_api.g_varchar2,
915 p_dce_attribute28 in varchar2 default hr_api.g_varchar2,
916 p_dce_attribute29 in varchar2 default hr_api.g_varchar2,
917 p_dce_attribute30 in varchar2 default hr_api.g_varchar2,
918 p_object_version_number in out nocopy number,
919 p_effective_date in date,
920 p_datetrack_mode in varchar2,
921 p_dpnt_rlshp_flag in varchar2 default hr_api.g_varchar2,
922 p_dpnt_age_flag in varchar2 default hr_api.g_varchar2,
923 p_dpnt_stud_flag in varchar2 default hr_api.g_varchar2,
924 p_dpnt_dsbld_flag in varchar2 default hr_api.g_varchar2,
925 p_dpnt_mrtl_flag in varchar2 default hr_api.g_varchar2,
926 p_dpnt_mltry_flag in varchar2 default hr_api.g_varchar2,
927 p_dpnt_pstl_flag in varchar2 default hr_api.g_varchar2,
928 p_dpnt_cvrd_in_anthr_pl_flag in varchar2 default hr_api.g_varchar2,
929 p_dpnt_dsgnt_crntly_enrld_flag in varchar2 default hr_api.g_varchar2,
930 p_dpnt_crit_flag in varchar2 default hr_api.g_varchar2
931 ) is
932 --
933 l_rec ben_dce_shd.g_rec_type;
934 l_proc varchar2(72) := g_package||'upd';
935 --
936 Begin
937 hr_utility.set_location('Entering:'||l_proc, 5);
938 --
939 -- Call conversion function to turn arguments into the
940 -- l_rec structure.
941 --
942 l_rec :=
943 ben_dce_shd.convert_args
944 (
945 p_dpnt_cvg_eligy_prfl_id,
946 null,
947 null,
948 p_business_group_id,
949 p_regn_id,
950 p_name,
951 p_dpnt_cvg_eligy_prfl_stat_cd,
952 p_dce_desc,
953 -- p_military_status_rqmt_ind,
954 p_dpnt_cvg_elig_det_rl,
955 p_dce_attribute_category,
956 p_dce_attribute1,
957 p_dce_attribute2,
958 p_dce_attribute3,
959 p_dce_attribute4,
960 p_dce_attribute5,
961 p_dce_attribute6,
962 p_dce_attribute7,
963 p_dce_attribute8,
964 p_dce_attribute9,
965 p_dce_attribute10,
966 p_dce_attribute11,
967 p_dce_attribute12,
968 p_dce_attribute13,
969 p_dce_attribute14,
970 p_dce_attribute15,
971 p_dce_attribute16,
972 p_dce_attribute17,
973 p_dce_attribute18,
974 p_dce_attribute19,
975 p_dce_attribute20,
976 p_dce_attribute21,
977 p_dce_attribute22,
978 p_dce_attribute23,
979 p_dce_attribute24,
980 p_dce_attribute25,
981 p_dce_attribute26,
982 p_dce_attribute27,
983 p_dce_attribute28,
984 p_dce_attribute29,
985 p_dce_attribute30,
986 p_object_version_number,
987 p_dpnt_rlshp_flag,
988 p_dpnt_age_flag,
989 p_dpnt_stud_flag,
990 p_dpnt_dsbld_flag,
991 p_dpnt_mrtl_flag,
992 p_dpnt_mltry_flag,
993 p_dpnt_pstl_flag,
994 p_dpnt_cvrd_in_anthr_pl_flag,
995 p_dpnt_dsgnt_crntly_enrld_flag,
996 p_dpnt_crit_flag
997 );
998 --
999 -- Having converted the arguments into the
1000 -- plsql record structure we call the corresponding record
1001 -- business process.
1002 --
1003 upd(l_rec, p_effective_date, p_datetrack_mode);
1004 p_object_version_number := l_rec.object_version_number;
1005 p_effective_start_date := l_rec.effective_start_date;
1006 p_effective_end_date := l_rec.effective_end_date;
1007 --
1008 --
1009 hr_utility.set_location(' Leaving:'||l_proc, 10);
1010 End upd;
1011 --
1012 end ben_dce_upd;