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