DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_ECC_UPD

Source


1 Package Body ben_ecc_upd as
2 /* $Header: beeccrhi.pkb 120.0 2005/05/28 01:49:03 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ben_ecc_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_ecc_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_ecc_shd.g_api_dml := true;  -- Set the api dml status
66   --
67   -- Update the ben_elctbl_chc_ctfn Row
68   --
69   update ben_elctbl_chc_ctfn
70   set
71   elctbl_chc_ctfn_id                = p_rec.elctbl_chc_ctfn_id,
72   enrt_ctfn_typ_cd                  = p_rec.enrt_ctfn_typ_cd,
73   rqd_flag                          = p_rec.rqd_flag,
74   elig_per_elctbl_chc_id            = p_rec.elig_per_elctbl_chc_id,
75   enrt_bnft_id                      = p_rec.enrt_bnft_id,
76   business_group_id                 = p_rec.business_group_id,
77   ecc_attribute_category            = p_rec.ecc_attribute_category,
78   ecc_attribute1                    = p_rec.ecc_attribute1,
79   ecc_attribute2                    = p_rec.ecc_attribute2,
80   ecc_attribute3                    = p_rec.ecc_attribute3,
81   ecc_attribute4                    = p_rec.ecc_attribute4,
82   ecc_attribute5                    = p_rec.ecc_attribute5,
83   ecc_attribute6                    = p_rec.ecc_attribute6,
84   ecc_attribute7                    = p_rec.ecc_attribute7,
85   ecc_attribute8                    = p_rec.ecc_attribute8,
86   ecc_attribute9                    = p_rec.ecc_attribute9,
87   ecc_attribute10                   = p_rec.ecc_attribute10,
88   ecc_attribute11                   = p_rec.ecc_attribute11,
89   ecc_attribute12                   = p_rec.ecc_attribute12,
90   ecc_attribute13                   = p_rec.ecc_attribute13,
91   ecc_attribute14                   = p_rec.ecc_attribute14,
92   ecc_attribute15                   = p_rec.ecc_attribute15,
93   ecc_attribute16                   = p_rec.ecc_attribute16,
94   ecc_attribute17                   = p_rec.ecc_attribute17,
95   ecc_attribute18                   = p_rec.ecc_attribute18,
96   ecc_attribute19                   = p_rec.ecc_attribute19,
97   ecc_attribute20                   = p_rec.ecc_attribute20,
98   ecc_attribute21                   = p_rec.ecc_attribute21,
99   ecc_attribute22                   = p_rec.ecc_attribute22,
100   ecc_attribute23                   = p_rec.ecc_attribute23,
101   ecc_attribute24                   = p_rec.ecc_attribute24,
102   ecc_attribute25                   = p_rec.ecc_attribute25,
103   ecc_attribute26                   = p_rec.ecc_attribute26,
104   ecc_attribute27                   = p_rec.ecc_attribute27,
105   ecc_attribute28                   = p_rec.ecc_attribute28,
106   ecc_attribute29                   = p_rec.ecc_attribute29,
107   ecc_attribute30                   = p_rec.ecc_attribute30,
108   susp_if_ctfn_not_prvd_flag        = p_rec.susp_if_ctfn_not_prvd_flag,
109   ctfn_determine_cd                 = p_rec.ctfn_determine_cd,
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   object_version_number             = p_rec.object_version_number
115   where elctbl_chc_ctfn_id = p_rec.elctbl_chc_ctfn_id;
116   --
117   ben_ecc_shd.g_api_dml := false;   -- Unset the api dml status
118   --
119   hr_utility.set_location(' Leaving:'||l_proc, 10);
120 --
121 Exception
122   When hr_api.check_integrity_violated Then
123     -- A check constraint has been violated
124     ben_ecc_shd.g_api_dml := false;   -- Unset the api dml status
125     ben_ecc_shd.constraint_error
126       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
127   When hr_api.parent_integrity_violated Then
128     -- Parent integrity has been violated
129     ben_ecc_shd.g_api_dml := false;   -- Unset the api dml status
130     ben_ecc_shd.constraint_error
131       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
132   When hr_api.unique_integrity_violated Then
133     -- Unique integrity has been violated
134     ben_ecc_shd.g_api_dml := false;   -- Unset the api dml status
135     ben_ecc_shd.constraint_error
136       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
137   When Others Then
138     ben_ecc_shd.g_api_dml := false;   -- Unset the api dml status
139     Raise;
140 End update_dml;
141 --
142 -- ----------------------------------------------------------------------------
143 -- |------------------------------< pre_update >------------------------------|
144 -- ----------------------------------------------------------------------------
145 -- {Start Of Comments}
146 --
147 -- Description:
148 --   This private procedure contains any processing which is required before
149 --   the update dml.
150 --
151 -- Prerequisites:
152 --   This is an internal procedure which is called from the upd procedure.
153 --
154 -- In Parameters:
155 --   A Pl/Sql record structre.
156 --
157 -- Post Success:
158 --   Processing continues.
159 --
160 -- Post Failure:
161 --   If an error has occurred, an error message and exception will be raised
162 --   but not handled.
163 --
164 -- Developer Implementation Notes:
165 --   Any pre-processing required before the update dml is issued should be
166 --   coded within this procedure. It is important to note that any 3rd party
167 --   maintenance should be reviewed before placing in this procedure.
168 --
169 -- Access Status:
170 --   Internal Row Handler Use Only.
171 --
172 -- {End Of Comments}
173 -- ----------------------------------------------------------------------------
174 Procedure pre_update(p_rec in ben_ecc_shd.g_rec_type) is
175 --
176   l_proc  varchar2(72) := g_package||'pre_update';
177 --
178 Begin
179   hr_utility.set_location('Entering:'||l_proc, 5);
180   --
181   hr_utility.set_location(' Leaving:'||l_proc, 10);
182 End pre_update;
183 --
184 -- ----------------------------------------------------------------------------
185 -- |-----------------------------< post_update >------------------------------|
186 -- ----------------------------------------------------------------------------
187 -- {Start Of Comments}
188 --
189 -- Description:
190 --   This private procedure contains any processing which is required after the
191 --   update dml.
192 --
193 -- Prerequisites:
194 --   This is an internal procedure which is called from the upd procedure.
195 --
196 -- In Parameters:
197 --   A Pl/Sql record structre.
198 --
199 -- Post Success:
200 --   Processing continues.
201 --
202 -- Post Failure:
203 --   If an error has occurred, an error message and exception will be raised
204 --   but not handled.
205 --
206 -- Developer Implementation Notes:
207 --   Any post-processing required after the update dml is issued should be
208 --   coded within this procedure. It is important to note that any 3rd party
209 --   maintenance should be reviewed before placing in this procedure.
210 --
211 -- Access Status:
212 --   Internal Row Handler Use Only.
213 --
214 -- {End Of Comments}
215 -- ----------------------------------------------------------------------------
216 Procedure post_update(
217 p_effective_date in date,p_rec in ben_ecc_shd.g_rec_type) is
218 --
219   l_proc  varchar2(72) := g_package||'post_update';
220 --
221 Begin
222   hr_utility.set_location('Entering:'||l_proc, 5);
223 --
224   --
225   -- Start of API User Hook for post_update.
226   --
227   begin
228     --
229     ben_ecc_rku.after_update
230       (
231   p_elctbl_chc_ctfn_id            =>p_rec.elctbl_chc_ctfn_id
232  ,p_enrt_ctfn_typ_cd              =>p_rec.enrt_ctfn_typ_cd
233  ,p_rqd_flag                      =>p_rec.rqd_flag
234  ,p_elig_per_elctbl_chc_id        =>p_rec.elig_per_elctbl_chc_id
235  ,p_enrt_bnft_id                  =>p_rec.enrt_bnft_id
236  ,p_business_group_id             =>p_rec.business_group_id
237  ,p_ecc_attribute_category        =>p_rec.ecc_attribute_category
238  ,p_ecc_attribute1                =>p_rec.ecc_attribute1
239  ,p_ecc_attribute2                =>p_rec.ecc_attribute2
240  ,p_ecc_attribute3                =>p_rec.ecc_attribute3
241  ,p_ecc_attribute4                =>p_rec.ecc_attribute4
242  ,p_ecc_attribute5                =>p_rec.ecc_attribute5
243  ,p_ecc_attribute6                =>p_rec.ecc_attribute6
244  ,p_ecc_attribute7                =>p_rec.ecc_attribute7
245  ,p_ecc_attribute8                =>p_rec.ecc_attribute8
246  ,p_ecc_attribute9                =>p_rec.ecc_attribute9
247  ,p_ecc_attribute10               =>p_rec.ecc_attribute10
248  ,p_ecc_attribute11               =>p_rec.ecc_attribute11
249  ,p_ecc_attribute12               =>p_rec.ecc_attribute12
250  ,p_ecc_attribute13               =>p_rec.ecc_attribute13
251  ,p_ecc_attribute14               =>p_rec.ecc_attribute14
252  ,p_ecc_attribute15               =>p_rec.ecc_attribute15
253  ,p_ecc_attribute16               =>p_rec.ecc_attribute16
254  ,p_ecc_attribute17               =>p_rec.ecc_attribute17
255  ,p_ecc_attribute18               =>p_rec.ecc_attribute18
256  ,p_ecc_attribute19               =>p_rec.ecc_attribute19
257  ,p_ecc_attribute20               =>p_rec.ecc_attribute20
258  ,p_ecc_attribute21               =>p_rec.ecc_attribute21
259  ,p_ecc_attribute22               =>p_rec.ecc_attribute22
260  ,p_ecc_attribute23               =>p_rec.ecc_attribute23
261  ,p_ecc_attribute24               =>p_rec.ecc_attribute24
262  ,p_ecc_attribute25               =>p_rec.ecc_attribute25
263  ,p_ecc_attribute26               =>p_rec.ecc_attribute26
264  ,p_ecc_attribute27               =>p_rec.ecc_attribute27
265  ,p_ecc_attribute28               =>p_rec.ecc_attribute28
266  ,p_ecc_attribute29               =>p_rec.ecc_attribute29
267  ,p_ecc_attribute30               =>p_rec.ecc_attribute30
268  ,p_susp_if_ctfn_not_prvd_flag    =>p_rec.susp_if_ctfn_not_prvd_flag
269  ,p_ctfn_determine_cd             =>p_rec.ctfn_determine_cd
270  ,p_request_id                    =>p_rec.request_id
271  ,p_program_application_id        =>p_rec.program_application_id
272  ,p_program_id                    =>p_rec.program_id
273  ,p_program_update_date           =>p_rec.program_update_date
274  ,p_object_version_number         =>p_rec.object_version_number
275  ,p_effective_date                =>p_effective_date
276  ,p_enrt_ctfn_typ_cd_o            =>ben_ecc_shd.g_old_rec.enrt_ctfn_typ_cd
277  ,p_rqd_flag_o                    =>ben_ecc_shd.g_old_rec.rqd_flag
278  ,p_elig_per_elctbl_chc_id_o      =>ben_ecc_shd.g_old_rec.elig_per_elctbl_chc_id
279  ,p_enrt_bnft_id_o                =>ben_ecc_shd.g_old_rec.enrt_bnft_id
280  ,p_business_group_id_o           =>ben_ecc_shd.g_old_rec.business_group_id
281  ,p_ecc_attribute_category_o      =>ben_ecc_shd.g_old_rec.ecc_attribute_category
282  ,p_ecc_attribute1_o              =>ben_ecc_shd.g_old_rec.ecc_attribute1
283  ,p_ecc_attribute2_o              =>ben_ecc_shd.g_old_rec.ecc_attribute2
284  ,p_ecc_attribute3_o              =>ben_ecc_shd.g_old_rec.ecc_attribute3
285  ,p_ecc_attribute4_o              =>ben_ecc_shd.g_old_rec.ecc_attribute4
286  ,p_ecc_attribute5_o              =>ben_ecc_shd.g_old_rec.ecc_attribute5
287  ,p_ecc_attribute6_o              =>ben_ecc_shd.g_old_rec.ecc_attribute6
288  ,p_ecc_attribute7_o              =>ben_ecc_shd.g_old_rec.ecc_attribute7
289  ,p_ecc_attribute8_o              =>ben_ecc_shd.g_old_rec.ecc_attribute8
290  ,p_ecc_attribute9_o              =>ben_ecc_shd.g_old_rec.ecc_attribute9
291  ,p_ecc_attribute10_o             =>ben_ecc_shd.g_old_rec.ecc_attribute10
292  ,p_ecc_attribute11_o             =>ben_ecc_shd.g_old_rec.ecc_attribute11
293  ,p_ecc_attribute12_o             =>ben_ecc_shd.g_old_rec.ecc_attribute12
294  ,p_ecc_attribute13_o             =>ben_ecc_shd.g_old_rec.ecc_attribute13
295  ,p_ecc_attribute14_o             =>ben_ecc_shd.g_old_rec.ecc_attribute14
296  ,p_ecc_attribute15_o             =>ben_ecc_shd.g_old_rec.ecc_attribute15
297  ,p_ecc_attribute16_o             =>ben_ecc_shd.g_old_rec.ecc_attribute16
298  ,p_ecc_attribute17_o             =>ben_ecc_shd.g_old_rec.ecc_attribute17
299  ,p_ecc_attribute18_o             =>ben_ecc_shd.g_old_rec.ecc_attribute18
300  ,p_ecc_attribute19_o             =>ben_ecc_shd.g_old_rec.ecc_attribute19
301  ,p_ecc_attribute20_o             =>ben_ecc_shd.g_old_rec.ecc_attribute20
302  ,p_ecc_attribute21_o             =>ben_ecc_shd.g_old_rec.ecc_attribute21
303  ,p_ecc_attribute22_o             =>ben_ecc_shd.g_old_rec.ecc_attribute22
304  ,p_ecc_attribute23_o             =>ben_ecc_shd.g_old_rec.ecc_attribute23
305  ,p_ecc_attribute24_o             =>ben_ecc_shd.g_old_rec.ecc_attribute24
306  ,p_ecc_attribute25_o             =>ben_ecc_shd.g_old_rec.ecc_attribute25
307  ,p_ecc_attribute26_o             =>ben_ecc_shd.g_old_rec.ecc_attribute26
308  ,p_ecc_attribute27_o             =>ben_ecc_shd.g_old_rec.ecc_attribute27
309  ,p_ecc_attribute28_o             =>ben_ecc_shd.g_old_rec.ecc_attribute28
310  ,p_ecc_attribute29_o             =>ben_ecc_shd.g_old_rec.ecc_attribute29
311  ,p_ecc_attribute30_o             =>ben_ecc_shd.g_old_rec.ecc_attribute30
312  ,p_susp_if_ctfn_not_prvd_flag_o  =>ben_ecc_shd.g_old_rec.susp_if_ctfn_not_prvd_flag
313  ,p_ctfn_determine_cd_o           =>ben_ecc_shd.g_old_rec.ctfn_determine_cd
314  ,p_request_id_o                  =>ben_ecc_shd.g_old_rec.request_id
315  ,p_program_application_id_o      =>ben_ecc_shd.g_old_rec.program_application_id
316  ,p_program_id_o                  =>ben_ecc_shd.g_old_rec.program_id
317  ,p_program_update_date_o         =>ben_ecc_shd.g_old_rec.program_update_date
318  ,p_object_version_number_o       =>ben_ecc_shd.g_old_rec.object_version_number
319       );
320     --
321   exception
322     --
323     when hr_api.cannot_find_prog_unit then
324       --
325       hr_api.cannot_find_prog_unit_error
326         (p_module_name => 'ben_elctbl_chc_ctfn'
327         ,p_hook_type   => 'AU');
328       --
329   end;
330   --
331   -- End of API User Hook for post_update.
332   --
333   --
334   hr_utility.set_location(' Leaving:'||l_proc, 10);
335 End post_update;
336 --
337 -- ----------------------------------------------------------------------------
338 -- |-----------------------------< convert_defs >-----------------------------|
339 -- ----------------------------------------------------------------------------
340 -- {Start Of Comments}
341 --
342 -- Description:
343 --   The Convert_Defs procedure has one very important function:
344 --   It must return the record structure for the row with all system defaulted
345 --   values converted into its corresponding parameter value for update. When
346 --   we attempt to update a row through the Upd process , certain
347 --   parameters can be defaulted which enables flexibility in the calling of
348 --   the upd process (e.g. only attributes which need to be updated need to be
349 --   specified). For the upd process to determine which attributes
350 --   have NOT been specified we need to check if the parameter has a reserved
351 --   system default value. Therefore, for all parameters which have a
352 --   corresponding reserved system default mechanism specified we need to
353 --   check if a system default is being used. If a system default is being
354 --   used then we convert the defaulted value into its corresponding attribute
355 --   value held in the g_old_rec data structure.
356 --
357 -- Prerequisites:
358 --   This private function can only be called from the upd process.
359 --
360 -- In Parameters:
361 --   A Pl/Sql record structre.
362 --
363 -- Post Success:
364 --   The record structure will be returned with all system defaulted parameter
365 --   values converted into its current row attribute value.
366 --
367 -- Post Failure:
368 --   No direct error handling is required within this function. Any possible
369 --   errors within this procedure will be a PL/SQL value error due to conversion
370 --   of datatypes or data lengths.
371 --
372 -- Developer Implementation Notes:
373 --   None.
374 --
375 -- Access Status:
376 --   Internal Row Handler Use Only.
377 --
378 -- {End Of Comments}
379 -- ----------------------------------------------------------------------------
380 Procedure convert_defs(p_rec in out nocopy ben_ecc_shd.g_rec_type) is
381 --
382   l_proc  varchar2(72) := g_package||'convert_defs';
383 --
384 Begin
385   --
386   hr_utility.set_location('Entering:'||l_proc, 5);
387   --
388   -- We must now examine each argument value in the
389   -- p_rec plsql record structure
390   -- to see if a system default is being used. If a system default
391   -- is being used then we must set to the 'current' argument value.
392   --
393   If (p_rec.enrt_ctfn_typ_cd = hr_api.g_varchar2) then
394     p_rec.enrt_ctfn_typ_cd :=
395     ben_ecc_shd.g_old_rec.enrt_ctfn_typ_cd;
396   End If;
397   If (p_rec.rqd_flag = hr_api.g_varchar2) then
398     p_rec.rqd_flag :=
399     ben_ecc_shd.g_old_rec.rqd_flag;
400   End If;
401   If (p_rec.elig_per_elctbl_chc_id = hr_api.g_number) then
402     p_rec.elig_per_elctbl_chc_id :=
403     ben_ecc_shd.g_old_rec.elig_per_elctbl_chc_id;
404   End If;
405   If (p_rec.enrt_bnft_id = hr_api.g_number) then
406     p_rec.enrt_bnft_id :=
407     ben_ecc_shd.g_old_rec.enrt_bnft_id;
408   End If;
409   If (p_rec.business_group_id = hr_api.g_number) then
410     p_rec.business_group_id :=
411     ben_ecc_shd.g_old_rec.business_group_id;
412   End If;
413   If (p_rec.ecc_attribute_category = hr_api.g_varchar2) then
414     p_rec.ecc_attribute_category :=
415     ben_ecc_shd.g_old_rec.ecc_attribute_category;
416   End If;
417   If (p_rec.ecc_attribute1 = hr_api.g_varchar2) then
418     p_rec.ecc_attribute1 :=
419     ben_ecc_shd.g_old_rec.ecc_attribute1;
420   End If;
421   If (p_rec.ecc_attribute2 = hr_api.g_varchar2) then
422     p_rec.ecc_attribute2 :=
423     ben_ecc_shd.g_old_rec.ecc_attribute2;
424   End If;
425   If (p_rec.ecc_attribute3 = hr_api.g_varchar2) then
426     p_rec.ecc_attribute3 :=
427     ben_ecc_shd.g_old_rec.ecc_attribute3;
428   End If;
429   If (p_rec.ecc_attribute4 = hr_api.g_varchar2) then
430     p_rec.ecc_attribute4 :=
431     ben_ecc_shd.g_old_rec.ecc_attribute4;
432   End If;
433   If (p_rec.ecc_attribute5 = hr_api.g_varchar2) then
434     p_rec.ecc_attribute5 :=
435     ben_ecc_shd.g_old_rec.ecc_attribute5;
436   End If;
437   If (p_rec.ecc_attribute6 = hr_api.g_varchar2) then
438     p_rec.ecc_attribute6 :=
439     ben_ecc_shd.g_old_rec.ecc_attribute6;
440   End If;
441   If (p_rec.ecc_attribute7 = hr_api.g_varchar2) then
442     p_rec.ecc_attribute7 :=
443     ben_ecc_shd.g_old_rec.ecc_attribute7;
444   End If;
445   If (p_rec.ecc_attribute8 = hr_api.g_varchar2) then
446     p_rec.ecc_attribute8 :=
447     ben_ecc_shd.g_old_rec.ecc_attribute8;
448   End If;
449   If (p_rec.ecc_attribute9 = hr_api.g_varchar2) then
450     p_rec.ecc_attribute9 :=
451     ben_ecc_shd.g_old_rec.ecc_attribute9;
452   End If;
453   If (p_rec.ecc_attribute10 = hr_api.g_varchar2) then
454     p_rec.ecc_attribute10 :=
455     ben_ecc_shd.g_old_rec.ecc_attribute10;
456   End If;
457   If (p_rec.ecc_attribute11 = hr_api.g_varchar2) then
458     p_rec.ecc_attribute11 :=
459     ben_ecc_shd.g_old_rec.ecc_attribute11;
460   End If;
461   If (p_rec.ecc_attribute12 = hr_api.g_varchar2) then
462     p_rec.ecc_attribute12 :=
463     ben_ecc_shd.g_old_rec.ecc_attribute12;
464   End If;
465   If (p_rec.ecc_attribute13 = hr_api.g_varchar2) then
466     p_rec.ecc_attribute13 :=
467     ben_ecc_shd.g_old_rec.ecc_attribute13;
468   End If;
469   If (p_rec.ecc_attribute14 = hr_api.g_varchar2) then
470     p_rec.ecc_attribute14 :=
471     ben_ecc_shd.g_old_rec.ecc_attribute14;
472   End If;
473   If (p_rec.ecc_attribute15 = hr_api.g_varchar2) then
474     p_rec.ecc_attribute15 :=
475     ben_ecc_shd.g_old_rec.ecc_attribute15;
476   End If;
477   If (p_rec.ecc_attribute16 = hr_api.g_varchar2) then
478     p_rec.ecc_attribute16 :=
479     ben_ecc_shd.g_old_rec.ecc_attribute16;
480   End If;
481   If (p_rec.ecc_attribute17 = hr_api.g_varchar2) then
482     p_rec.ecc_attribute17 :=
483     ben_ecc_shd.g_old_rec.ecc_attribute17;
484   End If;
485   If (p_rec.ecc_attribute18 = hr_api.g_varchar2) then
486     p_rec.ecc_attribute18 :=
487     ben_ecc_shd.g_old_rec.ecc_attribute18;
488   End If;
489   If (p_rec.ecc_attribute19 = hr_api.g_varchar2) then
490     p_rec.ecc_attribute19 :=
491     ben_ecc_shd.g_old_rec.ecc_attribute19;
492   End If;
493   If (p_rec.ecc_attribute20 = hr_api.g_varchar2) then
494     p_rec.ecc_attribute20 :=
495     ben_ecc_shd.g_old_rec.ecc_attribute20;
496   End If;
497   If (p_rec.ecc_attribute21 = hr_api.g_varchar2) then
498     p_rec.ecc_attribute21 :=
499     ben_ecc_shd.g_old_rec.ecc_attribute21;
500   End If;
501   If (p_rec.ecc_attribute22 = hr_api.g_varchar2) then
502     p_rec.ecc_attribute22 :=
503     ben_ecc_shd.g_old_rec.ecc_attribute22;
504   End If;
505   If (p_rec.ecc_attribute23 = hr_api.g_varchar2) then
506     p_rec.ecc_attribute23 :=
507     ben_ecc_shd.g_old_rec.ecc_attribute23;
508   End If;
509   If (p_rec.ecc_attribute24 = hr_api.g_varchar2) then
510     p_rec.ecc_attribute24 :=
511     ben_ecc_shd.g_old_rec.ecc_attribute24;
512   End If;
513   If (p_rec.ecc_attribute25 = hr_api.g_varchar2) then
514     p_rec.ecc_attribute25 :=
515     ben_ecc_shd.g_old_rec.ecc_attribute25;
516   End If;
517   If (p_rec.ecc_attribute26 = hr_api.g_varchar2) then
518     p_rec.ecc_attribute26 :=
519     ben_ecc_shd.g_old_rec.ecc_attribute26;
520   End If;
521   If (p_rec.ecc_attribute27 = hr_api.g_varchar2) then
522     p_rec.ecc_attribute27 :=
523     ben_ecc_shd.g_old_rec.ecc_attribute27;
524   End If;
525   If (p_rec.ecc_attribute28 = hr_api.g_varchar2) then
526     p_rec.ecc_attribute28 :=
527     ben_ecc_shd.g_old_rec.ecc_attribute28;
528   End If;
529   If (p_rec.ecc_attribute29 = hr_api.g_varchar2) then
530     p_rec.ecc_attribute29 :=
531     ben_ecc_shd.g_old_rec.ecc_attribute29;
532   End If;
533   If (p_rec.ecc_attribute30 = hr_api.g_varchar2) then
534     p_rec.ecc_attribute30 :=
535     ben_ecc_shd.g_old_rec.ecc_attribute30;
536   End If;
537   If (p_rec.susp_if_ctfn_not_prvd_flag = hr_api.g_varchar2) then
538     p_rec.susp_if_ctfn_not_prvd_flag :=
539     ben_ecc_shd.g_old_rec.susp_if_ctfn_not_prvd_flag;
540   End If;
541   If (p_rec.ctfn_determine_cd = hr_api.g_varchar2) then
542     p_rec.ctfn_determine_cd :=
543     ben_ecc_shd.g_old_rec.ctfn_determine_cd;
544   End If;
545   If (p_rec.request_id = hr_api.g_number) then
546     p_rec.request_id :=
547     ben_ecc_shd.g_old_rec.request_id;
548   End If;
549   If (p_rec.program_application_id = hr_api.g_number) then
550     p_rec.program_application_id :=
551     ben_ecc_shd.g_old_rec.program_application_id;
552   End If;
553   If (p_rec.program_id = hr_api.g_number) then
554     p_rec.program_id :=
555     ben_ecc_shd.g_old_rec.program_id;
556   End If;
557   If (p_rec.program_update_date = hr_api.g_date) then
558     p_rec.program_update_date :=
559     ben_ecc_shd.g_old_rec.program_update_date;
560   End If;
561 
562   --
563   hr_utility.set_location(' Leaving:'||l_proc, 10);
564 --
565 End convert_defs;
566 --
567 -- ----------------------------------------------------------------------------
568 -- |---------------------------------< upd >----------------------------------|
569 -- ----------------------------------------------------------------------------
570 Procedure upd
571   (
572   p_effective_date in date,
573   p_rec        in out nocopy ben_ecc_shd.g_rec_type
574   ) is
575 --
576   l_proc  varchar2(72) := g_package||'upd';
577 --
578 Begin
579   hr_utility.set_location('Entering:'||l_proc, 5);
580   --
581   -- We must lock the row which we need to update.
582   --
583   ben_ecc_shd.lck
584 	(
585 	p_rec.elctbl_chc_ctfn_id,
586 	p_rec.object_version_number
587 	);
588   --
589   -- 1. During an update system defaults are used to determine if
590   --    arguments have been defaulted or not. We must therefore
591   --    derive the full record structure values to be updated.
592   --
593   -- 2. Call the supporting update validate operations.
594   --
595   convert_defs(p_rec);
596   ben_ecc_bus.update_validate(p_rec
597   ,p_effective_date);
598   --
599   -- Call the supporting pre-update operation
600   --
601   pre_update(p_rec);
602   --
603   -- Update the row.
604   --
605   update_dml(p_rec);
606   --
607   -- Call the supporting post-update operation
608   --
609   post_update(
610 p_effective_date,p_rec);
611 End upd;
612 --
613 -- ----------------------------------------------------------------------------
614 -- |---------------------------------< upd >----------------------------------|
615 -- ----------------------------------------------------------------------------
616 Procedure upd
617   (
618   p_effective_date in date,
619   p_elctbl_chc_ctfn_id           in number,
620   p_enrt_ctfn_typ_cd             in varchar2         default hr_api.g_varchar2,
621   p_rqd_flag                     in varchar2         default hr_api.g_varchar2,
622   p_elig_per_elctbl_chc_id       in number           default hr_api.g_number,
623   p_enrt_bnft_id                 in number           default hr_api.g_number,
624   p_business_group_id            in number           default hr_api.g_number,
625   p_ecc_attribute_category       in varchar2         default hr_api.g_varchar2,
626   p_ecc_attribute1               in varchar2         default hr_api.g_varchar2,
627   p_ecc_attribute2               in varchar2         default hr_api.g_varchar2,
628   p_ecc_attribute3               in varchar2         default hr_api.g_varchar2,
629   p_ecc_attribute4               in varchar2         default hr_api.g_varchar2,
630   p_ecc_attribute5               in varchar2         default hr_api.g_varchar2,
631   p_ecc_attribute6               in varchar2         default hr_api.g_varchar2,
632   p_ecc_attribute7               in varchar2         default hr_api.g_varchar2,
633   p_ecc_attribute8               in varchar2         default hr_api.g_varchar2,
634   p_ecc_attribute9               in varchar2         default hr_api.g_varchar2,
635   p_ecc_attribute10              in varchar2         default hr_api.g_varchar2,
636   p_ecc_attribute11              in varchar2         default hr_api.g_varchar2,
637   p_ecc_attribute12              in varchar2         default hr_api.g_varchar2,
638   p_ecc_attribute13              in varchar2         default hr_api.g_varchar2,
639   p_ecc_attribute14              in varchar2         default hr_api.g_varchar2,
640   p_ecc_attribute15              in varchar2         default hr_api.g_varchar2,
641   p_ecc_attribute16              in varchar2         default hr_api.g_varchar2,
642   p_ecc_attribute17              in varchar2         default hr_api.g_varchar2,
643   p_ecc_attribute18              in varchar2         default hr_api.g_varchar2,
644   p_ecc_attribute19              in varchar2         default hr_api.g_varchar2,
645   p_ecc_attribute20              in varchar2         default hr_api.g_varchar2,
646   p_ecc_attribute21              in varchar2         default hr_api.g_varchar2,
647   p_ecc_attribute22              in varchar2         default hr_api.g_varchar2,
648   p_ecc_attribute23              in varchar2         default hr_api.g_varchar2,
649   p_ecc_attribute24              in varchar2         default hr_api.g_varchar2,
650   p_ecc_attribute25              in varchar2         default hr_api.g_varchar2,
651   p_ecc_attribute26              in varchar2         default hr_api.g_varchar2,
652   p_ecc_attribute27              in varchar2         default hr_api.g_varchar2,
653   p_ecc_attribute28              in varchar2         default hr_api.g_varchar2,
654   p_ecc_attribute29              in varchar2         default hr_api.g_varchar2,
655   p_ecc_attribute30              in varchar2         default hr_api.g_varchar2,
656   p_susp_if_ctfn_not_prvd_flag   in varchar2         default hr_api.g_varchar2,
657   p_ctfn_determine_cd            in varchar2         default hr_api.g_varchar2,
658   p_request_id                   in number           default hr_api.g_number,
659   p_program_application_id       in number           default hr_api.g_number,
660   p_program_id                   in number           default hr_api.g_number,
661   p_program_update_date          in date             default hr_api.g_date,
662   p_object_version_number        in out nocopy number
663   ) is
664 --
665   l_rec	  ben_ecc_shd.g_rec_type;
666   l_proc  varchar2(72) := g_package||'upd';
667 --
668 Begin
669   hr_utility.set_location('Entering:'||l_proc, 5);
670   --
671   -- Call conversion function to turn arguments into the
672   -- l_rec structure.
673   --
674   l_rec :=
675   ben_ecc_shd.convert_args
676   (
677   p_elctbl_chc_ctfn_id,
678   p_enrt_ctfn_typ_cd,
679   p_rqd_flag,
680   p_elig_per_elctbl_chc_id,
681   p_enrt_bnft_id,
682   p_business_group_id,
683   p_ecc_attribute_category,
684   p_ecc_attribute1,
685   p_ecc_attribute2,
686   p_ecc_attribute3,
687   p_ecc_attribute4,
688   p_ecc_attribute5,
689   p_ecc_attribute6,
690   p_ecc_attribute7,
691   p_ecc_attribute8,
692   p_ecc_attribute9,
693   p_ecc_attribute10,
694   p_ecc_attribute11,
695   p_ecc_attribute12,
696   p_ecc_attribute13,
697   p_ecc_attribute14,
698   p_ecc_attribute15,
699   p_ecc_attribute16,
700   p_ecc_attribute17,
701   p_ecc_attribute18,
702   p_ecc_attribute19,
703   p_ecc_attribute20,
704   p_ecc_attribute21,
705   p_ecc_attribute22,
706   p_ecc_attribute23,
707   p_ecc_attribute24,
708   p_ecc_attribute25,
709   p_ecc_attribute26,
710   p_ecc_attribute27,
711   p_ecc_attribute28,
712   p_ecc_attribute29,
713   p_ecc_attribute30,
714   p_susp_if_ctfn_not_prvd_flag,
715   p_ctfn_determine_cd,
716   p_request_id,
717   p_program_application_id,
718   p_program_id,
719   p_program_update_date,
720   p_object_version_number
721   );
722   --
723   -- Having converted the arguments into the
724   -- plsql record structure we call the corresponding record
725   -- business process.
726   --
727   upd(
728     p_effective_date,l_rec);
729   p_object_version_number := l_rec.object_version_number;
730   --
731   hr_utility.set_location(' Leaving:'||l_proc, 10);
732 End upd;
733 --
734 end ben_ecc_upd;