1 Package Body ben_ecv_upd as
2 /* $Header: beecvrhi.pkb 120.1 2005/07/29 09:50:17 rbingi noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' ben_ecv_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_ecv_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_eligy_crit_values_f',
78 p_base_key_column => 'eligy_crit_values_id',
79 p_base_key_value => p_rec.eligy_crit_values_id);
80 --
81 ben_ecv_shd.g_api_dml := true; -- Set the api dml status
82 --
83 -- Update the ben_eligy_crit_vlaues_f Row
84 --
85 update ben_eligy_crit_values_f
86 set
87 eligy_crit_values_id = p_rec.eligy_crit_values_id,
88 eligy_prfl_id = p_rec.eligy_prfl_id,
89 eligy_criteria_id = p_rec.eligy_criteria_id,
90 -- effective_start_date = p_rec.effective_start_date,
91 -- effective_end_date = p_rec.effective_end_date,
92 ordr_num = p_rec.ordr_num,
93 number_value1 = p_rec.number_value1,
94 number_value2 = p_rec.number_value2,
95 char_value1 = p_rec.char_value1,
96 char_value2 = p_rec.char_value2,
97 date_value1 = p_rec.date_value1,
98 date_value2 = p_rec.date_value2,
99 excld_flag = p_rec.excld_flag,
100 business_group_id = p_rec.business_group_id,
101 legislation_code = p_rec.legislation_code,
102 ecv_attribute_category = p_rec.ecv_attribute_category,
103 ecv_attribute1 = p_rec.ecv_attribute1,
104 ecv_attribute2 = p_rec.ecv_attribute2,
105 ecv_attribute3 = p_rec.ecv_attribute3,
106 ecv_attribute4 = p_rec.ecv_attribute4,
107 ecv_attribute5 = p_rec.ecv_attribute5,
108 ecv_attribute6 = p_rec.ecv_attribute6,
109 ecv_attribute7 = p_rec.ecv_attribute7,
110 ecv_attribute8 = p_rec.ecv_attribute8,
111 ecv_attribute9 = p_rec.ecv_attribute9,
112 ecv_attribute10 = p_rec.ecv_attribute10,
113 ecv_attribute11 = p_rec.ecv_attribute11,
114 ecv_attribute12 = p_rec.ecv_attribute12,
115 ecv_attribute13 = p_rec.ecv_attribute13,
116 ecv_attribute14 = p_rec.ecv_attribute14,
117 ecv_attribute15 = p_rec.ecv_attribute15,
118 ecv_attribute16 = p_rec.ecv_attribute16,
119 ecv_attribute17 = p_rec.ecv_attribute17,
120 ecv_attribute18 = p_rec.ecv_attribute18,
121 ecv_attribute19 = p_rec.ecv_attribute19,
122 ecv_attribute20 = p_rec.ecv_attribute20,
123 ecv_attribute21 = p_rec.ecv_attribute21,
124 ecv_attribute22 = p_rec.ecv_attribute22,
125 ecv_attribute23 = p_rec.ecv_attribute23,
126 ecv_attribute24 = p_rec.ecv_attribute24,
127 ecv_attribute25 = p_rec.ecv_attribute25,
128 ecv_attribute26 = p_rec.ecv_attribute26,
129 ecv_attribute27 = p_rec.ecv_attribute27,
130 ecv_attribute28 = p_rec.ecv_attribute28,
131 ecv_attribute29 = p_rec.ecv_attribute29,
132 ecv_attribute30 = p_rec.ecv_attribute30,
133 object_version_number = p_rec.object_version_number,
134 criteria_score = p_rec.criteria_score,
135 criteria_weight = p_rec.criteria_weight,
136 char_value3 = p_rec.char_value3,
137 char_value4 = p_rec.char_value4,
138 number_value3 = p_rec.number_value3,
139 number_value4 = p_rec.number_value4,
140 date_value3 = p_rec.date_value3,
141 date_value4 = p_rec.date_value4
142 where eligy_crit_values_id = p_rec.eligy_crit_values_id
143 and effective_start_date = p_validation_start_date
144 and effective_end_date = p_validation_end_date;
145 --
146 ben_ecv_shd.g_api_dml := false; --unset the api dml status
147 --
148 --
149 -- Set the effective start and end dates
150 --
151 p_rec.effective_start_date := p_validation_start_date;
152 p_rec.effective_end_date := p_validation_end_date;
153 End If;
154 --
155 hr_utility.set_location(' Leaving:'||l_proc, 15);
156 Exception
157 When hr_api.check_integrity_violated Then
158 -- A check constraint has been violated
159 ben_ecv_shd.g_api_dml := false; --unset the api dml status
160 ben_ecv_shd.constraint_error
161 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
162 When hr_api.unique_integrity_violated Then
163 -- Unique integrity has been violated
164 ben_ecv_shd.g_api_dml := false; -- Unset the api dml status
165 ben_ecv_shd.constraint_error
166 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
167 When Others Then
168 ben_ecv_shd.g_api_dml := false; -- Unset the api dml status
169 Raise;
170 End dt_update_dml;
171 --
172 -- ----------------------------------------------------------------------------
173 -- |------------------------------< update_dml >------------------------------|
174 -- ----------------------------------------------------------------------------
175 -- {Start Of Comments}
176 --
177 -- Description:
178 -- This procedure calls the dt_update_dml control logic which handles
179 -- the actual datetrack dml.
180 --
181 -- Prerequisites:
182 -- This is an internal private procedure which must be called from the upd
183 -- procedure.
184 --
185 -- In Parameters:
186 -- A Pl/Sql record structre.
187 --
188 -- Post Success:
189 -- Processing contines.
190 --
191 -- Post Failure:
192 -- No specific error handling is required within this procedure.
193 --
194 -- Developer Implementation Notes:
195 -- The update 'set' arguments list should be modified if any of your
196 -- attributes are not updateable.
197 --
198 -- Access Status:
199 -- Internal Row Handler Use Only.
200 --
201 -- {End Of Comments}
202 -- ----------------------------------------------------------------------------
203 Procedure update_dml
204 (p_rec in out nocopy ben_ecv_shd.g_rec_type,
205 p_effective_date in date,
206 p_datetrack_mode in varchar2,
207 p_validation_start_date in date,
208 p_validation_end_date in date) is
209 --
210 l_proc varchar2(72) := g_package||'update_dml';
211 --
212 Begin
213 hr_utility.set_location('Entering:'||l_proc, 5);
214 --
215 dt_update_dml(p_rec => p_rec,
216 p_effective_date => p_effective_date,
217 p_datetrack_mode => p_datetrack_mode,
218 p_validation_start_date => p_validation_start_date,
219 p_validation_end_date => p_validation_end_date);
220 --
221 hr_utility.set_location(' Leaving:'||l_proc, 10);
222 End update_dml;
223 --
224 -- ----------------------------------------------------------------------------
225 -- |----------------------------< dt_pre_update >-----------------------------|
226 -- ----------------------------------------------------------------------------
227 -- {Start Of Comments}
228 --
229 -- Description:
230 -- The dt_pre_update procedure controls the execution
231 -- of dml for the datetrack modes of: UPDATE, UPDATE_OVERRIDE
232 -- and UPDATE_CHANGE_INSERT only. The execution required is as
233 -- follows:
234 --
235 -- 1) Providing the datetrack update mode is not 'CORRECTION'
236 -- then set the effective end date of the current row (this
237 -- will be the validation_start_date - 1).
238 -- 2) If the datetrack mode is 'UPDATE_OVERRIDE' then call the
239 -- corresponding delete_dml process to delete any future rows
240 -- where the effective_start_date is greater than or equal to
241 -- the validation_start_date.
242 -- 3) Call the insert_dml process to insert the new updated row
243 -- details..
244 --
245 -- Prerequisites:
246 -- This is an internal procedure which is called from the
247 -- pre_update procedure.
248 --
249 -- In Parameters:
250 --
251 -- Post Success:
252 -- Processing continues.
253 --
254 -- Post Failure:
255 -- If an error has occurred, an error message and exception will be raised
256 -- but not handled.
257 --
258 -- Developer Implementation Notes:
259 -- This is an internal procedure which is required by Datetrack. Don't
260 -- remove or modify.
261 --
262 -- Access Status:
263 -- Internal Row Handler Use Only.
264 --
265 -- {End Of Comments}
266 -- ----------------------------------------------------------------------------
267 Procedure dt_pre_update
268 (p_rec in out nocopy ben_ecv_shd.g_rec_type,
269 p_effective_date in date,
270 p_datetrack_mode in varchar2,
271 p_validation_start_date in date,
272 p_validation_end_date in date) is
273 --
274 l_proc varchar2(72) := g_package||'dt_pre_update';
275 l_dummy_version_number number;
276 --
277 Begin
278 hr_utility.set_location('Entering:'||l_proc, 5);
279 If (p_datetrack_mode <> 'CORRECTION') then
280 hr_utility.set_location(l_proc, 10);
281 --
282 -- Update the current effective end date
283 --
284 ben_ecv_shd.upd_effective_end_date
285 (p_effective_date => p_effective_date,
286 p_base_key_value => p_rec.eligy_crit_values_id,
287 p_new_effective_end_date => (p_validation_start_date - 1),
288 p_validation_start_date => p_validation_start_date,
289 p_validation_end_date => p_validation_end_date,
290 p_object_version_number => l_dummy_version_number);
291 --
292 If (p_datetrack_mode = 'UPDATE_OVERRIDE') then
293 hr_utility.set_location(l_proc, 15);
294 --
295 -- As the datetrack mode is 'UPDATE_OVERRIDE' then we must
296 -- delete any future rows
297 --
298 ben_ecv_del.delete_dml
299 (p_rec => p_rec,
300 p_effective_date => p_effective_date,
301 p_datetrack_mode => p_datetrack_mode,
302 p_validation_start_date => p_validation_start_date,
303 p_validation_end_date => p_validation_end_date);
304 End If;
305 hr_utility.set_location(l_proc, 20);
306 --
307 -- We must now insert the updated row
308 --
309 ben_ecv_ins.insert_dml
310 (p_rec => p_rec,
311 p_effective_date => p_effective_date,
312 p_datetrack_mode => p_datetrack_mode,
313 p_validation_start_date => p_validation_start_date,
314 p_validation_end_date => p_validation_end_date);
315 End If;
316 hr_utility.set_location(' Leaving:'||l_proc, 20);
317 End dt_pre_update;
318 --
319 -- ----------------------------------------------------------------------------
320 -- |------------------------------< pre_update >------------------------------|
321 -- ----------------------------------------------------------------------------
322 -- {Start Of Comments}
323 --
324 -- Description:
325 -- This private procedure contains any processing which is required before
326 -- the update dml.
327 --
328 -- Prerequisites:
329 -- This is an internal procedure which is called from the upd procedure.
330 --
331 -- In Parameters:
332 -- A Pl/Sql record structre.
333 --
334 -- Post Success:
335 -- Processing continues.
336 --
337 -- Post Failure:
338 -- If an error has occurred, an error message and exception will be raised
339 -- but not handled.
340 --
341 -- Developer Implementation Notes:
342 -- Any pre-processing required before the update dml is issued should be
343 -- coded within this procedure. It is important to note that any 3rd party
344 -- maintenance should be reviewed before placing in this procedure. The call
345 -- to the dt_update_dml procedure should NOT be removed.
346 --
347 -- Access Status:
348 -- Internal Row Handler Use Only.
349 --
350 -- {End Of Comments}
351 -- ----------------------------------------------------------------------------
352 Procedure pre_update
353 (p_rec in out nocopy ben_ecv_shd.g_rec_type,
354 p_effective_date in date,
355 p_datetrack_mode in varchar2,
356 p_validation_start_date in date,
357 p_validation_end_date in date) is
358 --
359 l_proc varchar2(72) := g_package||'pre_update';
360 --
361 Begin
362 hr_utility.set_location('Entering :'||l_proc, 5);
363 --
364 --
365 --
366 dt_pre_update
367 (p_rec => p_rec,
368 p_effective_date => p_effective_date,
369 p_datetrack_mode => p_datetrack_mode,
370 p_validation_start_date => p_validation_start_date,
371 p_validation_end_date => p_validation_end_date);
372 --
373 hr_utility.set_location(' Leaving:'||l_proc, 10);
374 End pre_update;
375 --
376 -- ----------------------------------------------------------------------------
377 -- |-----------------------------< post_update >------------------------------|
378 -- ----------------------------------------------------------------------------
379 -- {Start Of Comments}
380 --
381 -- Description:
382 -- This private procedure contains any processing which is required after the
383 -- update dml.
384 --
385 -- Prerequisites:
386 -- This is an internal procedure which is called from the upd procedure.
387 --
388 -- In Parameters:
389 -- A Pl/Sql record structre.
390 --
391 -- Post Success:
392 -- Processing continues.
393 --
394 -- Post Failure:
395 -- If an error has occurred, an error message and exception will be raised
396 -- but not handled.
397 --
398 -- Developer Implementation Notes:
399 -- Any post-processing required after the update dml is issued should be
400 -- coded within this procedure. It is important to note that any 3rd party
401 -- maintenance should be reviewed before placing in this procedure.
402 --
403 -- Access Status:
404 -- Internal Row Handler Use Only.
405 --
406 -- {End Of Comments}
407 -- ----------------------------------------------------------------------------
408 Procedure post_update
409 (p_rec in ben_ecv_shd.g_rec_type,
410 p_effective_date in date,
411 p_datetrack_mode in varchar2,
412 p_validation_start_date in date,
413 p_validation_end_date in date) is
414 --
415 l_proc varchar2(72) := g_package||'post_update';
416 --
417 Begin
418 hr_utility.set_location('Entering:'||l_proc, 5);
419 --
420 --
421 -- Start of API User Hook for post_update.
422 --
423 begin
424 --
425 ben_ecv_rku.after_update
426 (
427 p_eligy_crit_values_id =>p_rec.eligy_crit_values_id
428 ,p_eligy_prfl_id =>p_rec.eligy_prfl_id
429 ,p_eligy_criteria_id =>p_rec.eligy_criteria_id
430 ,p_effective_start_date =>p_rec.effective_start_date
431 ,p_effective_end_date =>p_rec.effective_end_date
432 ,p_ordr_num =>p_rec.ordr_num
433 ,p_number_value1 =>p_rec.number_value1
434 ,p_number_value2 =>p_rec.number_value2
435 ,p_char_value1 =>p_rec.char_value1
436 ,p_char_value2 =>p_rec.char_value2
437 ,p_date_value1 =>p_rec.date_value1
438 ,p_date_value2 =>p_rec.date_value2
439 ,p_excld_flag =>p_rec.excld_flag
440 ,p_business_group_id =>p_rec.business_group_id
441 ,p_legislation_code =>p_rec.legislation_code
442 ,p_ecv_attribute_category =>p_rec.ecv_attribute_category
443 ,p_ecv_attribute1 =>p_rec.ecv_attribute1
444 ,p_ecv_attribute2 =>p_rec.ecv_attribute2
445 ,p_ecv_attribute3 =>p_rec.ecv_attribute3
446 ,p_ecv_attribute4 =>p_rec.ecv_attribute4
447 ,p_ecv_attribute5 =>p_rec.ecv_attribute5
448 ,p_ecv_attribute6 =>p_rec.ecv_attribute6
449 ,p_ecv_attribute7 =>p_rec.ecv_attribute7
450 ,p_ecv_attribute8 =>p_rec.ecv_attribute8
451 ,p_ecv_attribute9 =>p_rec.ecv_attribute9
452 ,p_ecv_attribute10 =>p_rec.ecv_attribute10
453 ,p_ecv_attribute11 =>p_rec.ecv_attribute11
454 ,p_ecv_attribute12 =>p_rec.ecv_attribute12
455 ,p_ecv_attribute13 =>p_rec.ecv_attribute13
456 ,p_ecv_attribute14 =>p_rec.ecv_attribute14
457 ,p_ecv_attribute15 =>p_rec.ecv_attribute15
458 ,p_ecv_attribute16 =>p_rec.ecv_attribute16
459 ,p_ecv_attribute17 =>p_rec.ecv_attribute17
460 ,p_ecv_attribute18 =>p_rec.ecv_attribute18
461 ,p_ecv_attribute19 =>p_rec.ecv_attribute19
462 ,p_ecv_attribute20 =>p_rec.ecv_attribute20
463 ,p_ecv_attribute21 =>p_rec.ecv_attribute21
464 ,p_ecv_attribute22 =>p_rec.ecv_attribute22
465 ,p_ecv_attribute23 =>p_rec.ecv_attribute23
466 ,p_ecv_attribute24 =>p_rec.ecv_attribute24
467 ,p_ecv_attribute25 =>p_rec.ecv_attribute25
468 ,p_ecv_attribute26 =>p_rec.ecv_attribute26
469 ,p_ecv_attribute27 =>p_rec.ecv_attribute27
470 ,p_ecv_attribute28 =>p_rec.ecv_attribute28
471 ,p_ecv_attribute29 =>p_rec.ecv_attribute29
472 ,p_ecv_attribute30 =>p_rec.ecv_attribute30
473 ,p_object_version_number =>p_rec.object_version_number
474 ,p_effective_date =>p_effective_date
475 ,p_datetrack_mode =>p_datetrack_mode
476 ,p_validation_start_date =>p_validation_start_date
477 ,p_criteria_score =>p_rec.criteria_score
478 ,p_criteria_weight =>p_rec.criteria_weight
479 ,p_validation_end_date =>p_validation_end_date
480 ,p_char_value3 =>p_rec.char_value3
481 ,p_char_value4 =>p_rec.char_value4
482 ,p_number_value3 =>p_rec.number_value3
483 ,p_number_value4 =>p_rec.number_value4
484 ,p_date_value3 =>p_rec.date_value3
485 ,p_date_value4 =>p_rec.date_value4
486 ,p_eligy_prfl_id_o =>ben_ecv_shd.g_old_rec.eligy_prfl_id
487 ,p_eligy_criteria_id_o =>ben_ecv_shd.g_old_rec.eligy_criteria_id
488 ,p_effective_start_date_o =>ben_ecv_shd.g_old_rec.effective_start_date
489 ,p_effective_end_date_o =>ben_ecv_shd.g_old_rec.effective_end_date
490 ,p_ordr_num_o =>ben_ecv_shd.g_old_rec.ordr_num
491 ,p_number_value1_o =>ben_ecv_shd.g_old_rec.number_value1
492 ,p_number_value2_o =>ben_ecv_shd.g_old_rec.number_value2
493 ,p_char_value1_o =>ben_ecv_shd.g_old_rec.char_value1
494 ,p_char_value2_o =>ben_ecv_shd.g_old_rec.char_value2
495 ,p_date_value1_o =>ben_ecv_shd.g_old_rec.date_value1
496 ,p_date_value2_o =>ben_ecv_shd.g_old_rec.date_value2
497 ,p_excld_flag_o =>ben_ecv_shd.g_old_rec.excld_flag
498 ,p_business_group_id_o =>ben_ecv_shd.g_old_rec.business_group_id
499 ,p_legislation_code_o =>ben_ecv_shd.g_old_rec.legislation_code
500 ,p_ecv_attribute_category_o =>ben_ecv_shd.g_old_rec.ecv_attribute_category
501 ,p_ecv_attribute1_o =>ben_ecv_shd.g_old_rec.ecv_attribute1
502 ,p_ecv_attribute2_o =>ben_ecv_shd.g_old_rec.ecv_attribute2
503 ,p_ecv_attribute3_o =>ben_ecv_shd.g_old_rec.ecv_attribute3
504 ,p_ecv_attribute4_o =>ben_ecv_shd.g_old_rec.ecv_attribute4
505 ,p_ecv_attribute5_o =>ben_ecv_shd.g_old_rec.ecv_attribute5
506 ,p_ecv_attribute6_o =>ben_ecv_shd.g_old_rec.ecv_attribute6
507 ,p_ecv_attribute7_o =>ben_ecv_shd.g_old_rec.ecv_attribute7
508 ,p_ecv_attribute8_o =>ben_ecv_shd.g_old_rec.ecv_attribute8
509 ,p_ecv_attribute9_o =>ben_ecv_shd.g_old_rec.ecv_attribute9
510 ,p_ecv_attribute10_o =>ben_ecv_shd.g_old_rec.ecv_attribute10
511 ,p_ecv_attribute11_o =>ben_ecv_shd.g_old_rec.ecv_attribute11
512 ,p_ecv_attribute12_o =>ben_ecv_shd.g_old_rec.ecv_attribute12
513 ,p_ecv_attribute13_o =>ben_ecv_shd.g_old_rec.ecv_attribute13
514 ,p_ecv_attribute14_o =>ben_ecv_shd.g_old_rec.ecv_attribute14
515 ,p_ecv_attribute15_o =>ben_ecv_shd.g_old_rec.ecv_attribute15
516 ,p_ecv_attribute16_o =>ben_ecv_shd.g_old_rec.ecv_attribute16
517 ,p_ecv_attribute17_o =>ben_ecv_shd.g_old_rec.ecv_attribute17
518 ,p_ecv_attribute18_o =>ben_ecv_shd.g_old_rec.ecv_attribute18
519 ,p_ecv_attribute19_o =>ben_ecv_shd.g_old_rec.ecv_attribute19
520 ,p_ecv_attribute20_o =>ben_ecv_shd.g_old_rec.ecv_attribute20
521 ,p_ecv_attribute21_o =>ben_ecv_shd.g_old_rec.ecv_attribute21
522 ,p_ecv_attribute22_o =>ben_ecv_shd.g_old_rec.ecv_attribute22
523 ,p_ecv_attribute23_o =>ben_ecv_shd.g_old_rec.ecv_attribute23
524 ,p_ecv_attribute24_o =>ben_ecv_shd.g_old_rec.ecv_attribute24
525 ,p_ecv_attribute25_o =>ben_ecv_shd.g_old_rec.ecv_attribute25
526 ,p_ecv_attribute26_o =>ben_ecv_shd.g_old_rec.ecv_attribute26
527 ,p_ecv_attribute27_o =>ben_ecv_shd.g_old_rec.ecv_attribute27
528 ,p_ecv_attribute28_o =>ben_ecv_shd.g_old_rec.ecv_attribute28
529 ,p_ecv_attribute29_o =>ben_ecv_shd.g_old_rec.ecv_attribute29
530 ,p_ecv_attribute30_o =>ben_ecv_shd.g_old_rec.ecv_attribute30
531 ,p_object_version_number_o =>ben_ecv_shd.g_old_rec.object_version_number
532 ,p_criteria_score_o =>ben_ecv_shd.g_old_rec.criteria_score
533 ,p_criteria_weight_o =>ben_ecv_shd.g_old_rec.criteria_weight
534 ,p_char_value3_o =>ben_ecv_shd.g_old_rec.char_value3
535 ,p_char_value4_o =>ben_ecv_shd.g_old_rec.char_value4
536 ,p_number_value3_o =>ben_ecv_shd.g_old_rec.number_value3
537 ,p_number_value4_o =>ben_ecv_shd.g_old_rec.number_value4
538 ,p_date_value3_o =>ben_ecv_shd.g_old_rec.date_value3
539 ,p_date_value4_o =>ben_ecv_shd.g_old_rec.date_value4
540 );
541 --
542 exception
543 --
544 when hr_api.cannot_find_prog_unit then
545 --
546 hr_api.cannot_find_prog_unit_error
547 (p_module_name => 'ben_eligy_crit_values_f'
548 ,p_hook_type => 'AU'
549 );
550 --
551 end;
552 --
553 -- End of API User Hook for post_update.
554 --
555 --
556 hr_utility.set_location(' Leaving:'||l_proc, 10);
557 End post_update;
558 --
559 -- ----------------------------------------------------------------------------
560 -- |-----------------------------< convert_defs >-----------------------------|
561 -- ----------------------------------------------------------------------------
562 -- {Start Of Comments}
563 --
564 -- Description:
565 -- The Convert_Defs procedure has one very important function:
566 -- It must return the record structure for the row with all system defaulted
567 -- values converted into its corresponding parameter value for update. When
568 -- we attempt to update a row through the Upd process , certain
569 -- parameters can be defaulted which enables flexibility in the calling of
570 -- the upd process (e.g. only attributes which need to be updated need to be
571 -- specified). For the upd process to determine which attributes
572 -- have NOT been specified we need to check if the parameter has a reserved
573 -- system default value. Therefore, for all parameters which have a
574 -- corresponding reserved system default mechanism specified we need to
575 -- check if a system default is being used. If a system default is being
576 -- used then we convert the defaulted value into its corresponding attribute
577 -- value held in the g_old_rec data structure.
578 --
579 -- Prerequisites:
580 -- This private function can only be called from the upd process.
581 --
582 -- In Parameters:
583 -- A Pl/Sql record structre.
584 --
585 -- Post Success:
586 -- The record structure will be returned with all system defaulted parameter
587 -- values converted into its current row attribute value.
588 --
589 -- Post Failure:
590 -- No direct error handling is required within this function. Any possible
591 -- errors within this procedure will be a PL/SQL value error due to conversion
592 -- of datatypes or data lengths.
593 --
594 -- Developer Implementation Notes:
595 -- None.
596 --
597 -- Access Status:
598 -- Internal Row Handler Use Only.
599 --
600 -- {End Of Comments}
601 -- ----------------------------------------------------------------------------
602 Procedure convert_defs(p_rec in out nocopy ben_ecv_shd.g_rec_type) is
603 --
604 l_proc varchar2(72) := g_package||'convert_defs';
605 --
606 Begin
607 --
608 hr_utility.set_location('Entering:'||l_proc, 5);
609 --
610 -- We must now examine each argument value in the
611 -- p_rec plsql record structure
612 -- to see if a system default is being used. If a system default
613 -- is being used then we must set to the 'current' argument value.
614 --
615 If (p_rec.eligy_prfl_id = hr_api.g_number) then
616 p_rec.eligy_prfl_id := ben_ecv_shd.g_old_rec.eligy_prfl_id;
617 end if;
618 If (p_rec.eligy_criteria_id = hr_api.g_number) then
619 p_rec.eligy_criteria_id := ben_ecv_shd.g_old_rec.eligy_criteria_id;
620 end if;
621 If (p_rec.number_value1 = hr_api.g_number) then
622 p_rec.number_value1 := ben_ecv_shd.g_old_rec.number_value1;
623 end if;
624 If (p_rec.number_value2 = hr_api.g_number) then
625 p_rec.number_value2 := ben_ecv_shd.g_old_rec.number_value2;
626 end if;
627 If (p_rec.char_value1 = hr_api.g_varchar2) then
628 p_rec.char_value1 := ben_ecv_shd.g_old_rec.char_value1;
629 end if;
630 If (p_rec.char_value2 = hr_api.g_varchar2) then
631 p_rec.char_value2 := ben_ecv_shd.g_old_rec.char_value2;
632 end if;
633 If (p_rec.date_value1 = hr_api.g_date) then
634 p_rec.date_value1 := ben_ecv_shd.g_old_rec.date_value1;
635 end if;
636 If (p_rec.date_value2 = hr_api.g_date) then
637 p_rec.date_value2 := ben_ecv_shd.g_old_rec.date_value2;
638 end if;
639 If (p_rec.excld_flag = hr_api.g_varchar2) then
640 p_rec.excld_flag := ben_ecv_shd.g_old_rec.excld_flag;
641 end if;
642 If (p_rec.business_group_id = hr_api.g_number) then
643 p_rec.business_group_id := ben_ecv_shd.g_old_rec.business_group_id;
644 end if;
645 If (p_rec.legislation_code = hr_api.g_varchar2) then
646 p_rec.legislation_code := ben_ecv_shd.g_old_rec.legislation_code;
647 end if;
648 If (p_rec.ecv_attribute_category = hr_api.g_varchar2) then
649 p_rec.ecv_attribute_category := ben_ecv_shd.g_old_rec.ecv_attribute_category;
650 end if;
651 If (p_rec.ecv_attribute1 = hr_api.g_varchar2) then
652 p_rec.ecv_attribute1 := ben_ecv_shd.g_old_rec.ecv_attribute1;
653 end if;
654 If (p_rec.ecv_attribute2 = hr_api.g_varchar2) then
655 p_rec.ecv_attribute2 := ben_ecv_shd.g_old_rec.ecv_attribute2;
656 end if;
657 If (p_rec.ecv_attribute3 = hr_api.g_varchar2) then
658 p_rec.ecv_attribute3 := ben_ecv_shd.g_old_rec.ecv_attribute3;
659 end if;
660 If (p_rec.ecv_attribute4 = hr_api.g_varchar2) then
661 p_rec.ecv_attribute4 := ben_ecv_shd.g_old_rec.ecv_attribute4;
662 end if;
663 If (p_rec.ecv_attribute5 = hr_api.g_varchar2) then
664 p_rec.ecv_attribute5 := ben_ecv_shd.g_old_rec.ecv_attribute5;
665 end if;
666 If (p_rec.ecv_attribute6 = hr_api.g_varchar2) then
667 p_rec.ecv_attribute6 := ben_ecv_shd.g_old_rec.ecv_attribute6;
668 end if;
669 If (p_rec.ecv_attribute7 = hr_api.g_varchar2) then
670 p_rec.ecv_attribute7 := ben_ecv_shd.g_old_rec.ecv_attribute7;
671 end if;
672 If (p_rec.ecv_attribute8 = hr_api.g_varchar2) then
673 p_rec.ecv_attribute8 := ben_ecv_shd.g_old_rec.ecv_attribute8;
674 end if;
675 If (p_rec.ecv_attribute9 = hr_api.g_varchar2) then
676 p_rec.ecv_attribute9 := ben_ecv_shd.g_old_rec.ecv_attribute9;
677 end if;
678 If (p_rec.ecv_attribute10 = hr_api.g_varchar2) then
679 p_rec.ecv_attribute10 := ben_ecv_shd.g_old_rec.ecv_attribute10;
680 end if;
681 If (p_rec.ecv_attribute11 = hr_api.g_varchar2) then
682 p_rec.ecv_attribute11 := ben_ecv_shd.g_old_rec.ecv_attribute11;
683 end if;
684 If (p_rec.ecv_attribute12 = hr_api.g_varchar2) then
685 p_rec.ecv_attribute12 := ben_ecv_shd.g_old_rec.ecv_attribute12;
686 end if;
687 If (p_rec.ecv_attribute13 = hr_api.g_varchar2) then
688 p_rec.ecv_attribute13 := ben_ecv_shd.g_old_rec.ecv_attribute13;
689 end if;
690 If (p_rec.ecv_attribute14 = hr_api.g_varchar2) then
691 p_rec.ecv_attribute14 := ben_ecv_shd.g_old_rec.ecv_attribute14;
692 end if;
693 If (p_rec.ecv_attribute15 = hr_api.g_varchar2) then
694 p_rec.ecv_attribute15 := ben_ecv_shd.g_old_rec.ecv_attribute15;
695 end if;
696 If (p_rec.ecv_attribute16 = hr_api.g_varchar2) then
697 p_rec.ecv_attribute16 := ben_ecv_shd.g_old_rec.ecv_attribute16;
698 end if;
699 If (p_rec.ecv_attribute17 = hr_api.g_varchar2) then
700 p_rec.ecv_attribute17 := ben_ecv_shd.g_old_rec.ecv_attribute17;
701 end if;
702 If (p_rec.ecv_attribute18 = hr_api.g_varchar2) then
703 p_rec.ecv_attribute18 := ben_ecv_shd.g_old_rec.ecv_attribute18;
704 end if;
705 If (p_rec.ecv_attribute19 = hr_api.g_varchar2) then
706 p_rec.ecv_attribute19 := ben_ecv_shd.g_old_rec.ecv_attribute19;
707 end if;
708 If (p_rec.ecv_attribute20 = hr_api.g_varchar2) then
709 p_rec.ecv_attribute20 := ben_ecv_shd.g_old_rec.ecv_attribute20;
710 end if;
711 If (p_rec.ecv_attribute21 = hr_api.g_varchar2) then
712 p_rec.ecv_attribute21 := ben_ecv_shd.g_old_rec.ecv_attribute21;
713 end if;
714 If (p_rec.ecv_attribute22 = hr_api.g_varchar2) then
715 p_rec.ecv_attribute22 := ben_ecv_shd.g_old_rec.ecv_attribute22;
716 end if;
717 If (p_rec.ecv_attribute23 = hr_api.g_varchar2) then
718 p_rec.ecv_attribute23 := ben_ecv_shd.g_old_rec.ecv_attribute23;
719 end if;
720 If (p_rec.ecv_attribute24 = hr_api.g_varchar2) then
721 p_rec.ecv_attribute24 := ben_ecv_shd.g_old_rec.ecv_attribute24;
722 end if;
723 If (p_rec.ecv_attribute25 = hr_api.g_varchar2) then
724 p_rec.ecv_attribute25 := ben_ecv_shd.g_old_rec.ecv_attribute25;
725 end if;
726 If (p_rec.ecv_attribute26 = hr_api.g_varchar2) then
727 p_rec.ecv_attribute26 := ben_ecv_shd.g_old_rec.ecv_attribute26;
728 end if;
729 If (p_rec.ecv_attribute27 = hr_api.g_varchar2) then
730 p_rec.ecv_attribute27 := ben_ecv_shd.g_old_rec.ecv_attribute27;
731 end if;
732 If (p_rec.ecv_attribute28 = hr_api.g_varchar2) then
733 p_rec.ecv_attribute28 := ben_ecv_shd.g_old_rec.ecv_attribute28;
734 end if;
735 If (p_rec.ecv_attribute29 = hr_api.g_varchar2) then
736 p_rec.ecv_attribute29 := ben_ecv_shd.g_old_rec.ecv_attribute29;
737 end if;
738 If (p_rec.ecv_attribute30 = hr_api.g_varchar2) then
739 p_rec.ecv_attribute30 := ben_ecv_shd.g_old_rec.ecv_attribute30;
740 end if;
741 If (p_rec.criteria_score = hr_api.g_number) then
742 p_rec.criteria_score := ben_ecv_shd.g_old_rec.criteria_score;
743 end if;
744 If (p_rec.criteria_weight = hr_api.g_number) then
745 p_rec.criteria_weight := ben_ecv_shd.g_old_rec.criteria_weight;
746 end if;
747 If (p_rec.Char_value3 = hr_api.g_varchar2) then
748 p_rec.Char_value3 := ben_ecv_shd.g_old_rec.Char_value3;
749 end if;
750 If (p_rec.Char_value4 = hr_api.g_varchar2) then
751 p_rec.Char_value4 := ben_ecv_shd.g_old_rec.Char_value4;
752 end if;
753 If (p_rec.Number_value3 = hr_api.g_number) then
754 p_rec.Number_value3 := ben_ecv_shd.g_old_rec.Number_value3;
755 end if;
756 If (p_rec.Number_value4 = hr_api.g_number) then
757 p_rec.Number_value4 := ben_ecv_shd.g_old_rec.Number_value4;
758 end if;
759 If (p_rec.Date_value3 = hr_api.g_date) then
760 p_rec.Date_value3 := ben_ecv_shd.g_old_rec.Date_value3;
761 end if;
762 If (p_rec.Date_value4 = hr_api.g_date) then
763 p_rec.Date_value4 := ben_ecv_shd.g_old_rec.Date_value4;
764 end if;
765
766 --
767 hr_utility.set_location(' Leaving:'||l_proc, 10);
768 --
769 end convert_defs;
770 --
771 -- ----------------------------------------------------------------------------
772 -- |---------------------------------< upd >----------------------------------|
773 -- ----------------------------------------------------------------------------
774 Procedure upd
775 (
776 p_rec in out nocopy ben_ecv_shd.g_rec_type,
777 p_effective_date in date,
778 p_datetrack_mode in varchar2
779 ) is
780 --
781 l_proc varchar2(72) := g_package||'upd';
782 l_validation_start_date date;
783 l_validation_end_date date;
784 --
785 begin
786 hr_utility.set_location('Entering:'||l_proc, 5);
787 --
788 -- Ensure that the DateTrack update mode is valid
789 --
790 dt_api.validate_dt_upd_mode(p_datetrack_mode => p_datetrack_mode);
791 --
792 -- We must lock the row which we need to update.
793 --
794 ben_ecv_shd.lck
795 (p_effective_date => p_effective_date,
796 p_datetrack_mode => p_datetrack_mode,
797 p_eligy_crit_values_id => p_rec.eligy_crit_values_id,
798 p_object_version_number => p_rec.object_version_number,
799 p_validation_start_date => l_validation_start_date,
800 p_validation_end_date => l_validation_end_date);
801 --
802 -- 1. During an update system defaults are used to determine if
803 -- arguments have been defaulted or not. We must therefore
804 -- derive the full record structure values to be updated.
805 --
806 -- 2. Call the supporting update validate operations.
807 --
808 convert_defs(p_rec);
809 ben_ecv_bus.update_validate
810 (p_rec => p_rec,
811 p_effective_date => p_effective_date,
812 p_datetrack_mode => p_datetrack_mode,
813 p_validation_start_date => l_validation_start_date,
814 p_validation_end_date => l_validation_end_date);
815 --
816 -- Call the supporting pre-update operation
817 --
818 pre_update
819 (p_rec => p_rec,
820 p_effective_date => p_effective_date,
821 p_datetrack_mode => p_datetrack_mode,
822 p_validation_start_date => l_validation_start_date,
823 p_validation_end_date => l_validation_end_date);
824 --
825 -- Update the row.
826 --
827 update_dml
828 (p_rec => p_rec,
829 p_effective_date => p_effective_date,
830 p_datetrack_mode => p_datetrack_mode,
831 p_validation_start_date => l_validation_start_date,
832 p_validation_end_date => l_validation_end_date);
833 --
834 -- Call the supporting post-update operation
835 --
836 post_update
837 (p_rec => p_rec,
838 p_effective_date => p_effective_date,
839 p_datetrack_mode => p_datetrack_mode,
840 p_validation_start_date => l_validation_start_date,
841 p_validation_end_date => l_validation_end_date);
842 end upd;
843 --
844 -- ----------------------------------------------------------------------------
845 -- |---------------------------------< upd >----------------------------------|
846 -- ----------------------------------------------------------------------------
847 Procedure upd
848 (
849 p_eligy_crit_values_id In Number
850 ,p_eligy_prfl_id In Number default hr_api.g_number
851 ,p_eligy_criteria_id In Number default hr_api.g_number
852 ,p_effective_start_date Out nocopy Date
853 ,p_effective_end_date Out nocopy Date
854 ,p_ordr_num In Number default hr_api.g_number
855 ,p_number_value1 In Number default hr_api.g_number
856 ,p_number_value2 In Number default hr_api.g_number
857 ,p_char_value1 In Varchar2 default hr_api.g_varchar2
858 ,p_char_value2 In Varchar2 default hr_api.g_varchar2
859 ,p_date_value1 In Date default hr_api.g_date
860 ,p_date_value2 In Date default hr_api.g_date
861 ,p_excld_flag In Varchar2 default hr_api.g_Varchar2
862 ,p_business_group_id In Number default hr_api.g_number
863 ,p_legislation_code In Varchar2 default hr_api.g_varchar2
864 ,p_ecv_attribute_category In Varchar2 default hr_api.g_varchar2
865 ,p_ecv_attribute1 In Varchar2 default hr_api.g_varchar2
866 ,p_ecv_attribute2 In Varchar2 default hr_api.g_varchar2
867 ,p_ecv_attribute3 In Varchar2 default hr_api.g_varchar2
868 ,p_ecv_attribute4 In Varchar2 default hr_api.g_varchar2
869 ,p_ecv_attribute5 In Varchar2 default hr_api.g_varchar2
870 ,p_ecv_attribute6 In Varchar2 default hr_api.g_varchar2
871 ,p_ecv_attribute7 In Varchar2 default hr_api.g_varchar2
872 ,p_ecv_attribute8 In Varchar2 default hr_api.g_varchar2
873 ,p_ecv_attribute9 In Varchar2 default hr_api.g_varchar2
874 ,p_ecv_attribute10 In Varchar2 default hr_api.g_varchar2
875 ,p_ecv_attribute11 In Varchar2 default hr_api.g_varchar2
876 ,p_ecv_attribute12 In Varchar2 default hr_api.g_varchar2
877 ,p_ecv_attribute13 In Varchar2 default hr_api.g_varchar2
878 ,p_ecv_attribute14 In Varchar2 default hr_api.g_varchar2
879 ,p_ecv_attribute15 In Varchar2 default hr_api.g_varchar2
880 ,p_ecv_attribute16 In Varchar2 default hr_api.g_varchar2
881 ,p_ecv_attribute17 In Varchar2 default hr_api.g_varchar2
882 ,p_ecv_attribute18 In Varchar2 default hr_api.g_varchar2
883 ,p_ecv_attribute19 In Varchar2 default hr_api.g_varchar2
884 ,p_ecv_attribute20 In Varchar2 default hr_api.g_varchar2
885 ,p_ecv_attribute21 In Varchar2 default hr_api.g_varchar2
886 ,p_ecv_attribute22 In Varchar2 default hr_api.g_varchar2
887 ,p_ecv_attribute23 In Varchar2 default hr_api.g_varchar2
888 ,p_ecv_attribute24 In Varchar2 default hr_api.g_varchar2
889 ,p_ecv_attribute25 In Varchar2 default hr_api.g_varchar2
890 ,p_ecv_attribute26 In Varchar2 default hr_api.g_varchar2
891 ,p_ecv_attribute27 In Varchar2 default hr_api.g_varchar2
892 ,p_ecv_attribute28 In Varchar2 default hr_api.g_varchar2
893 ,p_ecv_attribute29 In Varchar2 default hr_api.g_varchar2
894 ,p_ecv_attribute30 In Varchar2 default hr_api.g_varchar2
895 ,p_object_version_number In Out nocopy Number
896 ,p_effective_date In Date
897 ,p_datetrack_mode In varchar2
898 ,p_criteria_score In Number default hr_api.g_number
899 ,p_criteria_weight In Number default hr_api.g_number
900 ,p_Char_value3 In Varchar2 default hr_api.g_varchar2
901 ,p_Char_value4 In Varchar2 default hr_api.g_varchar2
902 ,p_Number_value3 In Number default hr_api.g_number
903 ,p_Number_value4 In Number default hr_api.g_number
904 ,p_Date_value3 In Date default hr_api.g_date
905 ,p_Date_value4 In Date default hr_api.g_date
906 ) is
907 --
908 l_rec ben_ecv_shd.g_rec_type;
909 l_proc varchar2(72) := g_package||'upd';
910 --
911 Begin
912 hr_utility.set_location('Entering:'||l_proc, 5);
913 --
914 -- Call conversion function to turn arguments into the
915 -- l_rec structure.
916 --
917 l_rec :=
918 ben_ecv_shd.convert_args
919 (
920 p_eligy_crit_values_id,
921 p_eligy_prfl_id,
922 p_eligy_criteria_id,
923 NULL,
924 NULL,
925 p_ordr_num,
926 p_number_value1,
927 p_number_value2,
928 p_char_value1,
929 p_char_value2,
930 p_date_value1,
931 p_date_value2,
932 p_excld_flag,
933 p_business_group_id,
934 p_legislation_code,
935 p_ecv_attribute_category,
936 p_ecv_attribute1,
937 p_ecv_attribute2,
938 p_ecv_attribute3,
939 p_ecv_attribute4,
940 p_ecv_attribute5,
941 p_ecv_attribute6,
942 p_ecv_attribute7,
943 p_ecv_attribute8,
944 p_ecv_attribute9,
945 p_ecv_attribute10,
946 p_ecv_attribute11,
947 p_ecv_attribute12,
948 p_ecv_attribute13,
949 p_ecv_attribute14,
950 p_ecv_attribute15,
951 p_ecv_attribute16,
952 p_ecv_attribute17,
953 p_ecv_attribute18,
954 p_ecv_attribute19,
955 p_ecv_attribute20,
956 p_ecv_attribute21,
957 p_ecv_attribute22,
958 p_ecv_attribute23,
959 p_ecv_attribute24,
960 p_ecv_attribute25,
961 p_ecv_attribute26,
962 p_ecv_attribute27,
963 p_ecv_attribute28,
964 p_ecv_attribute29,
965 p_ecv_attribute30,
966 p_object_version_number,
967 p_criteria_score,
968 p_criteria_weight,
969 p_Char_value3,
970 p_Char_value4,
971 p_Number_value3,
972 p_Number_value4,
973 p_Date_value3,
974 p_Date_value4
975 );
976 --
977 -- Having converted the arguments into the
978 -- plsql record structure we call the corresponding record
979 -- business process.
980 --
981 upd(l_rec, p_effective_date, p_datetrack_mode);
982 p_object_version_number := l_rec.object_version_number;
983 p_effective_start_date := l_rec.effective_start_date;
984 p_effective_end_date := l_rec.effective_end_date;
985 --
986 --
987 hr_utility.set_location(' Leaving:'||l_proc, 10);
988 end upd;
989 --
990 end ben_ecv_upd;