1 Package Body ben_psl_upd as
2 /* $Header: bepslrhi.pkb 115.14 2004/06/30 23:53:12 hmani ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' ben_psl_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_psl_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_per_info_chg_cs_ler_f',
78 p_base_key_column => 'per_info_chg_cs_ler_id',
79 p_base_key_value => p_rec.per_info_chg_cs_ler_id);
80 --
81 ben_psl_shd.g_api_dml := true; -- Set the api dml status
82 --
83 -- Update the ben_per_info_chg_cs_ler_f Row
84 --
85 update ben_per_info_chg_cs_ler_f
86 set
87 per_info_chg_cs_ler_id = p_rec.per_info_chg_cs_ler_id,
88 name = p_rec.name,
89 per_info_chg_cs_ler_rl = p_rec.per_info_chg_cs_ler_rl,
90 old_val = p_rec.old_val,
91 new_val = p_rec.new_val,
92 whatif_lbl_txt = p_rec.whatif_lbl_txt,
93 rule_overrides_flag = p_rec.rule_overrides_flag,
94 source_column = p_rec.source_column,
95 source_table = p_rec.source_table,
96 business_group_id = p_rec.business_group_id,
97 psl_attribute_category = p_rec.psl_attribute_category,
98 psl_attribute1 = p_rec.psl_attribute1,
99 psl_attribute2 = p_rec.psl_attribute2,
100 psl_attribute3 = p_rec.psl_attribute3,
101 psl_attribute4 = p_rec.psl_attribute4,
102 psl_attribute5 = p_rec.psl_attribute5,
103 psl_attribute6 = p_rec.psl_attribute6,
104 psl_attribute7 = p_rec.psl_attribute7,
105 psl_attribute8 = p_rec.psl_attribute8,
106 psl_attribute9 = p_rec.psl_attribute9,
107 psl_attribute10 = p_rec.psl_attribute10,
108 psl_attribute11 = p_rec.psl_attribute11,
109 psl_attribute12 = p_rec.psl_attribute12,
110 psl_attribute13 = p_rec.psl_attribute13,
111 psl_attribute14 = p_rec.psl_attribute14,
112 psl_attribute15 = p_rec.psl_attribute15,
113 psl_attribute16 = p_rec.psl_attribute16,
114 psl_attribute17 = p_rec.psl_attribute17,
115 psl_attribute18 = p_rec.psl_attribute18,
116 psl_attribute19 = p_rec.psl_attribute19,
117 psl_attribute20 = p_rec.psl_attribute20,
118 psl_attribute21 = p_rec.psl_attribute21,
119 psl_attribute22 = p_rec.psl_attribute22,
120 psl_attribute23 = p_rec.psl_attribute23,
121 psl_attribute24 = p_rec.psl_attribute24,
122 psl_attribute25 = p_rec.psl_attribute25,
123 psl_attribute26 = p_rec.psl_attribute26,
124 psl_attribute27 = p_rec.psl_attribute27,
125 psl_attribute28 = p_rec.psl_attribute28,
126 psl_attribute29 = p_rec.psl_attribute29,
127 psl_attribute30 = p_rec.psl_attribute30,
128 object_version_number = p_rec.object_version_number
129 where per_info_chg_cs_ler_id = p_rec.per_info_chg_cs_ler_id
130 and effective_start_date = p_validation_start_date
131 and effective_end_date = p_validation_end_date;
132 --
133 ben_psl_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_psl_shd.g_api_dml := false; -- Unset the api dml status
146 ben_psl_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_psl_shd.g_api_dml := false; -- Unset the api dml status
151 ben_psl_shd.constraint_error
152 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
153 When Others Then
154 ben_psl_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_psl_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_psl_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_psl_shd.upd_effective_end_date
271 (p_effective_date => p_effective_date,
272 p_base_key_value => p_rec.per_info_chg_cs_ler_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_psl_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_psl_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:
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
331 -- to the dt_update_dml procedure should NOT be removed.
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_psl_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_psl_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_psl_rku.after_update
412 (
413 p_per_info_chg_cs_ler_id =>p_rec.per_info_chg_cs_ler_id
414 ,p_name =>p_rec.name
415 ,p_effective_start_date =>p_rec.effective_start_date
416 ,p_effective_end_date =>p_rec.effective_end_date
417 ,p_per_info_chg_cs_ler_rl =>p_rec.per_info_chg_cs_ler_rl
418 ,p_old_val =>p_rec.old_val
419 ,p_new_val =>p_rec.new_val
420 ,p_whatif_lbl_txt =>p_rec.whatif_lbl_txt
421 ,p_rule_overrides_flag =>p_rec.rule_overrides_flag
422 ,p_source_column =>p_rec.source_column
423 ,p_source_table =>p_rec.source_table
424 ,p_business_group_id =>p_rec.business_group_id
425 ,p_psl_attribute_category =>p_rec.psl_attribute_category
426 ,p_psl_attribute1 =>p_rec.psl_attribute1
427 ,p_psl_attribute2 =>p_rec.psl_attribute2
428 ,p_psl_attribute3 =>p_rec.psl_attribute3
429 ,p_psl_attribute4 =>p_rec.psl_attribute4
430 ,p_psl_attribute5 =>p_rec.psl_attribute5
431 ,p_psl_attribute6 =>p_rec.psl_attribute6
432 ,p_psl_attribute7 =>p_rec.psl_attribute7
433 ,p_psl_attribute8 =>p_rec.psl_attribute8
434 ,p_psl_attribute9 =>p_rec.psl_attribute9
435 ,p_psl_attribute10 =>p_rec.psl_attribute10
436 ,p_psl_attribute11 =>p_rec.psl_attribute11
437 ,p_psl_attribute12 =>p_rec.psl_attribute12
438 ,p_psl_attribute13 =>p_rec.psl_attribute13
439 ,p_psl_attribute14 =>p_rec.psl_attribute14
440 ,p_psl_attribute15 =>p_rec.psl_attribute15
441 ,p_psl_attribute16 =>p_rec.psl_attribute16
442 ,p_psl_attribute17 =>p_rec.psl_attribute17
443 ,p_psl_attribute18 =>p_rec.psl_attribute18
444 ,p_psl_attribute19 =>p_rec.psl_attribute19
445 ,p_psl_attribute20 =>p_rec.psl_attribute20
446 ,p_psl_attribute21 =>p_rec.psl_attribute21
447 ,p_psl_attribute22 =>p_rec.psl_attribute22
448 ,p_psl_attribute23 =>p_rec.psl_attribute23
449 ,p_psl_attribute24 =>p_rec.psl_attribute24
450 ,p_psl_attribute25 =>p_rec.psl_attribute25
451 ,p_psl_attribute26 =>p_rec.psl_attribute26
452 ,p_psl_attribute27 =>p_rec.psl_attribute27
453 ,p_psl_attribute28 =>p_rec.psl_attribute28
454 ,p_psl_attribute29 =>p_rec.psl_attribute29
455 ,p_psl_attribute30 =>p_rec.psl_attribute30
456 ,p_object_version_number =>p_rec.object_version_number
457 ,p_effective_date =>p_effective_date
458 ,p_datetrack_mode =>p_datetrack_mode
459 ,p_validation_start_date =>p_validation_start_date
460 ,p_validation_end_date =>p_validation_end_date
461 ,p_effective_start_date_o =>ben_psl_shd.g_old_rec.effective_start_date
462 ,p_effective_end_date_o =>ben_psl_shd.g_old_rec.effective_end_date
463 ,p_per_info_chg_cs_ler_rl_o =>ben_psl_shd.g_old_rec.per_info_chg_cs_ler_rl
464 ,p_name_o =>ben_psl_shd.g_old_rec.name
465 ,p_old_val_o =>ben_psl_shd.g_old_rec.old_val
466 ,p_new_val_o =>ben_psl_shd.g_old_rec.new_val
467 ,p_whatif_lbl_txt_o =>ben_psl_shd.g_old_rec.whatif_lbl_txt
468 ,p_rule_overrides_flag_o =>ben_psl_shd.g_old_rec.rule_overrides_flag
469 ,p_source_column_o =>ben_psl_shd.g_old_rec.source_column
470 ,p_source_table_o =>ben_psl_shd.g_old_rec.source_table
471 ,p_business_group_id_o =>ben_psl_shd.g_old_rec.business_group_id
472 ,p_psl_attribute_category_o =>ben_psl_shd.g_old_rec.psl_attribute_category
473 ,p_psl_attribute1_o =>ben_psl_shd.g_old_rec.psl_attribute1
474 ,p_psl_attribute2_o =>ben_psl_shd.g_old_rec.psl_attribute2
475 ,p_psl_attribute3_o =>ben_psl_shd.g_old_rec.psl_attribute3
476 ,p_psl_attribute4_o =>ben_psl_shd.g_old_rec.psl_attribute4
477 ,p_psl_attribute5_o =>ben_psl_shd.g_old_rec.psl_attribute5
478 ,p_psl_attribute6_o =>ben_psl_shd.g_old_rec.psl_attribute6
479 ,p_psl_attribute7_o =>ben_psl_shd.g_old_rec.psl_attribute7
480 ,p_psl_attribute8_o =>ben_psl_shd.g_old_rec.psl_attribute8
481 ,p_psl_attribute9_o =>ben_psl_shd.g_old_rec.psl_attribute9
482 ,p_psl_attribute10_o =>ben_psl_shd.g_old_rec.psl_attribute10
483 ,p_psl_attribute11_o =>ben_psl_shd.g_old_rec.psl_attribute11
484 ,p_psl_attribute12_o =>ben_psl_shd.g_old_rec.psl_attribute12
485 ,p_psl_attribute13_o =>ben_psl_shd.g_old_rec.psl_attribute13
486 ,p_psl_attribute14_o =>ben_psl_shd.g_old_rec.psl_attribute14
487 ,p_psl_attribute15_o =>ben_psl_shd.g_old_rec.psl_attribute15
488 ,p_psl_attribute16_o =>ben_psl_shd.g_old_rec.psl_attribute16
489 ,p_psl_attribute17_o =>ben_psl_shd.g_old_rec.psl_attribute17
490 ,p_psl_attribute18_o =>ben_psl_shd.g_old_rec.psl_attribute18
491 ,p_psl_attribute19_o =>ben_psl_shd.g_old_rec.psl_attribute19
492 ,p_psl_attribute20_o =>ben_psl_shd.g_old_rec.psl_attribute20
493 ,p_psl_attribute21_o =>ben_psl_shd.g_old_rec.psl_attribute21
494 ,p_psl_attribute22_o =>ben_psl_shd.g_old_rec.psl_attribute22
495 ,p_psl_attribute23_o =>ben_psl_shd.g_old_rec.psl_attribute23
496 ,p_psl_attribute24_o =>ben_psl_shd.g_old_rec.psl_attribute24
497 ,p_psl_attribute25_o =>ben_psl_shd.g_old_rec.psl_attribute25
498 ,p_psl_attribute26_o =>ben_psl_shd.g_old_rec.psl_attribute26
499 ,p_psl_attribute27_o =>ben_psl_shd.g_old_rec.psl_attribute27
500 ,p_psl_attribute28_o =>ben_psl_shd.g_old_rec.psl_attribute28
501 ,p_psl_attribute29_o =>ben_psl_shd.g_old_rec.psl_attribute29
502 ,p_psl_attribute30_o =>ben_psl_shd.g_old_rec.psl_attribute30
503 ,p_object_version_number_o =>ben_psl_shd.g_old_rec.object_version_number
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_per_info_chg_cs_ler_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 --
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
555 -- of datatypes or data lengths.
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_psl_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.per_info_chg_cs_ler_rl = hr_api.g_number) then
579 p_rec.per_info_chg_cs_ler_rl :=
580 ben_psl_shd.g_old_rec.per_info_chg_cs_ler_rl;
581 End If;
582 If (p_rec.name = hr_api.g_varchar2) then
583 p_rec.name :=
584 ben_psl_shd.g_old_rec.name;
585 End If;
586 If (p_rec.old_val = hr_api.g_varchar2) then
587 p_rec.old_val :=
588 ben_psl_shd.g_old_rec.old_val;
589 End If;
590 If (p_rec.new_val = hr_api.g_varchar2) then
591 p_rec.new_val :=
592 ben_psl_shd.g_old_rec.new_val;
593 End If;
594 If (p_rec.whatif_lbl_txt = hr_api.g_varchar2) then
595 p_rec.whatif_lbl_txt :=
596 ben_psl_shd.g_old_rec.whatif_lbl_txt;
597 End If;
598 If (p_rec.rule_overrides_flag = hr_api.g_varchar2) then
599 p_rec.rule_overrides_flag :=
600 ben_psl_shd.g_old_rec.rule_overrides_flag;
601 End If;
602 If (p_rec.source_column = hr_api.g_varchar2) then
603 p_rec.source_column :=
604 ben_psl_shd.g_old_rec.source_column;
605 End If;
606 If (p_rec.source_table = hr_api.g_varchar2) then
607 p_rec.source_table :=
608 ben_psl_shd.g_old_rec.source_table;
609 End If;
610 If (p_rec.business_group_id = hr_api.g_number) then
611 p_rec.business_group_id :=
612 ben_psl_shd.g_old_rec.business_group_id;
613 End If;
614 If (p_rec.psl_attribute_category = hr_api.g_varchar2) then
615 p_rec.psl_attribute_category :=
616 ben_psl_shd.g_old_rec.psl_attribute_category;
617 End If;
618 If (p_rec.psl_attribute1 = hr_api.g_varchar2) then
619 p_rec.psl_attribute1 :=
620 ben_psl_shd.g_old_rec.psl_attribute1;
621 End If;
622 If (p_rec.psl_attribute2 = hr_api.g_varchar2) then
623 p_rec.psl_attribute2 :=
624 ben_psl_shd.g_old_rec.psl_attribute2;
625 End If;
626 If (p_rec.psl_attribute3 = hr_api.g_varchar2) then
627 p_rec.psl_attribute3 :=
628 ben_psl_shd.g_old_rec.psl_attribute3;
629 End If;
630 If (p_rec.psl_attribute4 = hr_api.g_varchar2) then
631 p_rec.psl_attribute4 :=
632 ben_psl_shd.g_old_rec.psl_attribute4;
633 End If;
634 If (p_rec.psl_attribute5 = hr_api.g_varchar2) then
635 p_rec.psl_attribute5 :=
636 ben_psl_shd.g_old_rec.psl_attribute5;
637 End If;
638 If (p_rec.psl_attribute6 = hr_api.g_varchar2) then
639 p_rec.psl_attribute6 :=
640 ben_psl_shd.g_old_rec.psl_attribute6;
641 End If;
642 If (p_rec.psl_attribute7 = hr_api.g_varchar2) then
643 p_rec.psl_attribute7 :=
644 ben_psl_shd.g_old_rec.psl_attribute7;
645 End If;
646 If (p_rec.psl_attribute8 = hr_api.g_varchar2) then
647 p_rec.psl_attribute8 :=
648 ben_psl_shd.g_old_rec.psl_attribute8;
649 End If;
650 If (p_rec.psl_attribute9 = hr_api.g_varchar2) then
651 p_rec.psl_attribute9 :=
652 ben_psl_shd.g_old_rec.psl_attribute9;
653 End If;
654 If (p_rec.psl_attribute10 = hr_api.g_varchar2) then
655 p_rec.psl_attribute10 :=
656 ben_psl_shd.g_old_rec.psl_attribute10;
657 End If;
658 If (p_rec.psl_attribute11 = hr_api.g_varchar2) then
659 p_rec.psl_attribute11 :=
660 ben_psl_shd.g_old_rec.psl_attribute11;
661 End If;
662 If (p_rec.psl_attribute12 = hr_api.g_varchar2) then
663 p_rec.psl_attribute12 :=
664 ben_psl_shd.g_old_rec.psl_attribute12;
665 End If;
666 If (p_rec.psl_attribute13 = hr_api.g_varchar2) then
667 p_rec.psl_attribute13 :=
668 ben_psl_shd.g_old_rec.psl_attribute13;
669 End If;
670 If (p_rec.psl_attribute14 = hr_api.g_varchar2) then
671 p_rec.psl_attribute14 :=
672 ben_psl_shd.g_old_rec.psl_attribute14;
673 End If;
674 If (p_rec.psl_attribute15 = hr_api.g_varchar2) then
675 p_rec.psl_attribute15 :=
676 ben_psl_shd.g_old_rec.psl_attribute15;
677 End If;
678 If (p_rec.psl_attribute16 = hr_api.g_varchar2) then
679 p_rec.psl_attribute16 :=
680 ben_psl_shd.g_old_rec.psl_attribute16;
681 End If;
682 If (p_rec.psl_attribute17 = hr_api.g_varchar2) then
683 p_rec.psl_attribute17 :=
684 ben_psl_shd.g_old_rec.psl_attribute17;
685 End If;
686 If (p_rec.psl_attribute18 = hr_api.g_varchar2) then
687 p_rec.psl_attribute18 :=
688 ben_psl_shd.g_old_rec.psl_attribute18;
689 End If;
690 If (p_rec.psl_attribute19 = hr_api.g_varchar2) then
691 p_rec.psl_attribute19 :=
692 ben_psl_shd.g_old_rec.psl_attribute19;
693 End If;
694 If (p_rec.psl_attribute20 = hr_api.g_varchar2) then
695 p_rec.psl_attribute20 :=
696 ben_psl_shd.g_old_rec.psl_attribute20;
697 End If;
698 If (p_rec.psl_attribute21 = hr_api.g_varchar2) then
699 p_rec.psl_attribute21 :=
700 ben_psl_shd.g_old_rec.psl_attribute21;
701 End If;
702 If (p_rec.psl_attribute22 = hr_api.g_varchar2) then
703 p_rec.psl_attribute22 :=
704 ben_psl_shd.g_old_rec.psl_attribute22;
705 End If;
706 If (p_rec.psl_attribute23 = hr_api.g_varchar2) then
707 p_rec.psl_attribute23 :=
708 ben_psl_shd.g_old_rec.psl_attribute23;
709 End If;
710 If (p_rec.psl_attribute24 = hr_api.g_varchar2) then
711 p_rec.psl_attribute24 :=
712 ben_psl_shd.g_old_rec.psl_attribute24;
713 End If;
714 If (p_rec.psl_attribute25 = hr_api.g_varchar2) then
715 p_rec.psl_attribute25 :=
716 ben_psl_shd.g_old_rec.psl_attribute25;
717 End If;
718 If (p_rec.psl_attribute26 = hr_api.g_varchar2) then
719 p_rec.psl_attribute26 :=
720 ben_psl_shd.g_old_rec.psl_attribute26;
721 End If;
722 If (p_rec.psl_attribute27 = hr_api.g_varchar2) then
723 p_rec.psl_attribute27 :=
724 ben_psl_shd.g_old_rec.psl_attribute27;
725 End If;
726 If (p_rec.psl_attribute28 = hr_api.g_varchar2) then
727 p_rec.psl_attribute28 :=
728 ben_psl_shd.g_old_rec.psl_attribute28;
729 End If;
730 If (p_rec.psl_attribute29 = hr_api.g_varchar2) then
731 p_rec.psl_attribute29 :=
732 ben_psl_shd.g_old_rec.psl_attribute29;
733 End If;
734 If (p_rec.psl_attribute30 = hr_api.g_varchar2) then
735 p_rec.psl_attribute30 :=
736 ben_psl_shd.g_old_rec.psl_attribute30;
737 End If;
738
739 --
740 hr_utility.set_location(' Leaving:'||l_proc, 10);
741 --
742 End convert_defs;
743 --
744 -- ----------------------------------------------------------------------------
745 -- |---------------------------------< upd >----------------------------------|
746 -- ----------------------------------------------------------------------------
747 Procedure upd
748 (
749 p_rec in out nocopy ben_psl_shd.g_rec_type,
750 p_effective_date in date,
751 p_datetrack_mode in varchar2
752 ) is
753 --
754 l_proc varchar2(72) := g_package||'upd';
755 l_validation_start_date date;
756 l_validation_end_date date;
757 --
758 Begin
759 hr_utility.set_location('Entering:'||l_proc, 5);
760 --
761 -- Ensure that the DateTrack update mode is valid
762 --
763 dt_api.validate_dt_upd_mode(p_datetrack_mode => p_datetrack_mode);
764 --
765 -- We must lock the row which we need to update.
766 --
767 ben_psl_shd.lck
768 (p_effective_date => p_effective_date,
769 p_datetrack_mode => p_datetrack_mode,
770 p_per_info_chg_cs_ler_id => p_rec.per_info_chg_cs_ler_id,
771 p_object_version_number => p_rec.object_version_number,
772 p_validation_start_date => l_validation_start_date,
773 p_validation_end_date => l_validation_end_date);
774 --
775 -- 1. During an update system defaults are used to determine if
776 -- arguments have been defaulted or not. We must therefore
777 -- derive the full record structure values to be updated.
778 --
779 -- 2. Call the supporting update validate operations.
780 --
781 convert_defs(p_rec);
782 ben_psl_bus.update_validate
783 (p_rec => p_rec,
784 p_effective_date => p_effective_date,
785 p_datetrack_mode => p_datetrack_mode,
786 p_validation_start_date => l_validation_start_date,
787 p_validation_end_date => l_validation_end_date);
788 --
789 -- Call the supporting pre-update operation
790 --
791 pre_update
792 (p_rec => p_rec,
793 p_effective_date => p_effective_date,
794 p_datetrack_mode => p_datetrack_mode,
795 p_validation_start_date => l_validation_start_date,
796 p_validation_end_date => l_validation_end_date);
797 --
798 -- Update the row.
799 --
800 update_dml
801 (p_rec => p_rec,
802 p_effective_date => p_effective_date,
803 p_datetrack_mode => p_datetrack_mode,
804 p_validation_start_date => l_validation_start_date,
805 p_validation_end_date => l_validation_end_date);
806 --
807 -- Call the supporting post-update operation
808 --
809 post_update
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 End upd;
816 --
817 -- ----------------------------------------------------------------------------
818 -- |---------------------------------< upd >----------------------------------|
819 -- ----------------------------------------------------------------------------
820 Procedure upd
821 (
822 p_per_info_chg_cs_ler_id in number,
823 p_effective_start_date out nocopy date,
824 p_effective_end_date out nocopy date,
825 p_per_info_chg_cs_ler_rl in number default hr_api.g_number,
826 p_name in varchar2 default hr_api.g_varchar2,
827 p_old_val in varchar2 default hr_api.g_varchar2,
828 p_new_val in varchar2 default hr_api.g_varchar2,
829 p_whatif_lbl_txt in varchar2 default hr_api.g_varchar2,
830 p_rule_overrides_flag in varchar2 default hr_api.g_varchar2,
831 p_source_column in varchar2 default hr_api.g_varchar2,
832 p_source_table in varchar2 default hr_api.g_varchar2,
833 p_business_group_id in number default hr_api.g_number,
834 p_psl_attribute_category in varchar2 default hr_api.g_varchar2,
835 p_psl_attribute1 in varchar2 default hr_api.g_varchar2,
836 p_psl_attribute2 in varchar2 default hr_api.g_varchar2,
837 p_psl_attribute3 in varchar2 default hr_api.g_varchar2,
838 p_psl_attribute4 in varchar2 default hr_api.g_varchar2,
839 p_psl_attribute5 in varchar2 default hr_api.g_varchar2,
840 p_psl_attribute6 in varchar2 default hr_api.g_varchar2,
841 p_psl_attribute7 in varchar2 default hr_api.g_varchar2,
842 p_psl_attribute8 in varchar2 default hr_api.g_varchar2,
843 p_psl_attribute9 in varchar2 default hr_api.g_varchar2,
844 p_psl_attribute10 in varchar2 default hr_api.g_varchar2,
845 p_psl_attribute11 in varchar2 default hr_api.g_varchar2,
846 p_psl_attribute12 in varchar2 default hr_api.g_varchar2,
847 p_psl_attribute13 in varchar2 default hr_api.g_varchar2,
848 p_psl_attribute14 in varchar2 default hr_api.g_varchar2,
849 p_psl_attribute15 in varchar2 default hr_api.g_varchar2,
850 p_psl_attribute16 in varchar2 default hr_api.g_varchar2,
851 p_psl_attribute17 in varchar2 default hr_api.g_varchar2,
852 p_psl_attribute18 in varchar2 default hr_api.g_varchar2,
853 p_psl_attribute19 in varchar2 default hr_api.g_varchar2,
854 p_psl_attribute20 in varchar2 default hr_api.g_varchar2,
855 p_psl_attribute21 in varchar2 default hr_api.g_varchar2,
856 p_psl_attribute22 in varchar2 default hr_api.g_varchar2,
857 p_psl_attribute23 in varchar2 default hr_api.g_varchar2,
858 p_psl_attribute24 in varchar2 default hr_api.g_varchar2,
859 p_psl_attribute25 in varchar2 default hr_api.g_varchar2,
860 p_psl_attribute26 in varchar2 default hr_api.g_varchar2,
861 p_psl_attribute27 in varchar2 default hr_api.g_varchar2,
862 p_psl_attribute28 in varchar2 default hr_api.g_varchar2,
863 p_psl_attribute29 in varchar2 default hr_api.g_varchar2,
864 p_psl_attribute30 in varchar2 default hr_api.g_varchar2,
865 p_object_version_number in out nocopy number,
866 p_effective_date in date,
867 p_datetrack_mode in varchar2
868 ) is
869 --
870 l_rec ben_psl_shd.g_rec_type;
871 l_proc varchar2(72) := g_package||'upd';
872 --
873 Begin
874 hr_utility.set_location('Entering:'||l_proc, 5);
875 --
876 -- Call conversion function to turn arguments into the
877 -- l_rec structure.
878 --
879 l_rec :=
880 ben_psl_shd.convert_args
881 (
882 p_per_info_chg_cs_ler_id,
883 p_name,
884 null,
885 null,
886 p_per_info_chg_cs_ler_rl,
887 p_old_val,
888 p_new_val,
889 p_whatif_lbl_txt,
890 p_rule_overrides_flag,
891 p_source_column,
892 p_source_table,
893 p_business_group_id,
894 p_psl_attribute_category,
895 p_psl_attribute1,
896 p_psl_attribute2,
897 p_psl_attribute3,
898 p_psl_attribute4,
899 p_psl_attribute5,
900 p_psl_attribute6,
901 p_psl_attribute7,
902 p_psl_attribute8,
903 p_psl_attribute9,
904 p_psl_attribute10,
905 p_psl_attribute11,
906 p_psl_attribute12,
907 p_psl_attribute13,
908 p_psl_attribute14,
909 p_psl_attribute15,
910 p_psl_attribute16,
911 p_psl_attribute17,
912 p_psl_attribute18,
913 p_psl_attribute19,
914 p_psl_attribute20,
915 p_psl_attribute21,
916 p_psl_attribute22,
917 p_psl_attribute23,
918 p_psl_attribute24,
919 p_psl_attribute25,
920 p_psl_attribute26,
921 p_psl_attribute27,
922 p_psl_attribute28,
923 p_psl_attribute29,
924 p_psl_attribute30,
925 p_object_version_number
926 );
927 --
928 -- Having converted the arguments into the
929 -- plsql record structure we call the corresponding record
930 -- business process.
931 --
932 upd(l_rec, p_effective_date, p_datetrack_mode);
933 p_object_version_number := l_rec.object_version_number;
934 p_effective_start_date := l_rec.effective_start_date;
935 p_effective_end_date := l_rec.effective_end_date;
936 --
937 --
938 hr_utility.set_location(' Leaving:'||l_proc, 10);
939 End upd;
940 --
941 end ben_psl_upd;