1 Package Body ben_enb_upd as
2 /* $Header: beenbrhi.pkb 115.15 2002/12/16 07:02:08 rpgupta ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' ben_enb_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_enb_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_enb_shd.g_api_dml := true; -- Set the api dml status
66 --
67 -- Update the ben_enrt_bnft Row
68 --
69 update ben_enrt_bnft
70 set
71 enrt_bnft_id = p_rec.enrt_bnft_id
72 ,dflt_flag = p_rec.dflt_flag
73 ,val_has_bn_prortd_flag = p_rec.val_has_bn_prortd_flag
74 ,bndry_perd_cd = p_rec.bndry_perd_cd
75 ,val = p_rec.val
76 ,nnmntry_uom = p_rec.nnmntry_uom
77 ,bnft_typ_cd = p_rec.bnft_typ_cd
78 ,entr_val_at_enrt_flag = p_rec.entr_val_at_enrt_flag
79 ,mn_val = p_rec.mn_val
80 ,mx_val = p_rec.mx_val
81 ,incrmt_val = p_rec.incrmt_val
82 ,dflt_val = p_rec.dflt_val
83 ,rt_typ_cd = p_rec.rt_typ_cd
84 ,cvg_mlt_cd = p_rec.cvg_mlt_cd
85 ,ctfn_rqd_flag = p_rec.ctfn_rqd_flag
86 ,ordr_num = p_rec.ordr_num
87 ,crntly_enrld_flag = p_rec.crntly_enrld_flag
88 ,elig_per_elctbl_chc_id = p_rec.elig_per_elctbl_chc_id
89 ,prtt_enrt_rslt_id = p_rec.prtt_enrt_rslt_id
90 ,comp_lvl_fctr_id = p_rec.comp_lvl_fctr_id
91 ,business_group_id = p_rec.business_group_id
92 ,enb_attribute_category = p_rec.enb_attribute_category
93 ,enb_attribute1 = p_rec.enb_attribute1
94 ,enb_attribute2 = p_rec.enb_attribute2
95 ,enb_attribute3 = p_rec.enb_attribute3
96 ,enb_attribute4 = p_rec.enb_attribute4
97 ,enb_attribute5 = p_rec.enb_attribute5
98 ,enb_attribute6 = p_rec.enb_attribute6
99 ,enb_attribute7 = p_rec.enb_attribute7
100 ,enb_attribute8 = p_rec.enb_attribute8
101 ,enb_attribute9 = p_rec.enb_attribute9
102 ,enb_attribute10 = p_rec.enb_attribute10
103 ,enb_attribute11 = p_rec.enb_attribute11
104 ,enb_attribute12 = p_rec.enb_attribute12
105 ,enb_attribute13 = p_rec.enb_attribute13
106 ,enb_attribute14 = p_rec.enb_attribute14
107 ,enb_attribute15 = p_rec.enb_attribute15
108 ,enb_attribute16 = p_rec.enb_attribute16
109 ,enb_attribute17 = p_rec.enb_attribute17
110 ,enb_attribute18 = p_rec.enb_attribute18
111 ,enb_attribute19 = p_rec.enb_attribute19
112 ,enb_attribute20 = p_rec.enb_attribute20
113 ,enb_attribute21 = p_rec.enb_attribute21
114 ,enb_attribute22 = p_rec.enb_attribute22
115 ,enb_attribute23 = p_rec.enb_attribute23
116 ,enb_attribute24 = p_rec.enb_attribute24
117 ,enb_attribute25 = p_rec.enb_attribute25
118 ,enb_attribute26 = p_rec.enb_attribute26
119 ,enb_attribute27 = p_rec.enb_attribute27
120 ,enb_attribute28 = p_rec.enb_attribute28
121 ,enb_attribute29 = p_rec.enb_attribute29
122 ,enb_attribute30 = p_rec.enb_attribute30
123 ,request_id = p_rec.request_id
124 ,program_application_id = p_rec.program_application_id
125 ,program_id = p_rec.program_id
126 ,mx_wout_ctfn_val = p_rec.mx_wout_ctfn_val
127 ,mx_wo_ctfn_flag = p_rec.mx_wo_ctfn_flag
128 ,program_update_date = p_rec.program_update_date
129 ,object_version_number = p_rec.object_version_number
130 where enrt_bnft_id = p_rec.enrt_bnft_id;
131 --
132 ben_enb_shd.g_api_dml := false; -- Unset the api dml status
133 --
134 hr_utility.set_location(' Leaving:'||l_proc, 10);
135 --
136 Exception
137 When hr_api.check_integrity_violated Then
138 -- A check constraint has been violated
139 ben_enb_shd.g_api_dml := false; -- Unset the api dml status
140 ben_enb_shd.constraint_error
141 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
142 When hr_api.parent_integrity_violated Then
143 -- Parent integrity has been violated
144 ben_enb_shd.g_api_dml := false; -- Unset the api dml status
145 ben_enb_shd.constraint_error
146 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
147 When hr_api.unique_integrity_violated Then
148 -- Unique integrity has been violated
149 ben_enb_shd.g_api_dml := false; -- Unset the api dml status
150 ben_enb_shd.constraint_error
151 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
152 When Others Then
153 ben_enb_shd.g_api_dml := false; -- Unset the api dml status
154 Raise;
155 End update_dml;
156 --
157 -- ----------------------------------------------------------------------------
158 -- |------------------------------< pre_update >------------------------------|
159 -- ----------------------------------------------------------------------------
160 -- {Start Of Comments}
161 --
162 -- Description:
163 -- This private procedure contains any processing which is required before
164 -- the update dml.
165 --
166 -- Prerequisites:
167 -- This is an internal procedure which is called from the upd procedure.
168 --
169 -- In Parameters:
170 -- A Pl/Sql record structre.
171 --
172 -- Post Success:
173 -- Processing continues.
174 --
175 -- Post Failure:
176 -- If an error has occurred, an error message and exception will be raised
177 -- but not handled.
178 --
179 -- Developer Implementation Notes:
180 -- Any pre-processing required before the update dml is issued should be
181 -- coded within this procedure. It is important to note that any 3rd party
182 -- maintenance should be reviewed before placing in this procedure.
183 --
184 -- Access Status:
185 -- Internal Row Handler Use Only.
186 --
187 -- {End Of Comments}
188 -- ----------------------------------------------------------------------------
189 Procedure pre_update(p_rec in ben_enb_shd.g_rec_type) is
190 --
191 l_proc varchar2(72) := g_package||'pre_update';
192 --
193 Begin
194 hr_utility.set_location('Entering:'||l_proc, 5);
195 --
196 hr_utility.set_location(' Leaving:'||l_proc, 10);
197 End pre_update;
198 --
199 -- ----------------------------------------------------------------------------
200 -- |-----------------------------< post_update >------------------------------|
201 -- ----------------------------------------------------------------------------
202 -- {Start Of Comments}
203 --
204 -- Description:
205 -- This private procedure contains any processing which is required after the
206 -- update dml.
207 --
208 -- Prerequisites:
209 -- This is an internal procedure which is called from the upd procedure.
210 --
211 -- In Parameters:
212 -- A Pl/Sql record structre.
213 --
214 -- Post Success:
215 -- Processing continues.
216 --
217 -- Post Failure:
218 -- If an error has occurred, an error message and exception will be raised
219 -- but not handled.
220 --
221 -- Developer Implementation Notes:
222 -- Any post-processing required after the update dml is issued should be
223 -- coded within this procedure. It is important to note that any 3rd party
224 -- maintenance should be reviewed before placing in this procedure.
225 --
226 -- Access Status:
227 -- Internal Row Handler Use Only.
228 --
229 -- {End Of Comments}
230 -- ----------------------------------------------------------------------------
231 Procedure post_update(
232 p_effective_date in date,p_rec in ben_enb_shd.g_rec_type) is
233 --
234 l_proc varchar2(72) := g_package||'post_update';
235 --
236 Begin
237 hr_utility.set_location('Entering:'||l_proc, 5);
238 --
239 --
240 -- Start of API User Hook for post_update.
241 --
242 begin
243 --
244 ben_enb_rku.after_update
245 (
246 p_enrt_bnft_id =>p_rec.enrt_bnft_id
247 ,p_dflt_flag =>p_rec.dflt_flag
248 ,p_val_has_bn_prortd_flag =>p_rec.val_has_bn_prortd_flag
249 ,p_bndry_perd_cd =>p_rec.bndry_perd_cd
250 ,p_val =>p_rec.val
251 ,p_nnmntry_uom =>p_rec.nnmntry_uom
252 ,p_bnft_typ_cd =>p_rec.bnft_typ_cd
253 ,p_entr_val_at_enrt_flag =>p_rec.entr_val_at_enrt_flag
254 ,p_mn_val =>p_rec.mn_val
255 ,p_mx_val =>p_rec.mx_val
256 ,p_incrmt_val =>p_rec.incrmt_val
257 ,p_dflt_val =>p_rec.dflt_val
258 ,p_rt_typ_cd =>p_rec.rt_typ_cd
259 ,p_cvg_mlt_cd =>p_rec.cvg_mlt_cd
260 ,p_ctfn_rqd_flag =>p_rec.ctfn_rqd_flag
261 ,p_ordr_num =>p_rec.ordr_num
262 ,p_crntly_enrld_flag =>p_rec.crntly_enrld_flag
263 ,p_elig_per_elctbl_chc_id =>p_rec.elig_per_elctbl_chc_id
264 ,p_prtt_enrt_rslt_id =>p_rec.prtt_enrt_rslt_id
265 ,p_comp_lvl_fctr_id =>p_rec.comp_lvl_fctr_id
266 ,p_business_group_id =>p_rec.business_group_id
267 ,p_enb_attribute_category =>p_rec.enb_attribute_category
268 ,p_enb_attribute1 =>p_rec.enb_attribute1
269 ,p_enb_attribute2 =>p_rec.enb_attribute2
270 ,p_enb_attribute3 =>p_rec.enb_attribute3
271 ,p_enb_attribute4 =>p_rec.enb_attribute4
272 ,p_enb_attribute5 =>p_rec.enb_attribute5
273 ,p_enb_attribute6 =>p_rec.enb_attribute6
274 ,p_enb_attribute7 =>p_rec.enb_attribute7
275 ,p_enb_attribute8 =>p_rec.enb_attribute8
276 ,p_enb_attribute9 =>p_rec.enb_attribute9
277 ,p_enb_attribute10 =>p_rec.enb_attribute10
278 ,p_enb_attribute11 =>p_rec.enb_attribute11
279 ,p_enb_attribute12 =>p_rec.enb_attribute12
280 ,p_enb_attribute13 =>p_rec.enb_attribute13
281 ,p_enb_attribute14 =>p_rec.enb_attribute14
282 ,p_enb_attribute15 =>p_rec.enb_attribute15
283 ,p_enb_attribute16 =>p_rec.enb_attribute16
284 ,p_enb_attribute17 =>p_rec.enb_attribute17
285 ,p_enb_attribute18 =>p_rec.enb_attribute18
286 ,p_enb_attribute19 =>p_rec.enb_attribute19
287 ,p_enb_attribute20 =>p_rec.enb_attribute20
288 ,p_enb_attribute21 =>p_rec.enb_attribute21
289 ,p_enb_attribute22 =>p_rec.enb_attribute22
290 ,p_enb_attribute23 =>p_rec.enb_attribute23
291 ,p_enb_attribute24 =>p_rec.enb_attribute24
292 ,p_enb_attribute25 =>p_rec.enb_attribute25
293 ,p_enb_attribute26 =>p_rec.enb_attribute26
294 ,p_enb_attribute27 =>p_rec.enb_attribute27
295 ,p_enb_attribute28 =>p_rec.enb_attribute28
296 ,p_enb_attribute29 =>p_rec.enb_attribute29
297 ,p_enb_attribute30 =>p_rec.enb_attribute30
298 ,p_request_id =>p_rec.request_id
299 ,p_program_application_id =>p_rec.program_application_id
300 ,p_program_id =>p_rec.program_id
301 ,p_mx_wout_ctfn_val =>p_rec.mx_wout_ctfn_val
302 ,p_mx_wo_ctfn_flag =>p_rec.mx_wo_ctfn_flag
303 ,p_program_update_date =>p_rec.program_update_date
304 ,p_object_version_number =>p_rec.object_version_number
305 ,p_effective_date =>p_effective_date
306 ,p_dflt_flag_o =>ben_enb_shd.g_old_rec.dflt_flag
307 ,p_val_has_bn_prortd_flag_o =>ben_enb_shd.g_old_rec.val_has_bn_prortd_flag
308 ,p_bndry_perd_cd_o =>ben_enb_shd.g_old_rec.bndry_perd_cd
309 ,p_val_o =>ben_enb_shd.g_old_rec.val
310 ,p_nnmntry_uom_o =>ben_enb_shd.g_old_rec.nnmntry_uom
311 ,p_bnft_typ_cd_o =>ben_enb_shd.g_old_rec.bnft_typ_cd
312 ,p_entr_val_at_enrt_flag_o =>ben_enb_shd.g_old_rec.entr_val_at_enrt_flag
313 ,p_mn_val_o =>ben_enb_shd.g_old_rec.mn_val
314 ,p_mx_val_o =>ben_enb_shd.g_old_rec.mx_val
315 ,p_incrmt_val_o =>ben_enb_shd.g_old_rec.incrmt_val
316 ,p_dflt_val_o =>ben_enb_shd.g_old_rec.dflt_val
317 ,p_rt_typ_cd_o =>ben_enb_shd.g_old_rec.rt_typ_cd
318 ,p_cvg_mlt_cd_o =>ben_enb_shd.g_old_rec.cvg_mlt_cd
319 ,p_ctfn_rqd_flag_o =>ben_enb_shd.g_old_rec.ctfn_rqd_flag
320 ,p_ordr_num_o =>ben_enb_shd.g_old_rec.ordr_num
321 ,p_crntly_enrld_flag_o =>ben_enb_shd.g_old_rec.crntly_enrld_flag
322 ,p_elig_per_elctbl_chc_id_o =>ben_enb_shd.g_old_rec.elig_per_elctbl_chc_id
323 ,p_prtt_enrt_rslt_id_o =>ben_enb_shd.g_old_rec.prtt_enrt_rslt_id
324 ,p_comp_lvl_fctr_id_o =>ben_enb_shd.g_old_rec.comp_lvl_fctr_id
325 ,p_business_group_id_o =>ben_enb_shd.g_old_rec.business_group_id
326 ,p_enb_attribute_category_o =>ben_enb_shd.g_old_rec.enb_attribute_category
327 ,p_enb_attribute1_o =>ben_enb_shd.g_old_rec.enb_attribute1
328 ,p_enb_attribute2_o =>ben_enb_shd.g_old_rec.enb_attribute2
329 ,p_enb_attribute3_o =>ben_enb_shd.g_old_rec.enb_attribute3
330 ,p_enb_attribute4_o =>ben_enb_shd.g_old_rec.enb_attribute4
331 ,p_enb_attribute5_o =>ben_enb_shd.g_old_rec.enb_attribute5
332 ,p_enb_attribute6_o =>ben_enb_shd.g_old_rec.enb_attribute6
333 ,p_enb_attribute7_o =>ben_enb_shd.g_old_rec.enb_attribute7
334 ,p_enb_attribute8_o =>ben_enb_shd.g_old_rec.enb_attribute8
335 ,p_enb_attribute9_o =>ben_enb_shd.g_old_rec.enb_attribute9
336 ,p_enb_attribute10_o =>ben_enb_shd.g_old_rec.enb_attribute10
337 ,p_enb_attribute11_o =>ben_enb_shd.g_old_rec.enb_attribute11
338 ,p_enb_attribute12_o =>ben_enb_shd.g_old_rec.enb_attribute12
339 ,p_enb_attribute13_o =>ben_enb_shd.g_old_rec.enb_attribute13
340 ,p_enb_attribute14_o =>ben_enb_shd.g_old_rec.enb_attribute14
341 ,p_enb_attribute15_o =>ben_enb_shd.g_old_rec.enb_attribute15
342 ,p_enb_attribute16_o =>ben_enb_shd.g_old_rec.enb_attribute16
343 ,p_enb_attribute17_o =>ben_enb_shd.g_old_rec.enb_attribute17
344 ,p_enb_attribute18_o =>ben_enb_shd.g_old_rec.enb_attribute18
345 ,p_enb_attribute19_o =>ben_enb_shd.g_old_rec.enb_attribute19
346 ,p_enb_attribute20_o =>ben_enb_shd.g_old_rec.enb_attribute20
347 ,p_enb_attribute21_o =>ben_enb_shd.g_old_rec.enb_attribute21
348 ,p_enb_attribute22_o =>ben_enb_shd.g_old_rec.enb_attribute22
349 ,p_enb_attribute23_o =>ben_enb_shd.g_old_rec.enb_attribute23
350 ,p_enb_attribute24_o =>ben_enb_shd.g_old_rec.enb_attribute24
351 ,p_enb_attribute25_o =>ben_enb_shd.g_old_rec.enb_attribute25
352 ,p_enb_attribute26_o =>ben_enb_shd.g_old_rec.enb_attribute26
353 ,p_enb_attribute27_o =>ben_enb_shd.g_old_rec.enb_attribute27
354 ,p_enb_attribute28_o =>ben_enb_shd.g_old_rec.enb_attribute28
355 ,p_enb_attribute29_o =>ben_enb_shd.g_old_rec.enb_attribute29
356 ,p_enb_attribute30_o =>ben_enb_shd.g_old_rec.enb_attribute30
357 ,p_request_id_o =>ben_enb_shd.g_old_rec.request_id
358 ,p_program_application_id_o =>ben_enb_shd.g_old_rec.program_application_id
359 ,p_program_id_o =>ben_enb_shd.g_old_rec.program_id
360 ,p_mx_wout_ctfn_val_o =>ben_enb_shd.g_old_rec.mx_wout_ctfn_val
361 ,p_mx_wo_ctfn_flag_o =>ben_enb_shd.g_old_rec.mx_wo_ctfn_flag
362 ,p_program_update_date_o =>ben_enb_shd.g_old_rec.program_update_date
363 ,p_object_version_number_o =>ben_enb_shd.g_old_rec.object_version_number
364 );
365 --
366 exception
367 --
368 when hr_api.cannot_find_prog_unit then
369 --
370 hr_api.cannot_find_prog_unit_error
371 (p_module_name => 'ben_enrt_bnft'
372 ,p_hook_type => 'AU');
373 --
374 end;
375 --
376 -- End of API User Hook for post_update.
377 --
378 --
379 hr_utility.set_location(' Leaving:'||l_proc, 10);
380 End post_update;
381 --
382 -- ----------------------------------------------------------------------------
383 -- |-----------------------------< convert_defs >-----------------------------|
384 -- ----------------------------------------------------------------------------
385 -- {Start Of Comments}
386 --
387 -- Description:
388 -- The Convert_Defs procedure has one very important function:
389 -- It must return the record structure for the row with all system defaulted
390 -- values converted into its corresponding parameter value for update. When
391 -- we attempt to update a row through the Upd process , certain
392 -- parameters can be defaulted which enables flexibility in the calling of
393 -- the upd process (e.g. only attributes which need to be updated need to be
394 -- specified). For the upd process to determine which attributes
395 -- have NOT been specified we need to check if the parameter has a reserved
396 -- system default value. Therefore, for all parameters which have a
397 -- corresponding reserved system default mechanism specified we need to
398 -- check if a system default is being used. If a system default is being
399 -- used then we convert the defaulted value into its corresponding attribute
400 -- value held in the g_old_rec data structure.
401 --
402 -- Prerequisites:
403 -- This private function can only be called from the upd process.
404 --
405 -- In Parameters:
406 -- A Pl/Sql record structre.
407 --
408 -- Post Success:
409 -- The record structure will be returned with all system defaulted parameter
410 -- values converted into its current row attribute value.
411 --
412 -- Post Failure:
413 -- No direct error handling is required within this function. Any possible
414 -- errors within this procedure will be a PL/SQL value error due to conversion
415 -- of datatypes or data lengths.
416 --
417 -- Developer Implementation Notes:
418 -- None.
419 --
420 -- Access Status:
421 -- Internal Row Handler Use Only.
422 --
423 -- {End Of Comments}
424 -- ----------------------------------------------------------------------------
425 Procedure convert_defs(p_rec in out nocopy ben_enb_shd.g_rec_type) is
426 --
427 l_proc varchar2(72) := g_package||'convert_defs';
428 --
429 Begin
430 --
431 hr_utility.set_location('Entering:'||l_proc, 5);
432 --
433 -- We must now examine each argument value in the
434 -- p_rec plsql record structure
435 -- to see if a system default is being used. If a system default
436 -- is being used then we must set to the 'current' argument value.
437 --
438
439 If (p_rec.cvg_mlt_cd = hr_api.g_varchar2) then
440 p_rec.cvg_mlt_cd :=
441 ben_enb_shd.g_old_rec.cvg_mlt_cd;
442 End If;
443 If (p_rec.comp_lvl_fctr_id = hr_api.g_number) then
444 p_rec.comp_lvl_fctr_id :=
445 ben_enb_shd.g_old_rec.comp_lvl_fctr_id;
446 End If;
447 If (p_rec.rt_typ_cd = hr_api.g_varchar2) then
448 p_rec.rt_typ_cd :=
449 ben_enb_shd.g_old_rec.rt_typ_cd ;
450 End If;
451 If (p_rec.entr_val_at_enrt_flag = hr_api.g_varchar2) then
452 p_rec.entr_val_at_enrt_flag :=
453 ben_enb_shd.g_old_rec.entr_val_at_enrt_flag;
454 End If;
455 If (p_rec.mn_val = hr_api.g_number) then
456 p_rec.mn_val :=
457 ben_enb_shd.g_old_rec.mn_val;
458 End If;
459 If (p_rec.mx_val = hr_api.g_number) then
460 p_rec.mx_val :=
461 ben_enb_shd.g_old_rec.mx_val;
462 End If;
463 If (p_rec.incrmt_val = hr_api.g_number) then
464 p_rec.incrmt_val :=
465 ben_enb_shd.g_old_rec.incrmt_val;
466 End If;
467 If (p_rec.dflt_val = hr_api.g_number) then
468 p_rec.dflt_val :=
469 ben_enb_shd.g_old_rec.dflt_val;
470 End If;
471 If (p_rec.dflt_flag = hr_api.g_varchar2) then
472 p_rec.dflt_flag :=
473 ben_enb_shd.g_old_rec.dflt_flag;
474 End If;
475 If (p_rec.val_has_bn_prortd_flag = hr_api.g_varchar2) then
476 p_rec.val_has_bn_prortd_flag :=
477 ben_enb_shd.g_old_rec.val_has_bn_prortd_flag;
478 End If;
479 If (p_rec.bndry_perd_cd = hr_api.g_varchar2) then
480 p_rec.bndry_perd_cd :=
481 ben_enb_shd.g_old_rec.bndry_perd_cd;
482 End If;
483 If (p_rec.val = hr_api.g_number) then
484 p_rec.val :=
485 ben_enb_shd.g_old_rec.val;
486 End If;
487 If (p_rec.nnmntry_uom = hr_api.g_varchar2) then
488 p_rec.nnmntry_uom :=
489 ben_enb_shd.g_old_rec.nnmntry_uom;
490 End If;
491 If (p_rec.elig_per_elctbl_chc_id = hr_api.g_number) then
492 p_rec.elig_per_elctbl_chc_id :=
493 ben_enb_shd.g_old_rec.elig_per_elctbl_chc_id;
494 End If;
495 If (p_rec.business_group_id = hr_api.g_number) then
496 p_rec.business_group_id :=
497 ben_enb_shd.g_old_rec.business_group_id;
498 End If;
499 If (p_rec.enb_attribute_category = hr_api.g_varchar2) then
500 p_rec.enb_attribute_category :=
501 ben_enb_shd.g_old_rec.enb_attribute_category;
502 End If;
503 If (p_rec.enb_attribute1 = hr_api.g_varchar2) then
504 p_rec.enb_attribute1 :=
505 ben_enb_shd.g_old_rec.enb_attribute1;
506 End If;
507 If (p_rec.enb_attribute2 = hr_api.g_varchar2) then
508 p_rec.enb_attribute2 :=
509 ben_enb_shd.g_old_rec.enb_attribute2;
510 End If;
511 If (p_rec.enb_attribute3 = hr_api.g_varchar2) then
512 p_rec.enb_attribute3 :=
513 ben_enb_shd.g_old_rec.enb_attribute3;
514 End If;
515 If (p_rec.enb_attribute4 = hr_api.g_varchar2) then
516 p_rec.enb_attribute4 :=
517 ben_enb_shd.g_old_rec.enb_attribute4;
518 End If;
519 If (p_rec.enb_attribute5 = hr_api.g_varchar2) then
520 p_rec.enb_attribute5 :=
521 ben_enb_shd.g_old_rec.enb_attribute5;
522 End If;
523 If (p_rec.enb_attribute6 = hr_api.g_varchar2) then
524 p_rec.enb_attribute6 :=
525 ben_enb_shd.g_old_rec.enb_attribute6;
526 End If;
527 If (p_rec.enb_attribute7 = hr_api.g_varchar2) then
528 p_rec.enb_attribute7 :=
529 ben_enb_shd.g_old_rec.enb_attribute7;
530 End If;
531 If (p_rec.enb_attribute8 = hr_api.g_varchar2) then
532 p_rec.enb_attribute8 :=
533 ben_enb_shd.g_old_rec.enb_attribute8;
534 End If;
535 If (p_rec.enb_attribute9 = hr_api.g_varchar2) then
536 p_rec.enb_attribute9 :=
537 ben_enb_shd.g_old_rec.enb_attribute9;
538 End If;
539 If (p_rec.enb_attribute10 = hr_api.g_varchar2) then
540 p_rec.enb_attribute10 :=
541 ben_enb_shd.g_old_rec.enb_attribute10;
542 End If;
543 If (p_rec.enb_attribute11 = hr_api.g_varchar2) then
544 p_rec.enb_attribute11 :=
545 ben_enb_shd.g_old_rec.enb_attribute11;
546 End If;
547 If (p_rec.enb_attribute12 = hr_api.g_varchar2) then
548 p_rec.enb_attribute12 :=
549 ben_enb_shd.g_old_rec.enb_attribute12;
550 End If;
551 If (p_rec.enb_attribute13 = hr_api.g_varchar2) then
552 p_rec.enb_attribute13 :=
553 ben_enb_shd.g_old_rec.enb_attribute13;
554 End If;
555 If (p_rec.enb_attribute14 = hr_api.g_varchar2) then
556 p_rec.enb_attribute14 :=
557 ben_enb_shd.g_old_rec.enb_attribute14;
558 End If;
559 If (p_rec.enb_attribute15 = hr_api.g_varchar2) then
560 p_rec.enb_attribute15 :=
561 ben_enb_shd.g_old_rec.enb_attribute15;
562 End If;
563 If (p_rec.enb_attribute16 = hr_api.g_varchar2) then
564 p_rec.enb_attribute16 :=
565 ben_enb_shd.g_old_rec.enb_attribute16;
566 End If;
567 If (p_rec.enb_attribute17 = hr_api.g_varchar2) then
568 p_rec.enb_attribute17 :=
569 ben_enb_shd.g_old_rec.enb_attribute17;
570 End If;
571 If (p_rec.enb_attribute18 = hr_api.g_varchar2) then
572 p_rec.enb_attribute18 :=
573 ben_enb_shd.g_old_rec.enb_attribute18;
574 End If;
575 If (p_rec.enb_attribute19 = hr_api.g_varchar2) then
576 p_rec.enb_attribute19 :=
577 ben_enb_shd.g_old_rec.enb_attribute19;
578 End If;
579 If (p_rec.enb_attribute20 = hr_api.g_varchar2) then
580 p_rec.enb_attribute20 :=
581 ben_enb_shd.g_old_rec.enb_attribute20;
582 End If;
583 If (p_rec.enb_attribute21 = hr_api.g_varchar2) then
584 p_rec.enb_attribute21 :=
585 ben_enb_shd.g_old_rec.enb_attribute21;
586 End If;
587 If (p_rec.enb_attribute22 = hr_api.g_varchar2) then
588 p_rec.enb_attribute22 :=
589 ben_enb_shd.g_old_rec.enb_attribute22;
590 End If;
591 If (p_rec.enb_attribute23 = hr_api.g_varchar2) then
592 p_rec.enb_attribute23 :=
593 ben_enb_shd.g_old_rec.enb_attribute23;
594 End If;
595 If (p_rec.enb_attribute24 = hr_api.g_varchar2) then
596 p_rec.enb_attribute24 :=
597 ben_enb_shd.g_old_rec.enb_attribute24;
598 End If;
599 If (p_rec.enb_attribute25 = hr_api.g_varchar2) then
600 p_rec.enb_attribute25 :=
601 ben_enb_shd.g_old_rec.enb_attribute25;
602 End If;
603 If (p_rec.enb_attribute26 = hr_api.g_varchar2) then
604 p_rec.enb_attribute26 :=
605 ben_enb_shd.g_old_rec.enb_attribute26;
606 End If;
607 If (p_rec.enb_attribute27 = hr_api.g_varchar2) then
608 p_rec.enb_attribute27 :=
609 ben_enb_shd.g_old_rec.enb_attribute27;
610 End If;
611 If (p_rec.enb_attribute28 = hr_api.g_varchar2) then
612 p_rec.enb_attribute28 :=
613 ben_enb_shd.g_old_rec.enb_attribute28;
614 End If;
615 If (p_rec.enb_attribute29 = hr_api.g_varchar2) then
616 p_rec.enb_attribute29 :=
617 ben_enb_shd.g_old_rec.enb_attribute29;
618 End If;
619 If (p_rec.enb_attribute30 = hr_api.g_varchar2) then
620 p_rec.enb_attribute30 :=
621 ben_enb_shd.g_old_rec.enb_attribute30;
622 End If;
623 If (p_rec.request_id = hr_api.g_number) then
624 p_rec.request_id :=
625 ben_enb_shd.g_old_rec.request_id;
626 End If;
627 If (p_rec.program_application_id = hr_api.g_number) then
628 p_rec.program_application_id :=
629 ben_enb_shd.g_old_rec.program_application_id;
630 End If;
631 If (p_rec.program_id = hr_api.g_number) then
632 p_rec.program_id :=
633 ben_enb_shd.g_old_rec.program_id;
634 End If;
635 If (p_rec.program_update_date = hr_api.g_date) then
636 p_rec.program_update_date :=
637 ben_enb_shd.g_old_rec.program_update_date;
638 End If;
639 If (p_rec.bnft_typ_cd = hr_api.g_varchar2) then
640 p_rec.bnft_typ_cd :=
641 ben_enb_shd.g_old_rec.bnft_typ_cd;
642 End If;
643 If (p_rec.prtt_enrt_rslt_id = hr_api.g_number) then
644 p_rec.prtt_enrt_rslt_id :=
645 ben_enb_shd.g_old_rec.prtt_enrt_rslt_id;
646 End If;
647 If (p_rec.ordr_num = hr_api.g_number) then
648 p_rec.ordr_num :=
649 ben_enb_shd.g_old_rec.ordr_num;
650 End If;
651 If (p_rec.crntly_enrld_flag = hr_api.g_varchar2) then
652 p_rec.crntly_enrld_flag :=
653 ben_enb_shd.g_old_rec.crntly_enrld_flag;
654 End If;
655 If (p_rec.ctfn_rqd_flag = hr_api.g_varchar2) then
656 p_rec.ctfn_rqd_flag :=
657 ben_enb_shd.g_old_rec.ctfn_rqd_flag;
658 End If;
659 --
660 If (p_rec.mx_wout_ctfn_val = hr_api.g_number) then
661 p_rec.mx_wout_ctfn_val :=
662 ben_enb_shd.g_old_rec.mx_wout_ctfn_val;
663 End If;
664 If (p_rec.mx_wo_ctfn_flag = hr_api.g_varchar2) then
665 p_rec.mx_wo_ctfn_flag :=
666 ben_enb_shd.g_old_rec.mx_wo_ctfn_flag;
667 End If;
668 hr_utility.set_location(' Leaving:'||l_proc, 10);
669 --
670 End convert_defs;
671 --
672 -- ----------------------------------------------------------------------------
673 -- |---------------------------------< upd >----------------------------------|
674 -- ----------------------------------------------------------------------------
675 Procedure upd
676 (
677 p_effective_date in date,
678 p_rec in out nocopy ben_enb_shd.g_rec_type
679 ) is
680 --
681 l_proc varchar2(72) := g_package||'upd';
682 --
683 Begin
684 hr_utility.set_location('Entering:'||l_proc, 5);
685 --
686 -- We must lock the row which we need to update.
687 --
688 ben_enb_shd.lck
689 (
690 p_rec.enrt_bnft_id,
691 p_rec.object_version_number
692 );
693 --
694 -- 1. During an update system defaults are used to determine if
695 -- arguments have been defaulted or not. We must therefore
696 -- derive the full record structure values to be updated.
697 --
698 -- 2. Call the supporting update validate operations.
699 --
700 convert_defs(p_rec);
701 ben_enb_bus.update_validate
702 (p_rec
703 ,p_effective_date
704 );
705 --
706 -- Call the supporting pre-update operation
707 --
708 pre_update(p_rec);
709 --
710 -- Update the row.
711 --
712 update_dml(p_rec);
713 --
714 -- Call the supporting post-update operation
715 --
716 post_update(p_effective_date,p_rec);
717 --
718 End upd;
719 --
720 -- ----------------------------------------------------------------------------
721 -- |---------------------------------< upd >----------------------------------|
722 -- ----------------------------------------------------------------------------
723 Procedure upd
724 (
725 p_effective_date in date
726 ,p_enrt_bnft_id in number
727 ,p_dflt_flag in varchar2 default hr_api.g_varchar2
728 ,p_val_has_bn_prortd_flag in varchar2 default hr_api.g_varchar2
729 ,p_bndry_perd_cd in varchar2 default hr_api.g_varchar2
730 ,p_val in number default hr_api.g_number
731 ,p_nnmntry_uom in varchar2 default hr_api.g_varchar2
732 ,p_bnft_typ_cd in varchar2 default hr_api.g_varchar2
733 ,p_entr_val_at_enrt_flag in varchar2 default hr_api.g_varchar2
734 ,p_mn_val in number default hr_api.g_number
735 ,p_mx_val in number default hr_api.g_number
736 ,p_incrmt_val in number default hr_api.g_number
737 ,p_dflt_val in number default hr_api.g_number
738 ,p_rt_typ_cd in varchar2 default hr_api.g_varchar2
739 ,p_cvg_mlt_cd in varchar2 default hr_api.g_varchar2
740 ,p_ctfn_rqd_flag in varchar2 default hr_api.g_varchar2
741 ,p_ordr_num in number default hr_api.g_number
742 ,p_crntly_enrld_flag in varchar2 default hr_api.g_varchar2
743 ,p_elig_per_elctbl_chc_id in number default hr_api.g_number
744 ,p_prtt_enrt_rslt_id in number default hr_api.g_number
745 ,p_comp_lvl_fctr_id in number default hr_api.g_number
746 ,p_business_group_id in number default hr_api.g_number
747 ,p_enb_attribute_category in varchar2 default hr_api.g_varchar2
748 ,p_enb_attribute1 in varchar2 default hr_api.g_varchar2
749 ,p_enb_attribute2 in varchar2 default hr_api.g_varchar2
750 ,p_enb_attribute3 in varchar2 default hr_api.g_varchar2
751 ,p_enb_attribute4 in varchar2 default hr_api.g_varchar2
752 ,p_enb_attribute5 in varchar2 default hr_api.g_varchar2
753 ,p_enb_attribute6 in varchar2 default hr_api.g_varchar2
754 ,p_enb_attribute7 in varchar2 default hr_api.g_varchar2
755 ,p_enb_attribute8 in varchar2 default hr_api.g_varchar2
756 ,p_enb_attribute9 in varchar2 default hr_api.g_varchar2
757 ,p_enb_attribute10 in varchar2 default hr_api.g_varchar2
758 ,p_enb_attribute11 in varchar2 default hr_api.g_varchar2
759 ,p_enb_attribute12 in varchar2 default hr_api.g_varchar2
760 ,p_enb_attribute13 in varchar2 default hr_api.g_varchar2
761 ,p_enb_attribute14 in varchar2 default hr_api.g_varchar2
762 ,p_enb_attribute15 in varchar2 default hr_api.g_varchar2
763 ,p_enb_attribute16 in varchar2 default hr_api.g_varchar2
764 ,p_enb_attribute17 in varchar2 default hr_api.g_varchar2
765 ,p_enb_attribute18 in varchar2 default hr_api.g_varchar2
766 ,p_enb_attribute19 in varchar2 default hr_api.g_varchar2
767 ,p_enb_attribute20 in varchar2 default hr_api.g_varchar2
768 ,p_enb_attribute21 in varchar2 default hr_api.g_varchar2
769 ,p_enb_attribute22 in varchar2 default hr_api.g_varchar2
770 ,p_enb_attribute23 in varchar2 default hr_api.g_varchar2
771 ,p_enb_attribute24 in varchar2 default hr_api.g_varchar2
772 ,p_enb_attribute25 in varchar2 default hr_api.g_varchar2
773 ,p_enb_attribute26 in varchar2 default hr_api.g_varchar2
774 ,p_enb_attribute27 in varchar2 default hr_api.g_varchar2
775 ,p_enb_attribute28 in varchar2 default hr_api.g_varchar2
776 ,p_enb_attribute29 in varchar2 default hr_api.g_varchar2
777 ,p_enb_attribute30 in varchar2 default hr_api.g_varchar2
778 ,p_request_id in number default hr_api.g_number
779 ,p_program_application_id in number default hr_api.g_number
780 ,p_program_id in number default hr_api.g_number
781 ,p_mx_wout_ctfn_val in number default hr_api.g_number
782 ,p_mx_wo_ctfn_flag in varchar2 default hr_api.g_varchar2
783 ,p_program_update_date in date default hr_api.g_date
784 ,p_object_version_number in out nocopy number
785 ) is
786 --
787 l_rec ben_enb_shd.g_rec_type;
788 l_proc varchar2(72) := g_package||'upd';
789 --
790 Begin
791 hr_utility.set_location('Entering:'||l_proc, 5);
792 --
793 -- Call conversion function to turn arguments into the
794 -- l_rec structure.
795 --
796 l_rec :=
797 ben_enb_shd.convert_args
798 (
799 p_enrt_bnft_id
800 ,p_dflt_flag
801 ,p_val_has_bn_prortd_flag
802 ,p_bndry_perd_cd
803 ,p_val
804 ,p_nnmntry_uom
805 ,p_bnft_typ_cd
806 ,p_entr_val_at_enrt_flag
807 ,p_mn_val
808 ,p_mx_val
809 ,p_incrmt_val
810 ,p_dflt_val
811 ,p_rt_typ_cd
812 ,p_cvg_mlt_cd
813 ,p_ctfn_rqd_flag
814 ,p_ordr_num
815 ,p_crntly_enrld_flag
816 ,p_elig_per_elctbl_chc_id
817 ,p_prtt_enrt_rslt_id
818 ,p_comp_lvl_fctr_id
819 ,p_business_group_id
820 ,p_enb_attribute_category
821 ,p_enb_attribute1
822 ,p_enb_attribute2
823 ,p_enb_attribute3
824 ,p_enb_attribute4
825 ,p_enb_attribute5
826 ,p_enb_attribute6
827 ,p_enb_attribute7
828 ,p_enb_attribute8
829 ,p_enb_attribute9
830 ,p_enb_attribute10
831 ,p_enb_attribute11
832 ,p_enb_attribute12
833 ,p_enb_attribute13
834 ,p_enb_attribute14
835 ,p_enb_attribute15
836 ,p_enb_attribute16
837 ,p_enb_attribute17
838 ,p_enb_attribute18
839 ,p_enb_attribute19
840 ,p_enb_attribute20
841 ,p_enb_attribute21
842 ,p_enb_attribute22
843 ,p_enb_attribute23
844 ,p_enb_attribute24
845 ,p_enb_attribute25
846 ,p_enb_attribute26
847 ,p_enb_attribute27
848 ,p_enb_attribute28
849 ,p_enb_attribute29
850 ,p_enb_attribute30
851 ,p_request_id
852 ,p_program_application_id
853 ,p_program_id
854 ,p_mx_wout_ctfn_val
855 ,p_mx_wo_ctfn_flag
856 ,p_program_update_date
857 ,p_object_version_number
858 );
859 --
860 -- Having converted the arguments into the
861 -- plsql record structure we call the corresponding record
862 -- business process.
863 --
864 upd(p_effective_date,l_rec);
865
866 p_object_version_number := l_rec.object_version_number;
867 --
868 hr_utility.set_location(' Leaving:'||l_proc, 10);
869 End upd;
870 --
871 end ben_enb_upd;