DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_AGF_UPD

Source


1 Package Body ben_agf_upd as
2 /* $Header: beagfrhi.pkb 120.0 2005/05/28 00:23:13 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ben_agf_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_agf_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_agf_shd.g_api_dml := true;  -- Set the api dml status
66   --
67   -- Update the ben_age_fctr Row
68   --
69   update ben_age_fctr
70   set
71   age_fctr_id                       = p_rec.age_fctr_id,
72   name                              = p_rec.name,
73   mx_age_num                        = p_rec.mx_age_num,
74   mn_age_num                        = p_rec.mn_age_num,
75   age_uom                           = p_rec.age_uom,
76   no_mn_age_flag                    = p_rec.no_mn_age_flag,
77   no_mx_age_flag                    = p_rec.no_mx_age_flag,
78   age_to_use_cd                     = p_rec.age_to_use_cd,
79   age_det_cd                        = p_rec.age_det_cd,
80   age_det_rl                        = p_rec.age_det_rl,
81   rndg_cd                           = p_rec.rndg_cd,
82   rndg_rl                           = p_rec.rndg_rl,
83   age_calc_rl                       = p_rec.age_calc_rl,
84   business_group_id                 = p_rec.business_group_id,
85   agf_attribute_category            = p_rec.agf_attribute_category,
86   agf_attribute1                    = p_rec.agf_attribute1,
87   agf_attribute2                    = p_rec.agf_attribute2,
88   agf_attribute3                    = p_rec.agf_attribute3,
89   agf_attribute4                    = p_rec.agf_attribute4,
90   agf_attribute5                    = p_rec.agf_attribute5,
91   agf_attribute6                    = p_rec.agf_attribute6,
92   agf_attribute7                    = p_rec.agf_attribute7,
93   agf_attribute8                    = p_rec.agf_attribute8,
94   agf_attribute9                    = p_rec.agf_attribute9,
95   agf_attribute10                   = p_rec.agf_attribute10,
96   agf_attribute11                   = p_rec.agf_attribute11,
97   agf_attribute12                   = p_rec.agf_attribute12,
98   agf_attribute13                   = p_rec.agf_attribute13,
99   agf_attribute14                   = p_rec.agf_attribute14,
100   agf_attribute15                   = p_rec.agf_attribute15,
101   agf_attribute16                   = p_rec.agf_attribute16,
102   agf_attribute17                   = p_rec.agf_attribute17,
103   agf_attribute18                   = p_rec.agf_attribute18,
104   agf_attribute19                   = p_rec.agf_attribute19,
105   agf_attribute20                   = p_rec.agf_attribute20,
106   agf_attribute21                   = p_rec.agf_attribute21,
107   agf_attribute22                   = p_rec.agf_attribute22,
108   agf_attribute23                   = p_rec.agf_attribute23,
109   agf_attribute24                   = p_rec.agf_attribute24,
110   agf_attribute25                   = p_rec.agf_attribute25,
111   agf_attribute26                   = p_rec.agf_attribute26,
112   agf_attribute27                   = p_rec.agf_attribute27,
113   agf_attribute28                   = p_rec.agf_attribute28,
114   agf_attribute29                   = p_rec.agf_attribute29,
115   agf_attribute30                   = p_rec.agf_attribute30,
116   object_version_number             = p_rec.object_version_number
117   where age_fctr_id = p_rec.age_fctr_id;
118   --
119   ben_agf_shd.g_api_dml := false;   -- Unset the api dml status
120   --
121   hr_utility.set_location(' Leaving:'||l_proc, 10);
122 --
123 Exception
124   When hr_api.check_integrity_violated Then
125     -- A check constraint has been violated
126     ben_agf_shd.g_api_dml := false;   -- Unset the api dml status
127     ben_agf_shd.constraint_error
128       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
129   When hr_api.parent_integrity_violated Then
130     -- Parent integrity has been violated
131     ben_agf_shd.g_api_dml := false;   -- Unset the api dml status
132     ben_agf_shd.constraint_error
133       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
134   When hr_api.unique_integrity_violated Then
135     -- Unique integrity has been violated
136     ben_agf_shd.g_api_dml := false;   -- Unset the api dml status
137     ben_agf_shd.constraint_error
138       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
139   When Others Then
140     ben_agf_shd.g_api_dml := false;   -- Unset the api dml status
141     Raise;
142 End update_dml;
143 --
144 -- ----------------------------------------------------------------------------
145 -- |------------------------------< pre_update >------------------------------|
146 -- ----------------------------------------------------------------------------
147 -- {Start Of Comments}
148 --
149 -- Description:
150 --   This private procedure contains any processing which is required before
151 --   the update dml.
152 --
153 -- Prerequisites:
154 --   This is an internal procedure which is called from the upd procedure.
155 --
156 -- In Parameters:
157 --   A Pl/Sql record structre.
158 --
159 -- Post Success:
160 --   Processing continues.
161 --
162 -- Post Failure:
163 --   If an error has occurred, an error message and exception will be raised
164 --   but not handled.
165 --
166 -- Developer Implementation Notes:
167 --   Any pre-processing required before the update dml is issued should be
168 --   coded within this procedure. It is important to note that any 3rd party
169 --   maintenance should be reviewed before placing in this procedure.
170 --
171 -- Access Status:
172 --   Internal Row Handler Use Only.
173 --
174 -- {End Of Comments}
175 -- ----------------------------------------------------------------------------
176 Procedure pre_update(p_rec in ben_agf_shd.g_rec_type) is
177 --
178   l_proc  varchar2(72) := g_package||'pre_update';
179 --
180 Begin
181   hr_utility.set_location('Entering:'||l_proc, 5);
182   --
183   hr_utility.set_location(' Leaving:'||l_proc, 10);
184 End pre_update;
185 --
186 -- ----------------------------------------------------------------------------
187 -- |-----------------------------< post_update >------------------------------|
188 -- ----------------------------------------------------------------------------
189 -- {Start Of Comments}
190 --
191 -- Description:
192 --   This private procedure contains any processing which is required after the
193 --   update dml.
194 --
195 -- Prerequisites:
196 --   This is an internal procedure which is called from the upd procedure.
197 --
198 -- In Parameters:
199 --   A Pl/Sql record structre.
200 --
201 -- Post Success:
202 --   Processing continues.
203 --
204 -- Post Failure:
205 --   If an error has occurred, an error message and exception will be raised
206 --   but not handled.
207 --
208 -- Developer Implementation Notes:
209 --   Any post-processing required after the update dml is issued should be
210 --   coded within this procedure. It is important to note that any 3rd party
211 --   maintenance should be reviewed before placing in this procedure.
212 --
213 -- Access Status:
214 --   Internal Row Handler Use Only.
215 --
216 -- {End Of Comments}
217 -- ----------------------------------------------------------------------------
218 Procedure post_update(
219 p_effective_date in date,p_rec in ben_agf_shd.g_rec_type) is
220 --
221   l_proc  varchar2(72) := g_package||'post_update';
222 --
223 Begin
224   hr_utility.set_location('Entering:'||l_proc, 5);
225 --
226   --
227   -- Start of API User Hook for post_update.
228   --
229   begin
230     --
231     ben_agf_rku.after_update
232       (
233   p_age_fctr_id                   =>p_rec.age_fctr_id
234  ,p_name                          =>p_rec.name
235  ,p_mx_age_num                    =>p_rec.mx_age_num
236  ,p_mn_age_num                    =>p_rec.mn_age_num
237  ,p_age_uom                       =>p_rec.age_uom
238  ,p_no_mn_age_flag                =>p_rec.no_mn_age_flag
239  ,p_no_mx_age_flag                =>p_rec.no_mx_age_flag
240  ,p_age_to_use_cd                 =>p_rec.age_to_use_cd
241  ,p_age_det_cd                    =>p_rec.age_det_cd
242  ,p_age_det_rl                    =>p_rec.age_det_rl
243  ,p_rndg_cd                       =>p_rec.rndg_cd
244  ,p_rndg_rl                       =>p_rec.rndg_rl
245  ,p_age_calc_rl                   =>p_rec.age_calc_rl
246  ,p_business_group_id             =>p_rec.business_group_id
247  ,p_agf_attribute_category        =>p_rec.agf_attribute_category
248  ,p_agf_attribute1                =>p_rec.agf_attribute1
249  ,p_agf_attribute2                =>p_rec.agf_attribute2
250  ,p_agf_attribute3                =>p_rec.agf_attribute3
251  ,p_agf_attribute4                =>p_rec.agf_attribute4
252  ,p_agf_attribute5                =>p_rec.agf_attribute5
253  ,p_agf_attribute6                =>p_rec.agf_attribute6
254  ,p_agf_attribute7                =>p_rec.agf_attribute7
255  ,p_agf_attribute8                =>p_rec.agf_attribute8
256  ,p_agf_attribute9                =>p_rec.agf_attribute9
257  ,p_agf_attribute10               =>p_rec.agf_attribute10
258  ,p_agf_attribute11               =>p_rec.agf_attribute11
259  ,p_agf_attribute12               =>p_rec.agf_attribute12
260  ,p_agf_attribute13               =>p_rec.agf_attribute13
261  ,p_agf_attribute14               =>p_rec.agf_attribute14
262  ,p_agf_attribute15               =>p_rec.agf_attribute15
263  ,p_agf_attribute16               =>p_rec.agf_attribute16
264  ,p_agf_attribute17               =>p_rec.agf_attribute17
265  ,p_agf_attribute18               =>p_rec.agf_attribute18
266  ,p_agf_attribute19               =>p_rec.agf_attribute19
267  ,p_agf_attribute20               =>p_rec.agf_attribute20
268  ,p_agf_attribute21               =>p_rec.agf_attribute21
269  ,p_agf_attribute22               =>p_rec.agf_attribute22
270  ,p_agf_attribute23               =>p_rec.agf_attribute23
271  ,p_agf_attribute24               =>p_rec.agf_attribute24
272  ,p_agf_attribute25               =>p_rec.agf_attribute25
273  ,p_agf_attribute26               =>p_rec.agf_attribute26
274  ,p_agf_attribute27               =>p_rec.agf_attribute27
275  ,p_agf_attribute28               =>p_rec.agf_attribute28
276  ,p_agf_attribute29               =>p_rec.agf_attribute29
277  ,p_agf_attribute30               =>p_rec.agf_attribute30
278  ,p_object_version_number         =>p_rec.object_version_number
279  ,p_effective_date                =>p_effective_date
280  ,p_name_o                        =>ben_agf_shd.g_old_rec.name
281  ,p_mx_age_num_o                  =>ben_agf_shd.g_old_rec.mx_age_num
282  ,p_mn_age_num_o                  =>ben_agf_shd.g_old_rec.mn_age_num
283  ,p_age_uom_o                     =>ben_agf_shd.g_old_rec.age_uom
284  ,p_no_mn_age_flag_o              =>ben_agf_shd.g_old_rec.no_mn_age_flag
285  ,p_no_mx_age_flag_o              =>ben_agf_shd.g_old_rec.no_mx_age_flag
286  ,p_age_to_use_cd_o               =>ben_agf_shd.g_old_rec.age_to_use_cd
287  ,p_age_det_cd_o                  =>ben_agf_shd.g_old_rec.age_det_cd
288  ,p_age_det_rl_o                  =>ben_agf_shd.g_old_rec.age_det_rl
289  ,p_rndg_cd_o                     =>ben_agf_shd.g_old_rec.rndg_cd
290  ,p_rndg_rl_o                     =>ben_agf_shd.g_old_rec.rndg_rl
291  ,p_age_calc_rl_o                 =>ben_agf_shd.g_old_rec.age_calc_rl
292  ,p_business_group_id_o           =>ben_agf_shd.g_old_rec.business_group_id
293  ,p_agf_attribute_category_o      =>ben_agf_shd.g_old_rec.agf_attribute_category
294  ,p_agf_attribute1_o              =>ben_agf_shd.g_old_rec.agf_attribute1
295  ,p_agf_attribute2_o              =>ben_agf_shd.g_old_rec.agf_attribute2
296  ,p_agf_attribute3_o              =>ben_agf_shd.g_old_rec.agf_attribute3
297  ,p_agf_attribute4_o              =>ben_agf_shd.g_old_rec.agf_attribute4
298  ,p_agf_attribute5_o              =>ben_agf_shd.g_old_rec.agf_attribute5
299  ,p_agf_attribute6_o              =>ben_agf_shd.g_old_rec.agf_attribute6
300  ,p_agf_attribute7_o              =>ben_agf_shd.g_old_rec.agf_attribute7
301  ,p_agf_attribute8_o              =>ben_agf_shd.g_old_rec.agf_attribute8
302  ,p_agf_attribute9_o              =>ben_agf_shd.g_old_rec.agf_attribute9
303  ,p_agf_attribute10_o             =>ben_agf_shd.g_old_rec.agf_attribute10
304  ,p_agf_attribute11_o             =>ben_agf_shd.g_old_rec.agf_attribute11
305  ,p_agf_attribute12_o             =>ben_agf_shd.g_old_rec.agf_attribute12
306  ,p_agf_attribute13_o             =>ben_agf_shd.g_old_rec.agf_attribute13
307  ,p_agf_attribute14_o             =>ben_agf_shd.g_old_rec.agf_attribute14
308  ,p_agf_attribute15_o             =>ben_agf_shd.g_old_rec.agf_attribute15
309  ,p_agf_attribute16_o             =>ben_agf_shd.g_old_rec.agf_attribute16
310  ,p_agf_attribute17_o             =>ben_agf_shd.g_old_rec.agf_attribute17
311  ,p_agf_attribute18_o             =>ben_agf_shd.g_old_rec.agf_attribute18
312  ,p_agf_attribute19_o             =>ben_agf_shd.g_old_rec.agf_attribute19
313  ,p_agf_attribute20_o             =>ben_agf_shd.g_old_rec.agf_attribute20
314  ,p_agf_attribute21_o             =>ben_agf_shd.g_old_rec.agf_attribute21
315  ,p_agf_attribute22_o             =>ben_agf_shd.g_old_rec.agf_attribute22
316  ,p_agf_attribute23_o             =>ben_agf_shd.g_old_rec.agf_attribute23
317  ,p_agf_attribute24_o             =>ben_agf_shd.g_old_rec.agf_attribute24
318  ,p_agf_attribute25_o             =>ben_agf_shd.g_old_rec.agf_attribute25
319  ,p_agf_attribute26_o             =>ben_agf_shd.g_old_rec.agf_attribute26
320  ,p_agf_attribute27_o             =>ben_agf_shd.g_old_rec.agf_attribute27
321  ,p_agf_attribute28_o             =>ben_agf_shd.g_old_rec.agf_attribute28
322  ,p_agf_attribute29_o             =>ben_agf_shd.g_old_rec.agf_attribute29
323  ,p_agf_attribute30_o             =>ben_agf_shd.g_old_rec.agf_attribute30
324  ,p_object_version_number_o       =>ben_agf_shd.g_old_rec.object_version_number
325       );
326     --
327   exception
328     --
329     when hr_api.cannot_find_prog_unit then
330       --
331       hr_api.cannot_find_prog_unit_error
332         (p_module_name => 'ben_age_fctr'
333         ,p_hook_type   => 'AU');
334       --
335   end;
339   --
336   --
337   -- End of API User Hook for post_update.
338   --
340   hr_utility.set_location(' Leaving:'||l_proc, 10);
341 End post_update;
342 --
343 -- ----------------------------------------------------------------------------
344 -- |-----------------------------< convert_defs >-----------------------------|
345 -- ----------------------------------------------------------------------------
346 -- {Start Of Comments}
347 --
348 -- Description:
349 --   The Convert_Defs procedure has one very important function:
350 --   It must return the record structure for the row with all system defaulted
351 --   values converted into its corresponding parameter value for update. When
352 --   we attempt to update a row through the Upd process , certain
353 --   parameters can be defaulted which enables flexibility in the calling of
354 --   the upd process (e.g. only attributes which need to be updated need to be
355 --   specified). For the upd process to determine which attributes
356 --   have NOT been specified we need to check if the parameter has a reserved
357 --   system default value. Therefore, for all parameters which have a
358 --   corresponding reserved system default mechanism specified we need to
359 --   check if a system default is being used. If a system default is being
360 --   used then we convert the defaulted value into its corresponding attribute
361 --   value held in the g_old_rec data structure.
362 --
363 -- Prerequisites:
364 --   This private function can only be called from the upd process.
365 --
366 -- In Parameters:
367 --   A Pl/Sql record structre.
368 --
369 -- Post Success:
370 --   The record structure will be returned with all system defaulted parameter
371 --   values converted into its current row attribute value.
372 --
373 -- Post Failure:
374 --   No direct error handling is required within this function. Any possible
375 --   errors within this procedure will be a PL/SQL value error due to conversion
376 --   of datatypes or data lengths.
377 --
378 -- Developer Implementation Notes:
379 --   None.
380 --
381 -- Access Status:
382 --   Internal Row Handler Use Only.
383 --
384 -- {End Of Comments}
385 -- ----------------------------------------------------------------------------
386 Procedure convert_defs(p_rec in out nocopy ben_agf_shd.g_rec_type) is
387 --
388   l_proc  varchar2(72) := g_package||'convert_defs';
389 --
390 Begin
391   --
392   hr_utility.set_location('Entering:'||l_proc, 5);
393   --
394   -- We must now examine each argument value in the
395   -- p_rec plsql record structure
396   -- to see if a system default is being used. If a system default
397   -- is being used then we must set to the 'current' argument value.
398   --
399   If (p_rec.name = hr_api.g_varchar2) then
400     p_rec.name :=
401     ben_agf_shd.g_old_rec.name;
402   End If;
403   If (p_rec.mx_age_num = hr_api.g_number) then
404     p_rec.mx_age_num :=
405     ben_agf_shd.g_old_rec.mx_age_num;
406   End If;
407   If (p_rec.mn_age_num = hr_api.g_number) then
408     p_rec.mn_age_num :=
409     ben_agf_shd.g_old_rec.mn_age_num;
410   End If;
411   If (p_rec.age_uom = hr_api.g_varchar2) then
412     p_rec.age_uom :=
413     ben_agf_shd.g_old_rec.age_uom;
414   End If;
415   If (p_rec.no_mn_age_flag = hr_api.g_varchar2) then
416     p_rec.no_mn_age_flag :=
417     ben_agf_shd.g_old_rec.no_mn_age_flag;
418   End If;
419   If (p_rec.no_mx_age_flag = hr_api.g_varchar2) then
420     p_rec.no_mx_age_flag :=
421     ben_agf_shd.g_old_rec.no_mx_age_flag;
422   End If;
423   If (p_rec.age_to_use_cd = hr_api.g_varchar2) then
424     p_rec.age_to_use_cd :=
425     ben_agf_shd.g_old_rec.age_to_use_cd;
426   End If;
427   If (p_rec.age_det_cd = hr_api.g_varchar2) then
428     p_rec.age_det_cd :=
429     ben_agf_shd.g_old_rec.age_det_cd;
430   End If;
431   If (p_rec.age_det_rl = hr_api.g_number) then
432     p_rec.age_det_rl :=
433     ben_agf_shd.g_old_rec.age_det_rl;
434   End If;
435   If (p_rec.rndg_cd = hr_api.g_varchar2) then
436     p_rec.rndg_cd :=
437     ben_agf_shd.g_old_rec.rndg_cd;
438   End If;
439   If (p_rec.rndg_rl = hr_api.g_number) then
440     p_rec.rndg_rl :=
441     ben_agf_shd.g_old_rec.rndg_rl;
442   End If;
443   If (p_rec.age_calc_rl = hr_api.g_number) then
444     p_rec.age_calc_rl :=
445     ben_agf_shd.g_old_rec.age_calc_rl;
446   End If;
447   If (p_rec.business_group_id = hr_api.g_number) then
448     p_rec.business_group_id :=
449     ben_agf_shd.g_old_rec.business_group_id;
450   End If;
451   If (p_rec.agf_attribute_category = hr_api.g_varchar2) then
452     p_rec.agf_attribute_category :=
453     ben_agf_shd.g_old_rec.agf_attribute_category;
454   End If;
455   If (p_rec.agf_attribute1 = hr_api.g_varchar2) then
456     p_rec.agf_attribute1 :=
457     ben_agf_shd.g_old_rec.agf_attribute1;
458   End If;
459   If (p_rec.agf_attribute2 = hr_api.g_varchar2) then
460     p_rec.agf_attribute2 :=
461     ben_agf_shd.g_old_rec.agf_attribute2;
462   End If;
463   If (p_rec.agf_attribute3 = hr_api.g_varchar2) then
464     p_rec.agf_attribute3 :=
465     ben_agf_shd.g_old_rec.agf_attribute3;
466   End If;
467   If (p_rec.agf_attribute4 = hr_api.g_varchar2) then
468     p_rec.agf_attribute4 :=
469     ben_agf_shd.g_old_rec.agf_attribute4;
470   End If;
471   If (p_rec.agf_attribute5 = hr_api.g_varchar2) then
472     p_rec.agf_attribute5 :=
476     p_rec.agf_attribute6 :=
473     ben_agf_shd.g_old_rec.agf_attribute5;
474   End If;
475   If (p_rec.agf_attribute6 = hr_api.g_varchar2) then
477     ben_agf_shd.g_old_rec.agf_attribute6;
478   End If;
479   If (p_rec.agf_attribute7 = hr_api.g_varchar2) then
480     p_rec.agf_attribute7 :=
481     ben_agf_shd.g_old_rec.agf_attribute7;
482   End If;
483   If (p_rec.agf_attribute8 = hr_api.g_varchar2) then
484     p_rec.agf_attribute8 :=
485     ben_agf_shd.g_old_rec.agf_attribute8;
486   End If;
487   If (p_rec.agf_attribute9 = hr_api.g_varchar2) then
488     p_rec.agf_attribute9 :=
489     ben_agf_shd.g_old_rec.agf_attribute9;
490   End If;
491   If (p_rec.agf_attribute10 = hr_api.g_varchar2) then
492     p_rec.agf_attribute10 :=
493     ben_agf_shd.g_old_rec.agf_attribute10;
494   End If;
495   If (p_rec.agf_attribute11 = hr_api.g_varchar2) then
496     p_rec.agf_attribute11 :=
497     ben_agf_shd.g_old_rec.agf_attribute11;
498   End If;
499   If (p_rec.agf_attribute12 = hr_api.g_varchar2) then
500     p_rec.agf_attribute12 :=
501     ben_agf_shd.g_old_rec.agf_attribute12;
502   End If;
503   If (p_rec.agf_attribute13 = hr_api.g_varchar2) then
504     p_rec.agf_attribute13 :=
505     ben_agf_shd.g_old_rec.agf_attribute13;
506   End If;
507   If (p_rec.agf_attribute14 = hr_api.g_varchar2) then
508     p_rec.agf_attribute14 :=
509     ben_agf_shd.g_old_rec.agf_attribute14;
510   End If;
511   If (p_rec.agf_attribute15 = hr_api.g_varchar2) then
512     p_rec.agf_attribute15 :=
513     ben_agf_shd.g_old_rec.agf_attribute15;
514   End If;
515   If (p_rec.agf_attribute16 = hr_api.g_varchar2) then
516     p_rec.agf_attribute16 :=
517     ben_agf_shd.g_old_rec.agf_attribute16;
518   End If;
519   If (p_rec.agf_attribute17 = hr_api.g_varchar2) then
520     p_rec.agf_attribute17 :=
521     ben_agf_shd.g_old_rec.agf_attribute17;
522   End If;
523   If (p_rec.agf_attribute18 = hr_api.g_varchar2) then
524     p_rec.agf_attribute18 :=
525     ben_agf_shd.g_old_rec.agf_attribute18;
526   End If;
527   If (p_rec.agf_attribute19 = hr_api.g_varchar2) then
528     p_rec.agf_attribute19 :=
529     ben_agf_shd.g_old_rec.agf_attribute19;
530   End If;
531   If (p_rec.agf_attribute20 = hr_api.g_varchar2) then
532     p_rec.agf_attribute20 :=
533     ben_agf_shd.g_old_rec.agf_attribute20;
534   End If;
535   If (p_rec.agf_attribute21 = hr_api.g_varchar2) then
536     p_rec.agf_attribute21 :=
537     ben_agf_shd.g_old_rec.agf_attribute21;
538   End If;
539   If (p_rec.agf_attribute22 = hr_api.g_varchar2) then
540     p_rec.agf_attribute22 :=
541     ben_agf_shd.g_old_rec.agf_attribute22;
542   End If;
543   If (p_rec.agf_attribute23 = hr_api.g_varchar2) then
544     p_rec.agf_attribute23 :=
545     ben_agf_shd.g_old_rec.agf_attribute23;
546   End If;
547   If (p_rec.agf_attribute24 = hr_api.g_varchar2) then
548     p_rec.agf_attribute24 :=
549     ben_agf_shd.g_old_rec.agf_attribute24;
550   End If;
551   If (p_rec.agf_attribute25 = hr_api.g_varchar2) then
552     p_rec.agf_attribute25 :=
553     ben_agf_shd.g_old_rec.agf_attribute25;
554   End If;
555   If (p_rec.agf_attribute26 = hr_api.g_varchar2) then
556     p_rec.agf_attribute26 :=
557     ben_agf_shd.g_old_rec.agf_attribute26;
558   End If;
559   If (p_rec.agf_attribute27 = hr_api.g_varchar2) then
560     p_rec.agf_attribute27 :=
561     ben_agf_shd.g_old_rec.agf_attribute27;
562   End If;
563   If (p_rec.agf_attribute28 = hr_api.g_varchar2) then
564     p_rec.agf_attribute28 :=
565     ben_agf_shd.g_old_rec.agf_attribute28;
566   End If;
567   If (p_rec.agf_attribute29 = hr_api.g_varchar2) then
568     p_rec.agf_attribute29 :=
569     ben_agf_shd.g_old_rec.agf_attribute29;
570   End If;
571   If (p_rec.agf_attribute30 = hr_api.g_varchar2) then
572     p_rec.agf_attribute30 :=
573     ben_agf_shd.g_old_rec.agf_attribute30;
574   End If;
575 
576   --
577   hr_utility.set_location(' Leaving:'||l_proc, 10);
578 --
579 End convert_defs;
580 --
581 -- ----------------------------------------------------------------------------
582 -- |---------------------------------< upd >----------------------------------|
583 -- ----------------------------------------------------------------------------
584 Procedure upd
585   (
586   p_effective_date in date,
587   p_rec        in out nocopy ben_agf_shd.g_rec_type
588   ) is
589 --
590   l_proc  varchar2(72) := g_package||'upd';
591 --
592 Begin
593   hr_utility.set_location('Entering:'||l_proc, 5);
594   --
595   -- We must lock the row which we need to update.
596   --
597   ben_agf_shd.lck
598 	(
599 	p_rec.age_fctr_id,
600 	p_rec.object_version_number
601 	);
602   --
603   -- 1. During an update system defaults are used to determine if
604   --    arguments have been defaulted or not. We must therefore
605   --    derive the full record structure values to be updated.
606   --
607   -- 2. Call the supporting update validate operations.
608   --
609   convert_defs(p_rec);
610   ben_agf_bus.update_validate(p_rec
611   ,p_effective_date);
612   --
613   -- Call the supporting pre-update operation
614   --
615   pre_update(p_rec);
616   --
617   -- Update the row.
618   --
622   --
619   update_dml(p_rec);
620   --
621   -- Call the supporting post-update operation
623   post_update(
624 p_effective_date,p_rec);
625 End upd;
626 --
627 -- ----------------------------------------------------------------------------
628 -- |---------------------------------< upd >----------------------------------|
629 -- ----------------------------------------------------------------------------
630 Procedure upd
631   (
632   p_effective_date in date,
633   p_age_fctr_id                  in number,
634   p_name                         in varchar2         default hr_api.g_varchar2,
635   p_mx_age_num                   in number           default hr_api.g_number,
636   p_mn_age_num                   in number           default hr_api.g_number,
637   p_age_uom                      in varchar2         default hr_api.g_varchar2,
638   p_no_mn_age_flag               in varchar2         default hr_api.g_varchar2,
639   p_no_mx_age_flag               in varchar2         default hr_api.g_varchar2,
640   p_age_to_use_cd                in varchar2         default hr_api.g_varchar2,
641   p_age_det_cd                   in varchar2         default hr_api.g_varchar2,
642   p_age_det_rl                   in number           default hr_api.g_number,
643   p_rndg_cd                      in varchar2         default hr_api.g_varchar2,
644   p_rndg_rl                      in number           default hr_api.g_number,
645   p_age_calc_rl                  in number           default hr_api.g_number,
646   p_business_group_id            in number           default hr_api.g_number,
647   p_agf_attribute_category       in varchar2         default hr_api.g_varchar2,
648   p_agf_attribute1               in varchar2         default hr_api.g_varchar2,
649   p_agf_attribute2               in varchar2         default hr_api.g_varchar2,
650   p_agf_attribute3               in varchar2         default hr_api.g_varchar2,
651   p_agf_attribute4               in varchar2         default hr_api.g_varchar2,
652   p_agf_attribute5               in varchar2         default hr_api.g_varchar2,
653   p_agf_attribute6               in varchar2         default hr_api.g_varchar2,
654   p_agf_attribute7               in varchar2         default hr_api.g_varchar2,
655   p_agf_attribute8               in varchar2         default hr_api.g_varchar2,
656   p_agf_attribute9               in varchar2         default hr_api.g_varchar2,
657   p_agf_attribute10              in varchar2         default hr_api.g_varchar2,
658   p_agf_attribute11              in varchar2         default hr_api.g_varchar2,
659   p_agf_attribute12              in varchar2         default hr_api.g_varchar2,
660   p_agf_attribute13              in varchar2         default hr_api.g_varchar2,
661   p_agf_attribute14              in varchar2         default hr_api.g_varchar2,
662   p_agf_attribute15              in varchar2         default hr_api.g_varchar2,
663   p_agf_attribute16              in varchar2         default hr_api.g_varchar2,
664   p_agf_attribute17              in varchar2         default hr_api.g_varchar2,
665   p_agf_attribute18              in varchar2         default hr_api.g_varchar2,
666   p_agf_attribute19              in varchar2         default hr_api.g_varchar2,
667   p_agf_attribute20              in varchar2         default hr_api.g_varchar2,
668   p_agf_attribute21              in varchar2         default hr_api.g_varchar2,
669   p_agf_attribute22              in varchar2         default hr_api.g_varchar2,
670   p_agf_attribute23              in varchar2         default hr_api.g_varchar2,
671   p_agf_attribute24              in varchar2         default hr_api.g_varchar2,
672   p_agf_attribute25              in varchar2         default hr_api.g_varchar2,
673   p_agf_attribute26              in varchar2         default hr_api.g_varchar2,
674   p_agf_attribute27              in varchar2         default hr_api.g_varchar2,
675   p_agf_attribute28              in varchar2         default hr_api.g_varchar2,
676   p_agf_attribute29              in varchar2         default hr_api.g_varchar2,
677   p_agf_attribute30              in varchar2         default hr_api.g_varchar2,
678   p_object_version_number        in out nocopy number
679   ) is
680 --
681   l_rec	  ben_agf_shd.g_rec_type;
682   l_proc  varchar2(72) := g_package||'upd';
683 --
684 Begin
685   hr_utility.set_location('Entering:'||l_proc, 5);
686   --
687   -- Call conversion function to turn arguments into the
688   -- l_rec structure.
689   --
690   l_rec :=
691   ben_agf_shd.convert_args
692   (
693   p_age_fctr_id,
694   p_name,
695   p_mx_age_num,
696   p_mn_age_num,
697   p_age_uom,
698   p_no_mn_age_flag,
699   p_no_mx_age_flag,
700   p_age_to_use_cd,
701   p_age_det_cd,
702   p_age_det_rl,
703   p_rndg_cd,
704   p_rndg_rl,
705   p_age_calc_rl,
706   p_business_group_id,
707   p_agf_attribute_category,
708   p_agf_attribute1,
709   p_agf_attribute2,
710   p_agf_attribute3,
711   p_agf_attribute4,
712   p_agf_attribute5,
713   p_agf_attribute6,
714   p_agf_attribute7,
715   p_agf_attribute8,
716   p_agf_attribute9,
717   p_agf_attribute10,
718   p_agf_attribute11,
719   p_agf_attribute12,
720   p_agf_attribute13,
721   p_agf_attribute14,
722   p_agf_attribute15,
723   p_agf_attribute16,
724   p_agf_attribute17,
725   p_agf_attribute18,
726   p_agf_attribute19,
727   p_agf_attribute20,
728   p_agf_attribute21,
729   p_agf_attribute22,
730   p_agf_attribute23,
731   p_agf_attribute24,
732   p_agf_attribute25,
733   p_agf_attribute26,
734   p_agf_attribute27,
735   p_agf_attribute28,
736   p_agf_attribute29,
737   p_agf_attribute30,
738   p_object_version_number
739   );
740   --
741   -- Having converted the arguments into the
742   -- plsql record structure we call the corresponding record
743   -- business process.
744   --
745   upd(
746     p_effective_date,l_rec);
747   p_object_version_number := l_rec.object_version_number;
748   --
749   hr_utility.set_location(' Leaving:'||l_proc, 10);
750 End upd;
751 --
752 end ben_agf_upd;