1 Package Body ben_ept_upd as
2 /* $Header: beeptrhi.pkb 120.1 2006/03/13 05:03:41 rgajula noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' ben_ept_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_ept_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_elig_per_typ_prte_f',
78 p_base_key_column => 'elig_per_typ_prte_id',
79 p_base_key_value => p_rec.elig_per_typ_prte_id);
80 --
81 ben_ept_shd.g_api_dml := true; -- Set the api dml status
82 --
83 -- Update the ben_elig_per_typ_prte_f Row
84 --
85 update ben_elig_per_typ_prte_f
86 set
87 elig_per_typ_prte_id = p_rec.elig_per_typ_prte_id,
88 business_group_id = p_rec.business_group_id,
89 eligy_prfl_id = p_rec.eligy_prfl_id,
90 per_typ_cd = p_rec.per_typ_cd,
91 person_type_id = p_rec.person_type_id,
92 ordr_num = p_rec.ordr_num,
93 excld_flag = p_rec.excld_flag,
94 ept_attribute_category = p_rec.ept_attribute_category,
95 ept_attribute1 = p_rec.ept_attribute1,
96 ept_attribute2 = p_rec.ept_attribute2,
97 ept_attribute3 = p_rec.ept_attribute3,
98 ept_attribute4 = p_rec.ept_attribute4,
99 ept_attribute5 = p_rec.ept_attribute5,
100 ept_attribute6 = p_rec.ept_attribute6,
101 ept_attribute7 = p_rec.ept_attribute7,
102 ept_attribute8 = p_rec.ept_attribute8,
103 ept_attribute9 = p_rec.ept_attribute9,
104 ept_attribute10 = p_rec.ept_attribute10,
105 ept_attribute11 = p_rec.ept_attribute11,
106 ept_attribute12 = p_rec.ept_attribute12,
107 ept_attribute13 = p_rec.ept_attribute13,
108 ept_attribute14 = p_rec.ept_attribute14,
109 ept_attribute15 = p_rec.ept_attribute15,
110 ept_attribute16 = p_rec.ept_attribute16,
111 ept_attribute17 = p_rec.ept_attribute17,
112 ept_attribute18 = p_rec.ept_attribute18,
113 ept_attribute19 = p_rec.ept_attribute19,
114 ept_attribute20 = p_rec.ept_attribute20,
115 ept_attribute21 = p_rec.ept_attribute21,
116 ept_attribute22 = p_rec.ept_attribute22,
117 ept_attribute23 = p_rec.ept_attribute23,
118 ept_attribute24 = p_rec.ept_attribute24,
119 ept_attribute25 = p_rec.ept_attribute25,
120 ept_attribute26 = p_rec.ept_attribute26,
121 ept_attribute27 = p_rec.ept_attribute27,
122 ept_attribute28 = p_rec.ept_attribute28,
123 ept_attribute29 = p_rec.ept_attribute29,
124 ept_attribute30 = p_rec.ept_attribute30,
125 object_version_number = p_rec.object_version_number,
126 criteria_score = p_rec.criteria_score,
127 criteria_weight = p_rec.criteria_weight
128
129 where elig_per_typ_prte_id = p_rec.elig_per_typ_prte_id
130 and effective_start_date = p_validation_start_date
131 and effective_end_date = p_validation_end_date;
132 --
133 ben_ept_shd.g_api_dml := false; -- Unset the api dml status
134 --
135 -- Set the effective start and end dates
136 --
137 p_rec.effective_start_date := p_validation_start_date;
138 p_rec.effective_end_date := p_validation_end_date;
139 End If;
140 --
141 hr_utility.set_location(' Leaving:'||l_proc, 15);
142 Exception
143 When hr_api.check_integrity_violated Then
144 -- A check constraint has been violated
145 ben_ept_shd.g_api_dml := false; -- Unset the api dml status
146 ben_ept_shd.constraint_error
147 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
148 When hr_api.unique_integrity_violated Then
149 -- Unique integrity has been violated
150 ben_ept_shd.g_api_dml := false; -- Unset the api dml status
151 ben_ept_shd.constraint_error
152 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
153 When Others Then
154 ben_ept_shd.g_api_dml := false; -- Unset the api dml status
155 Raise;
156 End dt_update_dml;
157 --
158 -- ----------------------------------------------------------------------------
159 -- |------------------------------< update_dml >------------------------------|
160 -- ----------------------------------------------------------------------------
161 -- {Start Of Comments}
162 --
163 -- Description:
164 -- This procedure calls the dt_update_dml control logic which handles
165 -- the actual datetrack dml.
166 --
167 -- Prerequisites:
168 -- This is an internal private procedure which must be called from the upd
169 -- procedure.
170 --
171 -- In Parameters:
172 -- A Pl/Sql record structre.
173 --
174 -- Post Success:
175 -- Processing contines.
176 --
177 -- Post Failure:
178 -- No specific error handling is required within this procedure.
179 --
180 -- Developer Implementation Notes:
181 -- The update 'set' arguments list should be modified if any of your
182 -- attributes are not updateable.
183 --
184 -- Access Status:
185 -- Internal Row Handler Use Only.
186 --
187 -- {End Of Comments}
188 -- ----------------------------------------------------------------------------
189 Procedure update_dml
190 (p_rec in out nocopy ben_ept_shd.g_rec_type,
191 p_effective_date in date,
192 p_datetrack_mode in varchar2,
193 p_validation_start_date in date,
194 p_validation_end_date in date) is
195 --
196 l_proc varchar2(72) := g_package||'update_dml';
197 --
198 Begin
199 hr_utility.set_location('Entering:'||l_proc, 5);
200 --
201 dt_update_dml(p_rec => p_rec,
202 p_effective_date => p_effective_date,
203 p_datetrack_mode => p_datetrack_mode,
204 p_validation_start_date => p_validation_start_date,
205 p_validation_end_date => p_validation_end_date);
206 --
207 hr_utility.set_location(' Leaving:'||l_proc, 10);
208 End update_dml;
209 --
210 -- ----------------------------------------------------------------------------
211 -- |----------------------------< dt_pre_update >-----------------------------|
212 -- ----------------------------------------------------------------------------
213 -- {Start Of Comments}
214 --
215 -- Description:
216 -- The dt_pre_update procedure controls the execution
217 -- of dml for the datetrack modes of: UPDATE, UPDATE_OVERRIDE
218 -- and UPDATE_CHANGE_INSERT only. The execution required is as
219 -- follows:
220 --
221 -- 1) Providing the datetrack update mode is not 'CORRECTION'
222 -- then set the effective end date of the current row (this
223 -- will be the validation_start_date - 1).
224 -- 2) If the datetrack mode is 'UPDATE_OVERRIDE' then call the
225 -- corresponding delete_dml process to delete any future rows
226 -- where the effective_start_date is greater than or equal to
227 -- the validation_start_date.
228 -- 3) Call the insert_dml process to insert the new updated row
229 -- details..
230 --
231 -- Prerequisites:
232 -- This is an internal procedure which is called from the
233 -- pre_update procedure.
234 --
235 -- In Parameters:
236 --
237 -- Post Success:
238 -- Processing continues.
239 --
240 -- Post Failure:
241 -- If an error has occurred, an error message and exception will be raised
242 -- but not handled.
243 --
244 -- Developer Implementation Notes:
245 -- This is an internal procedure which is required by Datetrack. Don't
246 -- remove or modify.
247 --
248 -- Access Status:
249 -- Internal Row Handler Use Only.
250 --
251 -- {End Of Comments}
252 -- ----------------------------------------------------------------------------
253 Procedure dt_pre_update
254 (p_rec in out nocopy ben_ept_shd.g_rec_type,
255 p_effective_date in date,
256 p_datetrack_mode in varchar2,
257 p_validation_start_date in date,
258 p_validation_end_date in date) is
259 --
260 l_proc varchar2(72) := g_package||'dt_pre_update';
261 l_dummy_version_number number;
262 --
263 Begin
264 hr_utility.set_location('Entering:'||l_proc, 5);
265 If (p_datetrack_mode <> 'CORRECTION') then
266 hr_utility.set_location(l_proc, 10);
267 --
268 -- Update the current effective end date
269 --
270 ben_ept_shd.upd_effective_end_date
271 (p_effective_date => p_effective_date,
272 p_base_key_value => p_rec.elig_per_typ_prte_id,
273 p_new_effective_end_date => (p_validation_start_date - 1),
274 p_validation_start_date => p_validation_start_date,
275 p_validation_end_date => p_validation_end_date,
276 p_object_version_number => l_dummy_version_number);
277 --
278 If (p_datetrack_mode = 'UPDATE_OVERRIDE') then
279 hr_utility.set_location(l_proc, 15);
280 --
281 -- As the datetrack mode is 'UPDATE_OVERRIDE' then we must
282 -- delete any future rows
283 --
284 ben_ept_del.delete_dml
285 (p_rec => p_rec,
286 p_effective_date => p_effective_date,
287 p_datetrack_mode => p_datetrack_mode,
288 p_validation_start_date => p_validation_start_date,
289 p_validation_end_date => p_validation_end_date);
290 End If;
291 hr_utility.set_location(l_proc, 20);
292 --
293 -- We must now insert the updated row
294 --
295 ben_ept_ins.insert_dml
296 (p_rec => p_rec,
297 p_effective_date => p_effective_date,
298 p_datetrack_mode => p_datetrack_mode,
299 p_validation_start_date => p_validation_start_date,
300 p_validation_end_date => p_validation_end_date);
301 End If;
302 hr_utility.set_location(' Leaving:'||l_proc, 20);
303 End dt_pre_update;
304 --
305 -- ----------------------------------------------------------------------------
306 -- |------------------------------< pre_update >------------------------------|
307 -- ----------------------------------------------------------------------------
308 -- {Start Of Comments}
309 --
310 -- Description:
311 -- This private procedure contains any processing which is required before
312 -- the update dml.
313 --
314 -- Prerequisites:
315 -- This is an internal procedure which is called from the upd procedure.
316 --
317 -- In Parameters:
318 -- A Pl/Sql record structre.
319 --
320 -- Post Success:
321 -- Processing continues.
322 --
323 -- Post Failure:
324 -- If an error has occurred, an error message and exception will be raised
325 -- but not handled.
326 --
327 -- Developer Implementation Notes:
331 -- to the dt_update_dml procedure should NOT be removed.
328 -- Any pre-processing required before the update dml is issued should be
329 -- coded within this procedure. It is important to note that any 3rd party
330 -- maintenance should be reviewed before placing in this procedure. The call
332 --
333 -- Access Status:
334 -- Internal Row Handler Use Only.
335 --
336 -- {End Of Comments}
337 -- ----------------------------------------------------------------------------
338 Procedure pre_update
339 (p_rec in out nocopy ben_ept_shd.g_rec_type,
340 p_effective_date in date,
341 p_datetrack_mode in varchar2,
342 p_validation_start_date in date,
343 p_validation_end_date in date) is
344 --
345 l_proc varchar2(72) := g_package||'pre_update';
346 --
347 Begin
348 hr_utility.set_location('Entering:'||l_proc, 5);
349 --
350 --
351 --
352 dt_pre_update
353 (p_rec => p_rec,
354 p_effective_date => p_effective_date,
355 p_datetrack_mode => p_datetrack_mode,
356 p_validation_start_date => p_validation_start_date,
357 p_validation_end_date => p_validation_end_date);
358 --
359 hr_utility.set_location(' Leaving:'||l_proc, 10);
360 End pre_update;
361 --
362 -- ----------------------------------------------------------------------------
363 -- |-----------------------------< post_update >------------------------------|
364 -- ----------------------------------------------------------------------------
365 -- {Start Of Comments}
366 --
367 -- Description:
368 -- This private procedure contains any processing which is required after the
369 -- update dml.
370 --
371 -- Prerequisites:
372 -- This is an internal procedure which is called from the upd procedure.
373 --
374 -- In Parameters:
375 -- A Pl/Sql record structre.
376 --
377 -- Post Success:
378 -- Processing continues.
379 --
380 -- Post Failure:
381 -- If an error has occurred, an error message and exception will be raised
382 -- but not handled.
383 --
384 -- Developer Implementation Notes:
385 -- Any post-processing required after the update dml is issued should be
386 -- coded within this procedure. It is important to note that any 3rd party
387 -- maintenance should be reviewed before placing in this procedure.
388 --
389 -- Access Status:
390 -- Internal Row Handler Use Only.
391 --
392 -- {End Of Comments}
393 -- ----------------------------------------------------------------------------
394 Procedure post_update
395 (p_rec in ben_ept_shd.g_rec_type,
396 p_effective_date in date,
397 p_datetrack_mode in varchar2,
398 p_validation_start_date in date,
399 p_validation_end_date in date) is
400 --
401 l_proc varchar2(72) := g_package||'post_update';
402 --
403 Begin
404 hr_utility.set_location('Entering:'||l_proc, 5);
405 --
406 --
407 -- Start of API User Hook for post_update.
408 --
409 begin
410 --
411 ben_ept_rku.after_update
412 (
413 p_elig_per_typ_prte_id =>p_rec.elig_per_typ_prte_id
414 ,p_effective_start_date =>p_rec.effective_start_date
415 ,p_effective_end_date =>p_rec.effective_end_date
416 ,p_business_group_id =>p_rec.business_group_id
417 ,p_eligy_prfl_id =>p_rec.eligy_prfl_id
418 ,p_per_typ_cd =>p_rec.per_typ_cd
419 ,p_person_type_id =>p_rec.person_type_id
420 ,p_ordr_num =>p_rec.ordr_num
421 ,p_excld_flag =>p_rec.excld_flag
422 ,p_ept_attribute_category =>p_rec.ept_attribute_category
423 ,p_ept_attribute1 =>p_rec.ept_attribute1
424 ,p_ept_attribute2 =>p_rec.ept_attribute2
425 ,p_ept_attribute3 =>p_rec.ept_attribute3
426 ,p_ept_attribute4 =>p_rec.ept_attribute4
427 ,p_ept_attribute5 =>p_rec.ept_attribute5
428 ,p_ept_attribute6 =>p_rec.ept_attribute6
429 ,p_ept_attribute7 =>p_rec.ept_attribute7
430 ,p_ept_attribute8 =>p_rec.ept_attribute8
431 ,p_ept_attribute9 =>p_rec.ept_attribute9
432 ,p_ept_attribute10 =>p_rec.ept_attribute10
433 ,p_ept_attribute11 =>p_rec.ept_attribute11
434 ,p_ept_attribute12 =>p_rec.ept_attribute12
435 ,p_ept_attribute13 =>p_rec.ept_attribute13
436 ,p_ept_attribute14 =>p_rec.ept_attribute14
437 ,p_ept_attribute15 =>p_rec.ept_attribute15
438 ,p_ept_attribute16 =>p_rec.ept_attribute16
439 ,p_ept_attribute17 =>p_rec.ept_attribute17
440 ,p_ept_attribute18 =>p_rec.ept_attribute18
441 ,p_ept_attribute19 =>p_rec.ept_attribute19
442 ,p_ept_attribute20 =>p_rec.ept_attribute20
443 ,p_ept_attribute21 =>p_rec.ept_attribute21
444 ,p_ept_attribute22 =>p_rec.ept_attribute22
445 ,p_ept_attribute23 =>p_rec.ept_attribute23
446 ,p_ept_attribute24 =>p_rec.ept_attribute24
447 ,p_ept_attribute25 =>p_rec.ept_attribute25
448 ,p_ept_attribute26 =>p_rec.ept_attribute26
449 ,p_ept_attribute27 =>p_rec.ept_attribute27
450 ,p_ept_attribute28 =>p_rec.ept_attribute28
451 ,p_ept_attribute29 =>p_rec.ept_attribute29
452 ,p_ept_attribute30 =>p_rec.ept_attribute30
456 ,p_validation_start_date =>p_validation_start_date
453 ,p_object_version_number =>p_rec.object_version_number
454 ,p_effective_date =>p_effective_date
455 ,p_datetrack_mode =>p_datetrack_mode
457 ,p_validation_end_date =>p_validation_end_date
458 ,p_effective_start_date_o =>ben_ept_shd.g_old_rec.effective_start_date
459 ,p_effective_end_date_o =>ben_ept_shd.g_old_rec.effective_end_date
460 ,p_business_group_id_o =>ben_ept_shd.g_old_rec.business_group_id
461 ,p_eligy_prfl_id_o =>ben_ept_shd.g_old_rec.eligy_prfl_id
462 ,p_per_typ_cd_o =>ben_ept_shd.g_old_rec.per_typ_cd
463 ,p_person_type_id_o =>ben_ept_shd.g_old_rec.person_type_id
464 ,p_ordr_num_o =>ben_ept_shd.g_old_rec.ordr_num
465 ,p_excld_flag_o =>ben_ept_shd.g_old_rec.excld_flag
466 ,p_ept_attribute_category_o =>ben_ept_shd.g_old_rec.ept_attribute_category
467 ,p_ept_attribute1_o =>ben_ept_shd.g_old_rec.ept_attribute1
468 ,p_ept_attribute2_o =>ben_ept_shd.g_old_rec.ept_attribute2
469 ,p_ept_attribute3_o =>ben_ept_shd.g_old_rec.ept_attribute3
470 ,p_ept_attribute4_o =>ben_ept_shd.g_old_rec.ept_attribute4
471 ,p_ept_attribute5_o =>ben_ept_shd.g_old_rec.ept_attribute5
472 ,p_ept_attribute6_o =>ben_ept_shd.g_old_rec.ept_attribute6
473 ,p_ept_attribute7_o =>ben_ept_shd.g_old_rec.ept_attribute7
474 ,p_ept_attribute8_o =>ben_ept_shd.g_old_rec.ept_attribute8
475 ,p_ept_attribute9_o =>ben_ept_shd.g_old_rec.ept_attribute9
476 ,p_ept_attribute10_o =>ben_ept_shd.g_old_rec.ept_attribute10
477 ,p_ept_attribute11_o =>ben_ept_shd.g_old_rec.ept_attribute11
478 ,p_ept_attribute12_o =>ben_ept_shd.g_old_rec.ept_attribute12
479 ,p_ept_attribute13_o =>ben_ept_shd.g_old_rec.ept_attribute13
480 ,p_ept_attribute14_o =>ben_ept_shd.g_old_rec.ept_attribute14
481 ,p_ept_attribute15_o =>ben_ept_shd.g_old_rec.ept_attribute15
482 ,p_ept_attribute16_o =>ben_ept_shd.g_old_rec.ept_attribute16
483 ,p_ept_attribute17_o =>ben_ept_shd.g_old_rec.ept_attribute17
484 ,p_ept_attribute18_o =>ben_ept_shd.g_old_rec.ept_attribute18
485 ,p_ept_attribute19_o =>ben_ept_shd.g_old_rec.ept_attribute19
486 ,p_ept_attribute20_o =>ben_ept_shd.g_old_rec.ept_attribute20
487 ,p_ept_attribute21_o =>ben_ept_shd.g_old_rec.ept_attribute21
488 ,p_ept_attribute22_o =>ben_ept_shd.g_old_rec.ept_attribute22
489 ,p_ept_attribute23_o =>ben_ept_shd.g_old_rec.ept_attribute23
490 ,p_ept_attribute24_o =>ben_ept_shd.g_old_rec.ept_attribute24
491 ,p_ept_attribute25_o =>ben_ept_shd.g_old_rec.ept_attribute25
492 ,p_ept_attribute26_o =>ben_ept_shd.g_old_rec.ept_attribute26
493 ,p_ept_attribute27_o =>ben_ept_shd.g_old_rec.ept_attribute27
494 ,p_ept_attribute28_o =>ben_ept_shd.g_old_rec.ept_attribute28
495 ,p_ept_attribute29_o =>ben_ept_shd.g_old_rec.ept_attribute29
496 ,p_ept_attribute30_o =>ben_ept_shd.g_old_rec.ept_attribute30
497 ,p_object_version_number_o =>ben_ept_shd.g_old_rec.object_version_number
498 ,p_criteria_score =>p_rec.criteria_score
499 ,p_criteria_weight =>p_rec.criteria_weight
500 ,p_criteria_score_o =>ben_ept_shd.g_old_rec.criteria_score
501 ,p_criteria_weight_o =>ben_ept_shd.g_old_rec.criteria_weight
502
503
504 );
505 --
506 exception
507 --
508 when hr_api.cannot_find_prog_unit then
509 --
510 hr_api.cannot_find_prog_unit_error
511 (p_module_name => 'ben_elig_per_typ_prte_f'
512 ,p_hook_type => 'AU');
513 --
514 end;
515 --
516 -- End of API User Hook for post_update.
517 --
518 --
519 hr_utility.set_location(' Leaving:'||l_proc, 10);
520 End post_update;
521 --
522 -- ----------------------------------------------------------------------------
523 -- |-----------------------------< convert_defs >-----------------------------|
524 -- ----------------------------------------------------------------------------
525 -- {Start Of Comments}
526 --
527 -- Description:
528 -- The Convert_Defs procedure has one very important function:
529 -- It must return the record structure for the row with all system defaulted
530 -- values converted into its corresponding parameter value for update. When
531 -- we attempt to update a row through the Upd process , certain
532 -- parameters can be defaulted which enables flexibility in the calling of
533 -- the upd process (e.g. only attributes which need to be updated need to be
534 -- specified). For the upd process to determine which attributes
535 -- have NOT been specified we need to check if the parameter has a reserved
536 -- system default value. Therefore, for all parameters which have a
537 -- corresponding reserved system default mechanism specified we need to
538 -- check if a system default is being used. If a system default is being
539 -- used then we convert the defaulted value into its corresponding attribute
540 -- value held in the g_old_rec data structure.
541 --
542 -- Prerequisites:
543 -- This private function can only be called from the upd process.
544 --
545 -- In Parameters:
546 -- A Pl/Sql record structre.
547 --
548 -- Post Success:
549 -- The record structure will be returned with all system defaulted parameter
550 -- values converted into its current row attribute value.
551 --
555 -- of datatypes or data lengths.
552 -- Post Failure:
553 -- No direct error handling is required within this function. Any possible
554 -- errors within this procedure will be a PL/SQL value error due to conversion
556 --
557 -- Developer Implementation Notes:
558 -- None.
559 --
560 -- Access Status:
561 -- Internal Row Handler Use Only.
562 --
563 -- {End Of Comments}
564 -- ----------------------------------------------------------------------------
565 Procedure convert_defs(p_rec in out nocopy ben_ept_shd.g_rec_type) is
566 --
567 l_proc varchar2(72) := g_package||'convert_defs';
568 --
569 Begin
570 --
571 hr_utility.set_location('Entering:'||l_proc, 5);
572 --
573 -- We must now examine each argument value in the
574 -- p_rec plsql record structure
575 -- to see if a system default is being used. If a system default
576 -- is being used then we must set to the 'current' argument value.
577 --
578 If (p_rec.business_group_id = hr_api.g_number) then
579 p_rec.business_group_id :=
580 ben_ept_shd.g_old_rec.business_group_id;
581 End If;
582 If (p_rec.eligy_prfl_id = hr_api.g_number) then
583 p_rec.eligy_prfl_id :=
584 ben_ept_shd.g_old_rec.eligy_prfl_id;
585 End If;
586 If (p_rec.per_typ_cd = hr_api.g_varchar2) then
587 p_rec.per_typ_cd :=
588 ben_ept_shd.g_old_rec.per_typ_cd;
589 End If;
590 If (p_rec.person_type_id = hr_api.g_number) then
591 p_rec.person_type_id :=
592 ben_ept_shd.g_old_rec.person_type_id;
593 End If;
594 If (p_rec.ordr_num = hr_api.g_number) then
595 p_rec.ordr_num :=
596 ben_ept_shd.g_old_rec.ordr_num;
597 End If;
598 If (p_rec.excld_flag = hr_api.g_varchar2) then
599 p_rec.excld_flag :=
600 ben_ept_shd.g_old_rec.excld_flag;
601 End If;
602 If (p_rec.ept_attribute_category = hr_api.g_varchar2) then
603 p_rec.ept_attribute_category :=
604 ben_ept_shd.g_old_rec.ept_attribute_category;
605 End If;
606 If (p_rec.ept_attribute1 = hr_api.g_varchar2) then
607 p_rec.ept_attribute1 :=
608 ben_ept_shd.g_old_rec.ept_attribute1;
609 End If;
610 If (p_rec.ept_attribute2 = hr_api.g_varchar2) then
611 p_rec.ept_attribute2 :=
612 ben_ept_shd.g_old_rec.ept_attribute2;
613 End If;
614 If (p_rec.ept_attribute3 = hr_api.g_varchar2) then
615 p_rec.ept_attribute3 :=
616 ben_ept_shd.g_old_rec.ept_attribute3;
617 End If;
618 If (p_rec.ept_attribute4 = hr_api.g_varchar2) then
619 p_rec.ept_attribute4 :=
620 ben_ept_shd.g_old_rec.ept_attribute4;
621 End If;
622 If (p_rec.ept_attribute5 = hr_api.g_varchar2) then
623 p_rec.ept_attribute5 :=
624 ben_ept_shd.g_old_rec.ept_attribute5;
625 End If;
626 If (p_rec.ept_attribute6 = hr_api.g_varchar2) then
627 p_rec.ept_attribute6 :=
628 ben_ept_shd.g_old_rec.ept_attribute6;
629 End If;
630 If (p_rec.ept_attribute7 = hr_api.g_varchar2) then
631 p_rec.ept_attribute7 :=
632 ben_ept_shd.g_old_rec.ept_attribute7;
633 End If;
634 If (p_rec.ept_attribute8 = hr_api.g_varchar2) then
635 p_rec.ept_attribute8 :=
636 ben_ept_shd.g_old_rec.ept_attribute8;
637 End If;
638 If (p_rec.ept_attribute9 = hr_api.g_varchar2) then
639 p_rec.ept_attribute9 :=
640 ben_ept_shd.g_old_rec.ept_attribute9;
641 End If;
642 If (p_rec.ept_attribute10 = hr_api.g_varchar2) then
643 p_rec.ept_attribute10 :=
644 ben_ept_shd.g_old_rec.ept_attribute10;
645 End If;
646 If (p_rec.ept_attribute11 = hr_api.g_varchar2) then
647 p_rec.ept_attribute11 :=
648 ben_ept_shd.g_old_rec.ept_attribute11;
649 End If;
650 If (p_rec.ept_attribute12 = hr_api.g_varchar2) then
651 p_rec.ept_attribute12 :=
652 ben_ept_shd.g_old_rec.ept_attribute12;
653 End If;
654 If (p_rec.ept_attribute13 = hr_api.g_varchar2) then
655 p_rec.ept_attribute13 :=
656 ben_ept_shd.g_old_rec.ept_attribute13;
657 End If;
658 If (p_rec.ept_attribute14 = hr_api.g_varchar2) then
659 p_rec.ept_attribute14 :=
660 ben_ept_shd.g_old_rec.ept_attribute14;
661 End If;
662 If (p_rec.ept_attribute15 = hr_api.g_varchar2) then
663 p_rec.ept_attribute15 :=
664 ben_ept_shd.g_old_rec.ept_attribute15;
665 End If;
666 If (p_rec.ept_attribute16 = hr_api.g_varchar2) then
667 p_rec.ept_attribute16 :=
668 ben_ept_shd.g_old_rec.ept_attribute16;
669 End If;
670 If (p_rec.ept_attribute17 = hr_api.g_varchar2) then
671 p_rec.ept_attribute17 :=
672 ben_ept_shd.g_old_rec.ept_attribute17;
673 End If;
674 If (p_rec.ept_attribute18 = hr_api.g_varchar2) then
675 p_rec.ept_attribute18 :=
676 ben_ept_shd.g_old_rec.ept_attribute18;
677 End If;
678 If (p_rec.ept_attribute19 = hr_api.g_varchar2) then
679 p_rec.ept_attribute19 :=
680 ben_ept_shd.g_old_rec.ept_attribute19;
681 End If;
682 If (p_rec.ept_attribute20 = hr_api.g_varchar2) then
683 p_rec.ept_attribute20 :=
684 ben_ept_shd.g_old_rec.ept_attribute20;
685 End If;
686 If (p_rec.ept_attribute21 = hr_api.g_varchar2) then
687 p_rec.ept_attribute21 :=
688 ben_ept_shd.g_old_rec.ept_attribute21;
689 End If;
690 If (p_rec.ept_attribute22 = hr_api.g_varchar2) then
694 If (p_rec.ept_attribute23 = hr_api.g_varchar2) then
691 p_rec.ept_attribute22 :=
692 ben_ept_shd.g_old_rec.ept_attribute22;
693 End If;
695 p_rec.ept_attribute23 :=
696 ben_ept_shd.g_old_rec.ept_attribute23;
697 End If;
698 If (p_rec.ept_attribute24 = hr_api.g_varchar2) then
699 p_rec.ept_attribute24 :=
700 ben_ept_shd.g_old_rec.ept_attribute24;
701 End If;
702 If (p_rec.ept_attribute25 = hr_api.g_varchar2) then
703 p_rec.ept_attribute25 :=
704 ben_ept_shd.g_old_rec.ept_attribute25;
705 End If;
706 If (p_rec.ept_attribute26 = hr_api.g_varchar2) then
707 p_rec.ept_attribute26 :=
708 ben_ept_shd.g_old_rec.ept_attribute26;
709 End If;
710 If (p_rec.ept_attribute27 = hr_api.g_varchar2) then
711 p_rec.ept_attribute27 :=
712 ben_ept_shd.g_old_rec.ept_attribute27;
713 End If;
714 If (p_rec.ept_attribute28 = hr_api.g_varchar2) then
715 p_rec.ept_attribute28 :=
716 ben_ept_shd.g_old_rec.ept_attribute28;
717 End If;
718 If (p_rec.ept_attribute29 = hr_api.g_varchar2) then
719 p_rec.ept_attribute29 :=
720 ben_ept_shd.g_old_rec.ept_attribute29;
721 End If;
722
723 If (p_rec.ept_attribute30 = hr_api.g_varchar2) then
724 p_rec.ept_attribute30 :=
725 ben_ept_shd.g_old_rec.ept_attribute30;
726 End If;
727
728 If (p_rec.criteria_score = hr_api.g_number) then
729 p_rec.criteria_score :=
730 ben_ept_shd.g_old_rec.criteria_score;
731 End If;
732
733 If (p_rec.criteria_weight = hr_api.g_number) then
734 p_rec.criteria_weight :=
735 ben_ept_shd.g_old_rec.criteria_weight;
736 End If;
737
738 --
739 hr_utility.set_location(' Leaving:'||l_proc, 10);
740 --
741 End convert_defs;
742 --
743 -- ----------------------------------------------------------------------------
744 -- |---------------------------------< upd >----------------------------------|
745 -- ----------------------------------------------------------------------------
746 Procedure upd
747 (
748 p_rec in out nocopy ben_ept_shd.g_rec_type,
749 p_effective_date in date,
750 p_datetrack_mode in varchar2
751 ) is
752 --
753 l_proc varchar2(72) := g_package||'upd';
754 l_validation_start_date date;
755 l_validation_end_date date;
756 --
757 Begin
758 hr_utility.set_location('Entering:'||l_proc, 5);
759 --
760 -- Ensure that the DateTrack update mode is valid
761 --
762 dt_api.validate_dt_upd_mode(p_datetrack_mode => p_datetrack_mode);
763 --
764 -- We must lock the row which we need to update.
765 --
766 ben_ept_shd.lck
767 (p_effective_date => p_effective_date,
768 p_datetrack_mode => p_datetrack_mode,
769 p_elig_per_typ_prte_id => p_rec.elig_per_typ_prte_id,
770 p_object_version_number => p_rec.object_version_number,
771 p_validation_start_date => l_validation_start_date,
772 p_validation_end_date => l_validation_end_date);
773 --
774 -- 1. During an update system defaults are used to determine if
775 -- arguments have been defaulted or not. We must therefore
776 -- derive the full record structure values to be updated.
777 --
778 -- 2. Call the supporting update validate operations.
779 --
780 convert_defs(p_rec);
781 ben_ept_bus.update_validate
782 (p_rec => p_rec,
783 p_effective_date => p_effective_date,
784 p_datetrack_mode => p_datetrack_mode,
785 p_validation_start_date => l_validation_start_date,
786 p_validation_end_date => l_validation_end_date);
787 --
788 -- Call the supporting pre-update operation
789 --
790 pre_update
791 (p_rec => p_rec,
792 p_effective_date => p_effective_date,
793 p_datetrack_mode => p_datetrack_mode,
794 p_validation_start_date => l_validation_start_date,
795 p_validation_end_date => l_validation_end_date);
796 --
797 -- Update the row.
798 --
799 update_dml
800 (p_rec => p_rec,
801 p_effective_date => p_effective_date,
802 p_datetrack_mode => p_datetrack_mode,
803 p_validation_start_date => l_validation_start_date,
804 p_validation_end_date => l_validation_end_date);
805 --
806 -- Call the supporting post-update operation
807 --
808 post_update
809 (p_rec => p_rec,
810 p_effective_date => p_effective_date,
811 p_datetrack_mode => p_datetrack_mode,
812 p_validation_start_date => l_validation_start_date,
813 p_validation_end_date => l_validation_end_date);
814 End upd;
815 --
816 -- ----------------------------------------------------------------------------
817 -- |---------------------------------< upd >----------------------------------|
818 -- ----------------------------------------------------------------------------
819 Procedure upd
820 (
821 p_elig_per_typ_prte_id in number,
822 p_effective_start_date out nocopy date,
823 p_effective_end_date out nocopy date,
824 p_business_group_id in number default hr_api.g_number,
825 p_eligy_prfl_id in number default hr_api.g_number,
826 p_per_typ_cd in varchar2 default hr_api.g_varchar2,
827 p_person_type_id in number default hr_api.g_number,
831 p_ept_attribute1 in varchar2 default hr_api.g_varchar2,
828 p_ordr_num in number default hr_api.g_number,
829 p_excld_flag in varchar2 default hr_api.g_varchar2,
830 p_ept_attribute_category in varchar2 default hr_api.g_varchar2,
832 p_ept_attribute2 in varchar2 default hr_api.g_varchar2,
833 p_ept_attribute3 in varchar2 default hr_api.g_varchar2,
834 p_ept_attribute4 in varchar2 default hr_api.g_varchar2,
835 p_ept_attribute5 in varchar2 default hr_api.g_varchar2,
836 p_ept_attribute6 in varchar2 default hr_api.g_varchar2,
837 p_ept_attribute7 in varchar2 default hr_api.g_varchar2,
838 p_ept_attribute8 in varchar2 default hr_api.g_varchar2,
839 p_ept_attribute9 in varchar2 default hr_api.g_varchar2,
840 p_ept_attribute10 in varchar2 default hr_api.g_varchar2,
841 p_ept_attribute11 in varchar2 default hr_api.g_varchar2,
842 p_ept_attribute12 in varchar2 default hr_api.g_varchar2,
843 p_ept_attribute13 in varchar2 default hr_api.g_varchar2,
844 p_ept_attribute14 in varchar2 default hr_api.g_varchar2,
845 p_ept_attribute15 in varchar2 default hr_api.g_varchar2,
846 p_ept_attribute16 in varchar2 default hr_api.g_varchar2,
847 p_ept_attribute17 in varchar2 default hr_api.g_varchar2,
848 p_ept_attribute18 in varchar2 default hr_api.g_varchar2,
849 p_ept_attribute19 in varchar2 default hr_api.g_varchar2,
850 p_ept_attribute20 in varchar2 default hr_api.g_varchar2,
851 p_ept_attribute21 in varchar2 default hr_api.g_varchar2,
852 p_ept_attribute22 in varchar2 default hr_api.g_varchar2,
853 p_ept_attribute23 in varchar2 default hr_api.g_varchar2,
854 p_ept_attribute24 in varchar2 default hr_api.g_varchar2,
855 p_ept_attribute25 in varchar2 default hr_api.g_varchar2,
856 p_ept_attribute26 in varchar2 default hr_api.g_varchar2,
857 p_ept_attribute27 in varchar2 default hr_api.g_varchar2,
858 p_ept_attribute28 in varchar2 default hr_api.g_varchar2,
859 p_ept_attribute29 in varchar2 default hr_api.g_varchar2,
860 p_ept_attribute30 in varchar2 default hr_api.g_varchar2,
861 p_object_version_number in out nocopy number,
862 p_effective_date in date,
863 p_datetrack_mode in varchar2,
864 p_criteria_score in number default hr_api.g_number,
865 p_criteria_weight in number default hr_api.g_number
866 ) is
867 --
868 l_rec ben_ept_shd.g_rec_type;
869 l_proc varchar2(72) := g_package||'upd';
870 --
871 Begin
872 hr_utility.set_location('Entering:'||l_proc, 5);
873 --
874 -- Call conversion function to turn arguments into the
875 -- l_rec structure.
876 --
877 l_rec :=
878 ben_ept_shd.convert_args
879 (
880 p_elig_per_typ_prte_id,
881 null,
882 null,
883 p_business_group_id,
884 p_eligy_prfl_id,
885 p_per_typ_cd,
886 p_person_type_id,
887 p_ordr_num,
888 p_excld_flag,
889 p_ept_attribute_category,
890 p_ept_attribute1,
891 p_ept_attribute2,
892 p_ept_attribute3,
893 p_ept_attribute4,
894 p_ept_attribute5,
895 p_ept_attribute6,
896 p_ept_attribute7,
897 p_ept_attribute8,
898 p_ept_attribute9,
899 p_ept_attribute10,
900 p_ept_attribute11,
901 p_ept_attribute12,
902 p_ept_attribute13,
903 p_ept_attribute14,
904 p_ept_attribute15,
905 p_ept_attribute16,
906 p_ept_attribute17,
907 p_ept_attribute18,
908 p_ept_attribute19,
909 p_ept_attribute20,
910 p_ept_attribute21,
911 p_ept_attribute22,
912 p_ept_attribute23,
913 p_ept_attribute24,
914 p_ept_attribute25,
915 p_ept_attribute26,
916 p_ept_attribute27,
917 p_ept_attribute28,
918 p_ept_attribute29,
919 p_ept_attribute30,
920 p_object_version_number,
921 p_criteria_score,
922 p_criteria_weight
923 );
924 --
925 -- Having converted the arguments into the
926 -- plsql record structure we call the corresponding record
927 -- business process.
928 --
929 upd(l_rec, p_effective_date, p_datetrack_mode);
930 p_object_version_number := l_rec.object_version_number;
931 p_effective_start_date := l_rec.effective_start_date;
932 p_effective_end_date := l_rec.effective_end_date;
933 --
934 --
935 hr_utility.set_location(' Leaving:'||l_proc, 10);
936 End upd;
937 --
938 end ben_ept_upd;