1 Package Body ben_epr_upd as
2 /* $Header: beeprrhi.pkb 115.5 2002/12/09 12:52:58 lakrish ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' ben_epr_upd.'; -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |------------------------------< update_dml >------------------------------|
12 -- ----------------------------------------------------------------------------
13 -- {Start Of Comments}
14 --
15 -- Description:
16 -- This procedure controls the actual dml update logic. The processing of
17 -- this procedure is:
18 -- 1) Increment the object_version_number by 1 if the object_version_number
19 -- is defined as an attribute for this entity.
20 -- 2) To set and unset the g_api_dml status as required (as we are about to
21 -- perform dml).
22 -- 3) To update the specified row in the schema using the primary key in
23 -- the predicates.
24 -- 4) To trap any constraint violations that may have occurred.
25 -- 5) To raise any other errors.
26 --
27 -- Prerequisites:
28 -- This is an internal private procedure which must be called from the upd
29 -- procedure.
30 --
31 -- In Parameters:
32 -- A Pl/Sql record structre.
33 --
34 -- Post Success:
35 -- The specified row will be updated in the schema.
36 --
37 -- Post Failure:
38 -- On the update dml failure it is important to note that we always reset the
39 -- g_api_dml status to false.
40 -- If a check, unique or parent integrity constraint violation is raised the
41 -- constraint_error procedure will be called.
42 -- If any other error is reported, the error will be raised after the
43 -- g_api_dml status is reset.
44 --
45 -- Developer Implementation Notes:
46 -- The update 'set' attribute list should be modified if any of your
47 -- attributes are not updateable.
48 --
49 -- Access Status:
50 -- Internal Row Handler Use Only.
51 --
52 -- {End Of Comments}
53 -- ----------------------------------------------------------------------------
54 Procedure update_dml(p_rec in out nocopy ben_epr_shd.g_rec_type) is
55 --
56 l_proc varchar2(72) := g_package||'update_dml';
57 --
58 Begin
59 hr_utility.set_location('Entering:'||l_proc, 5);
60 --
61 -- Increment the object version
62 --
63 p_rec.object_version_number := p_rec.object_version_number + 1;
64 --
65 ben_epr_shd.g_api_dml := true; -- Set the api dml status
66 --
67 -- Update the ben_enrt_prem Row
68 --
69 update ben_enrt_prem
70 set
71 enrt_prem_id = p_rec.enrt_prem_id,
72 val = p_rec.val,
73 uom = p_rec.uom,
74 elig_per_elctbl_chc_id = p_rec.elig_per_elctbl_chc_id,
75 enrt_bnft_id = p_rec.enrt_bnft_id,
76 actl_prem_id = p_rec.actl_prem_id,
77 business_group_id = p_rec.business_group_id,
78 epr_attribute_category = p_rec.epr_attribute_category,
79 epr_attribute1 = p_rec.epr_attribute1,
80 epr_attribute2 = p_rec.epr_attribute2,
81 epr_attribute3 = p_rec.epr_attribute3,
82 epr_attribute4 = p_rec.epr_attribute4,
83 epr_attribute5 = p_rec.epr_attribute5,
84 epr_attribute6 = p_rec.epr_attribute6,
85 epr_attribute7 = p_rec.epr_attribute7,
86 epr_attribute8 = p_rec.epr_attribute8,
87 epr_attribute9 = p_rec.epr_attribute9,
88 epr_attribute10 = p_rec.epr_attribute10,
89 epr_attribute11 = p_rec.epr_attribute11,
90 epr_attribute12 = p_rec.epr_attribute12,
91 epr_attribute13 = p_rec.epr_attribute13,
92 epr_attribute14 = p_rec.epr_attribute14,
93 epr_attribute15 = p_rec.epr_attribute15,
94 epr_attribute16 = p_rec.epr_attribute16,
95 epr_attribute17 = p_rec.epr_attribute17,
96 epr_attribute18 = p_rec.epr_attribute18,
97 epr_attribute19 = p_rec.epr_attribute19,
98 epr_attribute20 = p_rec.epr_attribute20,
99 epr_attribute21 = p_rec.epr_attribute21,
100 epr_attribute22 = p_rec.epr_attribute22,
101 epr_attribute23 = p_rec.epr_attribute23,
102 epr_attribute24 = p_rec.epr_attribute24,
103 epr_attribute25 = p_rec.epr_attribute25,
104 epr_attribute26 = p_rec.epr_attribute26,
105 epr_attribute27 = p_rec.epr_attribute27,
106 epr_attribute28 = p_rec.epr_attribute28,
107 epr_attribute29 = p_rec.epr_attribute29,
108 epr_attribute30 = p_rec.epr_attribute30,
109 object_version_number = p_rec.object_version_number,
110 request_id = p_rec.request_id,
111 program_application_id = p_rec.program_application_id,
112 program_id = p_rec.program_id,
113 program_update_date = p_rec.program_update_date
114 where enrt_prem_id = p_rec.enrt_prem_id;
115 --
116 ben_epr_shd.g_api_dml := false; -- Unset the api dml status
117 --
118 hr_utility.set_location(' Leaving:'||l_proc, 10);
119 --
120 Exception
121 When hr_api.check_integrity_violated Then
122 -- A check constraint has been violated
123 ben_epr_shd.g_api_dml := false; -- Unset the api dml status
124 ben_epr_shd.constraint_error
125 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
126 When hr_api.parent_integrity_violated Then
127 -- Parent integrity has been violated
128 ben_epr_shd.g_api_dml := false; -- Unset the api dml status
129 ben_epr_shd.constraint_error
130 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
131 When hr_api.unique_integrity_violated Then
132 -- Unique integrity has been violated
133 ben_epr_shd.g_api_dml := false; -- Unset the api dml status
134 ben_epr_shd.constraint_error
135 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
136 When Others Then
137 ben_epr_shd.g_api_dml := false; -- Unset the api dml status
138 Raise;
139 End update_dml;
140 --
141 -- ----------------------------------------------------------------------------
142 -- |------------------------------< pre_update >------------------------------|
143 -- ----------------------------------------------------------------------------
144 -- {Start Of Comments}
145 --
146 -- Description:
147 -- This private procedure contains any processing which is required before
148 -- the update dml.
149 --
150 -- Prerequisites:
151 -- This is an internal procedure which is called from the upd procedure.
152 --
153 -- In Parameters:
154 -- A Pl/Sql record structre.
155 --
156 -- Post Success:
157 -- Processing continues.
158 --
159 -- Post Failure:
160 -- If an error has occurred, an error message and exception will be raised
161 -- but not handled.
162 --
163 -- Developer Implementation Notes:
164 -- Any pre-processing required before the update dml is issued should be
165 -- coded within this procedure. It is important to note that any 3rd party
166 -- maintenance should be reviewed before placing in this procedure.
167 --
168 -- Access Status:
169 -- Internal Row Handler Use Only.
170 --
171 -- {End Of Comments}
172 -- ----------------------------------------------------------------------------
173 Procedure pre_update(p_rec in ben_epr_shd.g_rec_type) is
174 --
175 l_proc varchar2(72) := g_package||'pre_update';
176 --
177 Begin
178 hr_utility.set_location('Entering:'||l_proc, 5);
179 --
180 hr_utility.set_location(' Leaving:'||l_proc, 10);
181 End pre_update;
182 --
183 -- ----------------------------------------------------------------------------
184 -- |-----------------------------< post_update >------------------------------|
185 -- ----------------------------------------------------------------------------
186 -- {Start Of Comments}
187 --
188 -- Description:
189 -- This private procedure contains any processing which is required after the
190 -- update dml.
191 --
192 -- Prerequisites:
193 -- This is an internal procedure which is called from the upd procedure.
194 --
195 -- In Parameters:
196 -- A Pl/Sql record structre.
197 --
198 -- Post Success:
199 -- Processing continues.
200 --
201 -- Post Failure:
202 -- If an error has occurred, an error message and exception will be raised
203 -- but not handled.
204 --
205 -- Developer Implementation Notes:
206 -- Any post-processing required after the update dml is issued should be
207 -- coded within this procedure. It is important to note that any 3rd party
208 -- maintenance should be reviewed before placing in this procedure.
209 --
210 -- Access Status:
211 -- Internal Row Handler Use Only.
212 --
213 -- {End Of Comments}
214 -- ----------------------------------------------------------------------------
215 Procedure post_update(p_rec in ben_epr_shd.g_rec_type) is
216 --
217 l_proc varchar2(72) := g_package||'post_update';
218 --
219 Begin
220 hr_utility.set_location('Entering:'||l_proc, 5);
221 --
222 --
223 -- Start of API User Hook for post_update.
224 --
225 begin
226 --
227 ben_epr_rku.after_update
228 (
229 p_enrt_prem_id =>p_rec.enrt_prem_id
230 ,p_val =>p_rec.val
231 ,p_uom =>p_rec.uom
232 ,p_elig_per_elctbl_chc_id =>p_rec.elig_per_elctbl_chc_id
233 ,p_enrt_bnft_id =>p_rec.enrt_bnft_id
234 ,p_actl_prem_id =>p_rec.actl_prem_id
235 ,p_business_group_id =>p_rec.business_group_id
236 ,p_epr_attribute_category =>p_rec.epr_attribute_category
237 ,p_epr_attribute1 =>p_rec.epr_attribute1
238 ,p_epr_attribute2 =>p_rec.epr_attribute2
239 ,p_epr_attribute3 =>p_rec.epr_attribute3
240 ,p_epr_attribute4 =>p_rec.epr_attribute4
241 ,p_epr_attribute5 =>p_rec.epr_attribute5
242 ,p_epr_attribute6 =>p_rec.epr_attribute6
243 ,p_epr_attribute7 =>p_rec.epr_attribute7
244 ,p_epr_attribute8 =>p_rec.epr_attribute8
245 ,p_epr_attribute9 =>p_rec.epr_attribute9
246 ,p_epr_attribute10 =>p_rec.epr_attribute10
247 ,p_epr_attribute11 =>p_rec.epr_attribute11
248 ,p_epr_attribute12 =>p_rec.epr_attribute12
249 ,p_epr_attribute13 =>p_rec.epr_attribute13
250 ,p_epr_attribute14 =>p_rec.epr_attribute14
251 ,p_epr_attribute15 =>p_rec.epr_attribute15
252 ,p_epr_attribute16 =>p_rec.epr_attribute16
253 ,p_epr_attribute17 =>p_rec.epr_attribute17
254 ,p_epr_attribute18 =>p_rec.epr_attribute18
255 ,p_epr_attribute19 =>p_rec.epr_attribute19
256 ,p_epr_attribute20 =>p_rec.epr_attribute20
257 ,p_epr_attribute21 =>p_rec.epr_attribute21
258 ,p_epr_attribute22 =>p_rec.epr_attribute22
259 ,p_epr_attribute23 =>p_rec.epr_attribute23
260 ,p_epr_attribute24 =>p_rec.epr_attribute24
261 ,p_epr_attribute25 =>p_rec.epr_attribute25
262 ,p_epr_attribute26 =>p_rec.epr_attribute26
263 ,p_epr_attribute27 =>p_rec.epr_attribute27
264 ,p_epr_attribute28 =>p_rec.epr_attribute28
265 ,p_epr_attribute29 =>p_rec.epr_attribute29
266 ,p_epr_attribute30 =>p_rec.epr_attribute30
267 ,p_object_version_number =>p_rec.object_version_number
268 ,p_request_id =>p_rec.request_id
269 ,p_program_application_id =>p_rec.program_application_id
270 ,p_program_id =>p_rec.program_id
271 ,p_program_update_date =>p_rec.program_update_date
272 ,p_val_o =>ben_epr_shd.g_old_rec.val
273 ,p_uom_o =>ben_epr_shd.g_old_rec.uom
274 ,p_elig_per_elctbl_chc_id_o =>ben_epr_shd.g_old_rec.elig_per_elctbl_chc_id
275 ,p_enrt_bnft_id_o =>ben_epr_shd.g_old_rec.enrt_bnft_id
276 ,p_actl_prem_id_o =>ben_epr_shd.g_old_rec.actl_prem_id
277 ,p_business_group_id_o =>ben_epr_shd.g_old_rec.business_group_id
278 ,p_epr_attribute_category_o =>ben_epr_shd.g_old_rec.epr_attribute_category
279 ,p_epr_attribute1_o =>ben_epr_shd.g_old_rec.epr_attribute1
280 ,p_epr_attribute2_o =>ben_epr_shd.g_old_rec.epr_attribute2
281 ,p_epr_attribute3_o =>ben_epr_shd.g_old_rec.epr_attribute3
282 ,p_epr_attribute4_o =>ben_epr_shd.g_old_rec.epr_attribute4
283 ,p_epr_attribute5_o =>ben_epr_shd.g_old_rec.epr_attribute5
284 ,p_epr_attribute6_o =>ben_epr_shd.g_old_rec.epr_attribute6
285 ,p_epr_attribute7_o =>ben_epr_shd.g_old_rec.epr_attribute7
286 ,p_epr_attribute8_o =>ben_epr_shd.g_old_rec.epr_attribute8
287 ,p_epr_attribute9_o =>ben_epr_shd.g_old_rec.epr_attribute9
288 ,p_epr_attribute10_o =>ben_epr_shd.g_old_rec.epr_attribute10
289 ,p_epr_attribute11_o =>ben_epr_shd.g_old_rec.epr_attribute11
290 ,p_epr_attribute12_o =>ben_epr_shd.g_old_rec.epr_attribute12
291 ,p_epr_attribute13_o =>ben_epr_shd.g_old_rec.epr_attribute13
292 ,p_epr_attribute14_o =>ben_epr_shd.g_old_rec.epr_attribute14
293 ,p_epr_attribute15_o =>ben_epr_shd.g_old_rec.epr_attribute15
294 ,p_epr_attribute16_o =>ben_epr_shd.g_old_rec.epr_attribute16
295 ,p_epr_attribute17_o =>ben_epr_shd.g_old_rec.epr_attribute17
296 ,p_epr_attribute18_o =>ben_epr_shd.g_old_rec.epr_attribute18
297 ,p_epr_attribute19_o =>ben_epr_shd.g_old_rec.epr_attribute19
298 ,p_epr_attribute20_o =>ben_epr_shd.g_old_rec.epr_attribute20
299 ,p_epr_attribute21_o =>ben_epr_shd.g_old_rec.epr_attribute21
300 ,p_epr_attribute22_o =>ben_epr_shd.g_old_rec.epr_attribute22
301 ,p_epr_attribute23_o =>ben_epr_shd.g_old_rec.epr_attribute23
302 ,p_epr_attribute24_o =>ben_epr_shd.g_old_rec.epr_attribute24
303 ,p_epr_attribute25_o =>ben_epr_shd.g_old_rec.epr_attribute25
304 ,p_epr_attribute26_o =>ben_epr_shd.g_old_rec.epr_attribute26
305 ,p_epr_attribute27_o =>ben_epr_shd.g_old_rec.epr_attribute27
306 ,p_epr_attribute28_o =>ben_epr_shd.g_old_rec.epr_attribute28
307 ,p_epr_attribute29_o =>ben_epr_shd.g_old_rec.epr_attribute29
308 ,p_epr_attribute30_o =>ben_epr_shd.g_old_rec.epr_attribute30
309 ,p_object_version_number_o =>ben_epr_shd.g_old_rec.object_version_number
310 ,p_request_id_o =>ben_epr_shd.g_old_rec.request_id
311 ,p_program_application_id_o =>ben_epr_shd.g_old_rec.program_application_id
312 ,p_program_id_o =>ben_epr_shd.g_old_rec.program_id
313 ,p_program_update_date_o =>ben_epr_shd.g_old_rec.program_update_date
314 );
315 --
316 exception
317 --
318 when hr_api.cannot_find_prog_unit then
319 --
320 hr_api.cannot_find_prog_unit_error
321 (p_module_name => 'ben_enrt_prem'
322 ,p_hook_type => 'AU');
323 --
324 end;
325 --
326 -- End of API User Hook for post_update.
327 --
328 --
329 hr_utility.set_location(' Leaving:'||l_proc, 10);
330 End post_update;
331 --
332 -- ----------------------------------------------------------------------------
333 -- |-----------------------------< convert_defs >-----------------------------|
334 -- ----------------------------------------------------------------------------
335 -- {Start Of Comments}
336 --
337 -- Description:
338 -- The Convert_Defs procedure has one very important function:
339 -- It must return the record structure for the row with all system defaulted
340 -- values converted into its corresponding parameter value for update. When
341 -- we attempt to update a row through the Upd process , certain
342 -- parameters can be defaulted which enables flexibility in the calling of
343 -- the upd process (e.g. only attributes which need to be updated need to be
344 -- specified). For the upd process to determine which attributes
345 -- have NOT been specified we need to check if the parameter has a reserved
346 -- system default value. Therefore, for all parameters which have a
347 -- corresponding reserved system default mechanism specified we need to
348 -- check if a system default is being used. If a system default is being
349 -- used then we convert the defaulted value into its corresponding attribute
350 -- value held in the g_old_rec data structure.
351 --
352 -- Prerequisites:
353 -- This private function can only be called from the upd process.
354 --
355 -- In Parameters:
356 -- A Pl/Sql record structre.
357 --
358 -- Post Success:
359 -- The record structure will be returned with all system defaulted parameter
360 -- values converted into its current row attribute value.
361 --
362 -- Post Failure:
363 -- No direct error handling is required within this function. Any possible
364 -- errors within this procedure will be a PL/SQL value error due to conversion
365 -- of datatypes or data lengths.
366 --
367 -- Developer Implementation Notes:
368 -- None.
369 --
370 -- Access Status:
371 -- Internal Row Handler Use Only.
372 --
373 -- {End Of Comments}
374 -- ----------------------------------------------------------------------------
375 Procedure convert_defs(p_rec in out nocopy ben_epr_shd.g_rec_type) is
376 --
377 l_proc varchar2(72) := g_package||'convert_defs';
378 --
379 Begin
380 --
381 hr_utility.set_location('Entering:'||l_proc, 5);
382 --
383 -- We must now examine each argument value in the
384 -- p_rec plsql record structure
385 -- to see if a system default is being used. If a system default
386 -- is being used then we must set to the 'current' argument value.
387 --
388 If (p_rec.val = hr_api.g_number) then
389 p_rec.val :=
390 ben_epr_shd.g_old_rec.val;
391 End If;
392 If (p_rec.uom = hr_api.g_varchar2) then
393 p_rec.uom :=
394 ben_epr_shd.g_old_rec.uom;
395 End If;
396 If (p_rec.elig_per_elctbl_chc_id = hr_api.g_number) then
397 p_rec.elig_per_elctbl_chc_id :=
398 ben_epr_shd.g_old_rec.elig_per_elctbl_chc_id;
399 End If;
400 If (p_rec.enrt_bnft_id = hr_api.g_number) then
401 p_rec.enrt_bnft_id :=
402 ben_epr_shd.g_old_rec.enrt_bnft_id;
403 End If;
404 If (p_rec.actl_prem_id = hr_api.g_number) then
405 p_rec.actl_prem_id :=
406 ben_epr_shd.g_old_rec.actl_prem_id;
407 End If;
408 If (p_rec.business_group_id = hr_api.g_number) then
409 p_rec.business_group_id :=
410 ben_epr_shd.g_old_rec.business_group_id;
411 End If;
412 If (p_rec.epr_attribute_category = hr_api.g_varchar2) then
413 p_rec.epr_attribute_category :=
414 ben_epr_shd.g_old_rec.epr_attribute_category;
415 End If;
416 If (p_rec.epr_attribute1 = hr_api.g_varchar2) then
417 p_rec.epr_attribute1 :=
418 ben_epr_shd.g_old_rec.epr_attribute1;
419 End If;
420 If (p_rec.epr_attribute2 = hr_api.g_varchar2) then
421 p_rec.epr_attribute2 :=
422 ben_epr_shd.g_old_rec.epr_attribute2;
423 End If;
424 If (p_rec.epr_attribute3 = hr_api.g_varchar2) then
425 p_rec.epr_attribute3 :=
426 ben_epr_shd.g_old_rec.epr_attribute3;
427 End If;
428 If (p_rec.epr_attribute4 = hr_api.g_varchar2) then
429 p_rec.epr_attribute4 :=
430 ben_epr_shd.g_old_rec.epr_attribute4;
431 End If;
432 If (p_rec.epr_attribute5 = hr_api.g_varchar2) then
433 p_rec.epr_attribute5 :=
434 ben_epr_shd.g_old_rec.epr_attribute5;
435 End If;
436 If (p_rec.epr_attribute6 = hr_api.g_varchar2) then
437 p_rec.epr_attribute6 :=
438 ben_epr_shd.g_old_rec.epr_attribute6;
439 End If;
440 If (p_rec.epr_attribute7 = hr_api.g_varchar2) then
441 p_rec.epr_attribute7 :=
442 ben_epr_shd.g_old_rec.epr_attribute7;
443 End If;
444 If (p_rec.epr_attribute8 = hr_api.g_varchar2) then
445 p_rec.epr_attribute8 :=
446 ben_epr_shd.g_old_rec.epr_attribute8;
447 End If;
448 If (p_rec.epr_attribute9 = hr_api.g_varchar2) then
449 p_rec.epr_attribute9 :=
450 ben_epr_shd.g_old_rec.epr_attribute9;
451 End If;
452 If (p_rec.epr_attribute10 = hr_api.g_varchar2) then
453 p_rec.epr_attribute10 :=
454 ben_epr_shd.g_old_rec.epr_attribute10;
455 End If;
456 If (p_rec.epr_attribute11 = hr_api.g_varchar2) then
457 p_rec.epr_attribute11 :=
458 ben_epr_shd.g_old_rec.epr_attribute11;
459 End If;
460 If (p_rec.epr_attribute12 = hr_api.g_varchar2) then
461 p_rec.epr_attribute12 :=
462 ben_epr_shd.g_old_rec.epr_attribute12;
463 End If;
464 If (p_rec.epr_attribute13 = hr_api.g_varchar2) then
465 p_rec.epr_attribute13 :=
466 ben_epr_shd.g_old_rec.epr_attribute13;
467 End If;
468 If (p_rec.epr_attribute14 = hr_api.g_varchar2) then
469 p_rec.epr_attribute14 :=
470 ben_epr_shd.g_old_rec.epr_attribute14;
471 End If;
472 If (p_rec.epr_attribute15 = hr_api.g_varchar2) then
473 p_rec.epr_attribute15 :=
474 ben_epr_shd.g_old_rec.epr_attribute15;
475 End If;
476 If (p_rec.epr_attribute16 = hr_api.g_varchar2) then
477 p_rec.epr_attribute16 :=
478 ben_epr_shd.g_old_rec.epr_attribute16;
479 End If;
480 If (p_rec.epr_attribute17 = hr_api.g_varchar2) then
481 p_rec.epr_attribute17 :=
482 ben_epr_shd.g_old_rec.epr_attribute17;
483 End If;
484 If (p_rec.epr_attribute18 = hr_api.g_varchar2) then
485 p_rec.epr_attribute18 :=
486 ben_epr_shd.g_old_rec.epr_attribute18;
487 End If;
488 If (p_rec.epr_attribute19 = hr_api.g_varchar2) then
489 p_rec.epr_attribute19 :=
490 ben_epr_shd.g_old_rec.epr_attribute19;
491 End If;
492 If (p_rec.epr_attribute20 = hr_api.g_varchar2) then
493 p_rec.epr_attribute20 :=
494 ben_epr_shd.g_old_rec.epr_attribute20;
495 End If;
496 If (p_rec.epr_attribute21 = hr_api.g_varchar2) then
497 p_rec.epr_attribute21 :=
498 ben_epr_shd.g_old_rec.epr_attribute21;
499 End If;
500 If (p_rec.epr_attribute22 = hr_api.g_varchar2) then
501 p_rec.epr_attribute22 :=
502 ben_epr_shd.g_old_rec.epr_attribute22;
503 End If;
504 If (p_rec.epr_attribute23 = hr_api.g_varchar2) then
505 p_rec.epr_attribute23 :=
506 ben_epr_shd.g_old_rec.epr_attribute23;
507 End If;
508 If (p_rec.epr_attribute24 = hr_api.g_varchar2) then
509 p_rec.epr_attribute24 :=
510 ben_epr_shd.g_old_rec.epr_attribute24;
511 End If;
512 If (p_rec.epr_attribute25 = hr_api.g_varchar2) then
513 p_rec.epr_attribute25 :=
514 ben_epr_shd.g_old_rec.epr_attribute25;
515 End If;
516 If (p_rec.epr_attribute26 = hr_api.g_varchar2) then
517 p_rec.epr_attribute26 :=
518 ben_epr_shd.g_old_rec.epr_attribute26;
519 End If;
520 If (p_rec.epr_attribute27 = hr_api.g_varchar2) then
521 p_rec.epr_attribute27 :=
522 ben_epr_shd.g_old_rec.epr_attribute27;
523 End If;
524 If (p_rec.epr_attribute28 = hr_api.g_varchar2) then
525 p_rec.epr_attribute28 :=
526 ben_epr_shd.g_old_rec.epr_attribute28;
527 End If;
528 If (p_rec.epr_attribute29 = hr_api.g_varchar2) then
529 p_rec.epr_attribute29 :=
530 ben_epr_shd.g_old_rec.epr_attribute29;
531 End If;
532 If (p_rec.epr_attribute30 = hr_api.g_varchar2) then
533 p_rec.epr_attribute30 :=
534 ben_epr_shd.g_old_rec.epr_attribute30;
535 End If;
536 If (p_rec.request_id = hr_api.g_number) then
537 p_rec.request_id :=
538 ben_epr_shd.g_old_rec.request_id;
539 End If;
540 If (p_rec.program_application_id = hr_api.g_number) then
541 p_rec.program_application_id :=
542 ben_epr_shd.g_old_rec.program_application_id;
543 End If;
544 If (p_rec.program_id = hr_api.g_number) then
545 p_rec.program_id :=
546 ben_epr_shd.g_old_rec.program_id;
547 End If;
548 If (p_rec.program_update_date = hr_api.g_date) then
549 p_rec.program_update_date :=
550 ben_epr_shd.g_old_rec.program_update_date;
551 End If;
552 --
553 hr_utility.set_location(' Leaving:'||l_proc, 10);
554 --
555 End convert_defs;
556 --
557 -- ----------------------------------------------------------------------------
558 -- |---------------------------------< upd >----------------------------------|
559 -- ----------------------------------------------------------------------------
560 Procedure upd
561 (
562 p_rec in out nocopy ben_epr_shd.g_rec_type
563 ) is
564 --
565 l_proc varchar2(72) := g_package||'upd';
566 --
567 Begin
568 hr_utility.set_location('Entering:'||l_proc, 5);
569 --
570 -- We must lock the row which we need to update.
571 --
572 ben_epr_shd.lck
573 (
574 p_rec.enrt_prem_id,
575 p_rec.object_version_number
576 );
577 --
578 -- 1. During an update system defaults are used to determine if
579 -- arguments have been defaulted or not. We must therefore
580 -- derive the full record structure values to be updated.
581 --
582 -- 2. Call the supporting update validate operations.
583 --
584 convert_defs(p_rec);
585 ben_epr_bus.update_validate(p_rec);
586 --
587 -- Call the supporting pre-update operation
588 --
589 pre_update(p_rec);
590 --
591 -- Update the row.
592 --
593 update_dml(p_rec);
594 --
595 -- Call the supporting post-update operation
596 --
597 post_update(p_rec);
598 End upd;
599 --
600 -- ----------------------------------------------------------------------------
601 -- |---------------------------------< upd >----------------------------------|
602 -- ----------------------------------------------------------------------------
603 Procedure upd
604 (
605 p_enrt_prem_id in number,
606 p_val in number default hr_api.g_number,
607 p_uom in varchar2 default hr_api.g_varchar2,
608 p_elig_per_elctbl_chc_id in number default hr_api.g_number,
609 p_enrt_bnft_id in number default hr_api.g_number,
610 p_actl_prem_id in number default hr_api.g_number,
611 p_business_group_id in number default hr_api.g_number,
612 p_epr_attribute_category in varchar2 default hr_api.g_varchar2,
613 p_epr_attribute1 in varchar2 default hr_api.g_varchar2,
614 p_epr_attribute2 in varchar2 default hr_api.g_varchar2,
615 p_epr_attribute3 in varchar2 default hr_api.g_varchar2,
616 p_epr_attribute4 in varchar2 default hr_api.g_varchar2,
617 p_epr_attribute5 in varchar2 default hr_api.g_varchar2,
618 p_epr_attribute6 in varchar2 default hr_api.g_varchar2,
619 p_epr_attribute7 in varchar2 default hr_api.g_varchar2,
620 p_epr_attribute8 in varchar2 default hr_api.g_varchar2,
621 p_epr_attribute9 in varchar2 default hr_api.g_varchar2,
622 p_epr_attribute10 in varchar2 default hr_api.g_varchar2,
623 p_epr_attribute11 in varchar2 default hr_api.g_varchar2,
624 p_epr_attribute12 in varchar2 default hr_api.g_varchar2,
625 p_epr_attribute13 in varchar2 default hr_api.g_varchar2,
626 p_epr_attribute14 in varchar2 default hr_api.g_varchar2,
627 p_epr_attribute15 in varchar2 default hr_api.g_varchar2,
628 p_epr_attribute16 in varchar2 default hr_api.g_varchar2,
629 p_epr_attribute17 in varchar2 default hr_api.g_varchar2,
630 p_epr_attribute18 in varchar2 default hr_api.g_varchar2,
631 p_epr_attribute19 in varchar2 default hr_api.g_varchar2,
632 p_epr_attribute20 in varchar2 default hr_api.g_varchar2,
633 p_epr_attribute21 in varchar2 default hr_api.g_varchar2,
634 p_epr_attribute22 in varchar2 default hr_api.g_varchar2,
635 p_epr_attribute23 in varchar2 default hr_api.g_varchar2,
636 p_epr_attribute24 in varchar2 default hr_api.g_varchar2,
637 p_epr_attribute25 in varchar2 default hr_api.g_varchar2,
638 p_epr_attribute26 in varchar2 default hr_api.g_varchar2,
639 p_epr_attribute27 in varchar2 default hr_api.g_varchar2,
640 p_epr_attribute28 in varchar2 default hr_api.g_varchar2,
641 p_epr_attribute29 in varchar2 default hr_api.g_varchar2,
642 p_epr_attribute30 in varchar2 default hr_api.g_varchar2,
643 p_object_version_number in out nocopy number,
644 p_request_id in number default hr_api.g_number,
645 p_program_application_id in number default hr_api.g_number,
646 p_program_id in number default hr_api.g_number,
647 p_program_update_date in date default hr_api.g_date
648 ) is
649 --
650 l_rec ben_epr_shd.g_rec_type;
651 l_proc varchar2(72) := g_package||'upd';
652 --
653 Begin
654 hr_utility.set_location('Entering:'||l_proc, 5);
655 --
656 -- Call conversion function to turn arguments into the
657 -- l_rec structure.
658 --
659 l_rec :=
660 ben_epr_shd.convert_args
661 (
662 p_enrt_prem_id,
663 p_val,
664 p_uom,
665 p_elig_per_elctbl_chc_id,
666 p_enrt_bnft_id,
667 p_actl_prem_id,
668 p_business_group_id,
669 p_epr_attribute_category,
670 p_epr_attribute1,
671 p_epr_attribute2,
672 p_epr_attribute3,
673 p_epr_attribute4,
674 p_epr_attribute5,
675 p_epr_attribute6,
676 p_epr_attribute7,
677 p_epr_attribute8,
678 p_epr_attribute9,
679 p_epr_attribute10,
680 p_epr_attribute11,
681 p_epr_attribute12,
682 p_epr_attribute13,
683 p_epr_attribute14,
684 p_epr_attribute15,
685 p_epr_attribute16,
686 p_epr_attribute17,
687 p_epr_attribute18,
688 p_epr_attribute19,
689 p_epr_attribute20,
690 p_epr_attribute21,
691 p_epr_attribute22,
692 p_epr_attribute23,
693 p_epr_attribute24,
694 p_epr_attribute25,
695 p_epr_attribute26,
696 p_epr_attribute27,
697 p_epr_attribute28,
698 p_epr_attribute29,
699 p_epr_attribute30,
700 p_object_version_number,
701 p_request_id,
702 p_program_application_id,
703 p_program_id,
704 p_program_update_date
705 );
706 --
707 -- Having converted the arguments into the
708 -- plsql record structure we call the corresponding record
709 -- business process.
710 --
711 upd(l_rec);
712 p_object_version_number := l_rec.object_version_number;
713 --
714 hr_utility.set_location(' Leaving:'||l_proc, 10);
715 End upd;
716 --
717 end ben_epr_upd;