DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_CMD_UPD

Source


1 Package Body ben_cmd_upd as
2 /* $Header: becmdrhi.pkb 115.7 2002/12/31 23:57:12 mmudigon ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ben_cmd_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_cmd_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_cmd_shd.g_api_dml := true;  -- Set the api dml status
66   --
67   -- Update the ben_cm_dlvry_med_typ Row
68   --
69   update ben_cm_dlvry_med_typ
70   set
71   cm_dlvry_med_typ_id               = p_rec.cm_dlvry_med_typ_id,
72   cm_dlvry_med_typ_cd               = p_rec.cm_dlvry_med_typ_cd,
73   cm_dlvry_mthd_typ_id              = p_rec.cm_dlvry_mthd_typ_id,
74   rqd_flag                          = p_rec.rqd_flag,
75   dflt_flag                         = p_rec.dflt_flag,
76   business_group_id                 = p_rec.business_group_id,
77   cmd_attribute_category            = p_rec.cmd_attribute_category,
78   cmd_attribute1                    = p_rec.cmd_attribute1,
79   cmd_attribute2                    = p_rec.cmd_attribute2,
80   cmd_attribute3                    = p_rec.cmd_attribute3,
81   cmd_attribute4                    = p_rec.cmd_attribute4,
82   cmd_attribute5                    = p_rec.cmd_attribute5,
83   cmd_attribute6                    = p_rec.cmd_attribute6,
84   cmd_attribute7                    = p_rec.cmd_attribute7,
85   cmd_attribute8                    = p_rec.cmd_attribute8,
86   cmd_attribute9                    = p_rec.cmd_attribute9,
87   cmd_attribute10                   = p_rec.cmd_attribute10,
88   cmd_attribute11                   = p_rec.cmd_attribute11,
89   cmd_attribute12                   = p_rec.cmd_attribute12,
90   cmd_attribute13                   = p_rec.cmd_attribute13,
91   cmd_attribute14                   = p_rec.cmd_attribute14,
92   cmd_attribute15                   = p_rec.cmd_attribute15,
93   cmd_attribute16                   = p_rec.cmd_attribute16,
94   cmd_attribute17                   = p_rec.cmd_attribute17,
95   cmd_attribute18                   = p_rec.cmd_attribute18,
96   cmd_attribute19                   = p_rec.cmd_attribute19,
97   cmd_attribute20                   = p_rec.cmd_attribute20,
98   cmd_attribute21                   = p_rec.cmd_attribute21,
99   cmd_attribute22                   = p_rec.cmd_attribute22,
100   cmd_attribute23                   = p_rec.cmd_attribute23,
101   cmd_attribute24                   = p_rec.cmd_attribute24,
102   cmd_attribute25                   = p_rec.cmd_attribute25,
103   cmd_attribute26                   = p_rec.cmd_attribute26,
104   cmd_attribute27                   = p_rec.cmd_attribute27,
105   cmd_attribute28                   = p_rec.cmd_attribute28,
106   cmd_attribute29                   = p_rec.cmd_attribute29,
107   cmd_attribute30                   = p_rec.cmd_attribute30,
108   object_version_number             = p_rec.object_version_number
109   where cm_dlvry_med_typ_id = p_rec.cm_dlvry_med_typ_id;
110   --
111   ben_cmd_shd.g_api_dml := false;   -- Unset the api dml status
112   --
113   hr_utility.set_location(' Leaving:'||l_proc, 10);
114 --
115 Exception
116   When hr_api.check_integrity_violated Then
117     -- A check constraint has been violated
118     ben_cmd_shd.g_api_dml := false;   -- Unset the api dml status
119     ben_cmd_shd.constraint_error
120       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
121   When hr_api.parent_integrity_violated Then
122     -- Parent integrity has been violated
123     ben_cmd_shd.g_api_dml := false;   -- Unset the api dml status
124     ben_cmd_shd.constraint_error
125       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
126   When hr_api.unique_integrity_violated Then
127     -- Unique integrity has been violated
128     ben_cmd_shd.g_api_dml := false;   -- Unset the api dml status
129     ben_cmd_shd.constraint_error
130       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
131   When Others Then
132     ben_cmd_shd.g_api_dml := false;   -- Unset the api dml status
133     Raise;
134 End update_dml;
135 --
136 -- ----------------------------------------------------------------------------
137 -- |------------------------------< pre_update >------------------------------|
138 -- ----------------------------------------------------------------------------
139 -- {Start Of Comments}
140 --
141 -- Description:
142 --   This private procedure contains any processing which is required before
143 --   the update dml.
144 --
145 -- Prerequisites:
146 --   This is an internal procedure which is called from the upd procedure.
147 --
148 -- In Parameters:
149 --   A Pl/Sql record structre.
150 --
151 -- Post Success:
152 --   Processing continues.
153 --
154 -- Post Failure:
155 --   If an error has occurred, an error message and exception will be raised
156 --   but not handled.
157 --
158 -- Developer Implementation Notes:
159 --   Any pre-processing required before the update dml is issued should be
160 --   coded within this procedure. It is important to note that any 3rd party
161 --   maintenance should be reviewed before placing in this procedure.
162 --
163 -- Access Status:
164 --   Internal Row Handler Use Only.
165 --
166 -- {End Of Comments}
167 -- ----------------------------------------------------------------------------
168 Procedure pre_update(p_rec in ben_cmd_shd.g_rec_type) is
169 --
170   l_proc  varchar2(72) := g_package||'pre_update';
171 --
172 Begin
173   hr_utility.set_location('Entering:'||l_proc, 5);
174   --
175   hr_utility.set_location(' Leaving:'||l_proc, 10);
176 End pre_update;
177 --
178 -- ----------------------------------------------------------------------------
179 -- |-----------------------------< post_update >------------------------------|
180 -- ----------------------------------------------------------------------------
181 -- {Start Of Comments}
182 --
183 -- Description:
184 --   This private procedure contains any processing which is required after the
185 --   update dml.
186 --
187 -- Prerequisites:
188 --   This is an internal procedure which is called from the upd procedure.
189 --
190 -- In Parameters:
191 --   A Pl/Sql record structre.
192 --
193 -- Post Success:
194 --   Processing continues.
195 --
196 -- Post Failure:
197 --   If an error has occurred, an error message and exception will be raised
198 --   but not handled.
199 --
200 -- Developer Implementation Notes:
201 --   Any post-processing required after the update dml is issued should be
202 --   coded within this procedure. It is important to note that any 3rd party
203 --   maintenance should be reviewed before placing in this procedure.
204 --
205 -- Access Status:
206 --   Internal Row Handler Use Only.
207 --
208 -- {End Of Comments}
209 -- ----------------------------------------------------------------------------
210 Procedure post_update(
211 p_effective_date in date,p_rec in ben_cmd_shd.g_rec_type) is
212 --
213   l_proc  varchar2(72) := g_package||'post_update';
214 --
215 Begin
216   hr_utility.set_location('Entering:'||l_proc, 5);
217 --
218   --
219   -- Start of API User Hook for post_update.
220   --
221   begin
222     --
223     ben_cmd_rku.after_update
224       (
225   p_cm_dlvry_med_typ_id           =>p_rec.cm_dlvry_med_typ_id
226  ,p_cm_dlvry_med_typ_cd           =>p_rec.cm_dlvry_med_typ_cd
227  ,p_cm_dlvry_mthd_typ_id          =>p_rec.cm_dlvry_mthd_typ_id
228  ,p_rqd_flag                      =>p_rec.rqd_flag
229  ,p_dflt_flag                     =>p_rec.dflt_flag
230  ,p_business_group_id             =>p_rec.business_group_id
231  ,p_cmd_attribute_category        =>p_rec.cmd_attribute_category
232  ,p_cmd_attribute1                =>p_rec.cmd_attribute1
233  ,p_cmd_attribute2                =>p_rec.cmd_attribute2
234  ,p_cmd_attribute3                =>p_rec.cmd_attribute3
235  ,p_cmd_attribute4                =>p_rec.cmd_attribute4
236  ,p_cmd_attribute5                =>p_rec.cmd_attribute5
237  ,p_cmd_attribute6                =>p_rec.cmd_attribute6
238  ,p_cmd_attribute7                =>p_rec.cmd_attribute7
239  ,p_cmd_attribute8                =>p_rec.cmd_attribute8
240  ,p_cmd_attribute9                =>p_rec.cmd_attribute9
241  ,p_cmd_attribute10               =>p_rec.cmd_attribute10
242  ,p_cmd_attribute11               =>p_rec.cmd_attribute11
243  ,p_cmd_attribute12               =>p_rec.cmd_attribute12
244  ,p_cmd_attribute13               =>p_rec.cmd_attribute13
245  ,p_cmd_attribute14               =>p_rec.cmd_attribute14
246  ,p_cmd_attribute15               =>p_rec.cmd_attribute15
247  ,p_cmd_attribute16               =>p_rec.cmd_attribute16
248  ,p_cmd_attribute17               =>p_rec.cmd_attribute17
249  ,p_cmd_attribute18               =>p_rec.cmd_attribute18
250  ,p_cmd_attribute19               =>p_rec.cmd_attribute19
251  ,p_cmd_attribute20               =>p_rec.cmd_attribute20
252  ,p_cmd_attribute21               =>p_rec.cmd_attribute21
253  ,p_cmd_attribute22               =>p_rec.cmd_attribute22
254  ,p_cmd_attribute23               =>p_rec.cmd_attribute23
255  ,p_cmd_attribute24               =>p_rec.cmd_attribute24
256  ,p_cmd_attribute25               =>p_rec.cmd_attribute25
257  ,p_cmd_attribute26               =>p_rec.cmd_attribute26
258  ,p_cmd_attribute27               =>p_rec.cmd_attribute27
259  ,p_cmd_attribute28               =>p_rec.cmd_attribute28
260  ,p_cmd_attribute29               =>p_rec.cmd_attribute29
261  ,p_cmd_attribute30               =>p_rec.cmd_attribute30
262  ,p_object_version_number         =>p_rec.object_version_number
263  ,p_effective_date                =>p_effective_date
264  ,p_cm_dlvry_med_typ_cd_o         =>ben_cmd_shd.g_old_rec.cm_dlvry_med_typ_cd
265  ,p_cm_dlvry_mthd_typ_id_o        =>ben_cmd_shd.g_old_rec.cm_dlvry_mthd_typ_id
266  ,p_rqd_flag_o                    =>ben_cmd_shd.g_old_rec.rqd_flag
267  ,p_dflt_flag_o                   =>ben_cmd_shd.g_old_rec.dflt_flag
268  ,p_business_group_id_o           =>ben_cmd_shd.g_old_rec.business_group_id
269  ,p_cmd_attribute_category_o      =>ben_cmd_shd.g_old_rec.cmd_attribute_category
270  ,p_cmd_attribute1_o              =>ben_cmd_shd.g_old_rec.cmd_attribute1
271  ,p_cmd_attribute2_o              =>ben_cmd_shd.g_old_rec.cmd_attribute2
272  ,p_cmd_attribute3_o              =>ben_cmd_shd.g_old_rec.cmd_attribute3
273  ,p_cmd_attribute4_o              =>ben_cmd_shd.g_old_rec.cmd_attribute4
274  ,p_cmd_attribute5_o              =>ben_cmd_shd.g_old_rec.cmd_attribute5
275  ,p_cmd_attribute6_o              =>ben_cmd_shd.g_old_rec.cmd_attribute6
276  ,p_cmd_attribute7_o              =>ben_cmd_shd.g_old_rec.cmd_attribute7
277  ,p_cmd_attribute8_o              =>ben_cmd_shd.g_old_rec.cmd_attribute8
278  ,p_cmd_attribute9_o              =>ben_cmd_shd.g_old_rec.cmd_attribute9
279  ,p_cmd_attribute10_o             =>ben_cmd_shd.g_old_rec.cmd_attribute10
280  ,p_cmd_attribute11_o             =>ben_cmd_shd.g_old_rec.cmd_attribute11
281  ,p_cmd_attribute12_o             =>ben_cmd_shd.g_old_rec.cmd_attribute12
282  ,p_cmd_attribute13_o             =>ben_cmd_shd.g_old_rec.cmd_attribute13
283  ,p_cmd_attribute14_o             =>ben_cmd_shd.g_old_rec.cmd_attribute14
284  ,p_cmd_attribute15_o             =>ben_cmd_shd.g_old_rec.cmd_attribute15
285  ,p_cmd_attribute16_o             =>ben_cmd_shd.g_old_rec.cmd_attribute16
286  ,p_cmd_attribute17_o             =>ben_cmd_shd.g_old_rec.cmd_attribute17
287  ,p_cmd_attribute18_o             =>ben_cmd_shd.g_old_rec.cmd_attribute18
288  ,p_cmd_attribute19_o             =>ben_cmd_shd.g_old_rec.cmd_attribute19
289  ,p_cmd_attribute20_o             =>ben_cmd_shd.g_old_rec.cmd_attribute20
290  ,p_cmd_attribute21_o             =>ben_cmd_shd.g_old_rec.cmd_attribute21
291  ,p_cmd_attribute22_o             =>ben_cmd_shd.g_old_rec.cmd_attribute22
292  ,p_cmd_attribute23_o             =>ben_cmd_shd.g_old_rec.cmd_attribute23
293  ,p_cmd_attribute24_o             =>ben_cmd_shd.g_old_rec.cmd_attribute24
294  ,p_cmd_attribute25_o             =>ben_cmd_shd.g_old_rec.cmd_attribute25
295  ,p_cmd_attribute26_o             =>ben_cmd_shd.g_old_rec.cmd_attribute26
296  ,p_cmd_attribute27_o             =>ben_cmd_shd.g_old_rec.cmd_attribute27
297  ,p_cmd_attribute28_o             =>ben_cmd_shd.g_old_rec.cmd_attribute28
298  ,p_cmd_attribute29_o             =>ben_cmd_shd.g_old_rec.cmd_attribute29
299  ,p_cmd_attribute30_o             =>ben_cmd_shd.g_old_rec.cmd_attribute30
300  ,p_object_version_number_o       =>ben_cmd_shd.g_old_rec.object_version_number
301       );
302     --
303   exception
304     --
305     when hr_api.cannot_find_prog_unit then
306       --
307       hr_api.cannot_find_prog_unit_error
308         (p_module_name => 'ben_cm_dlvry_med_typ'
309         ,p_hook_type   => 'AU');
310       --
311   end;
312   --
313   -- End of API User Hook for post_update.
314   --
315   --
316   hr_utility.set_location(' Leaving:'||l_proc, 10);
317 End post_update;
318 --
319 -- ----------------------------------------------------------------------------
320 -- |-----------------------------< convert_defs >-----------------------------|
321 -- ----------------------------------------------------------------------------
322 -- {Start Of Comments}
323 --
324 -- Description:
325 --   The Convert_Defs procedure has one very important function:
326 --   It must return the record structure for the row with all system defaulted
327 --   values converted into its corresponding parameter value for update. When
328 --   we attempt to update a row through the Upd process , certain
329 --   parameters can be defaulted which enables flexibility in the calling of
330 --   the upd process (e.g. only attributes which need to be updated need to be
331 --   specified). For the upd process to determine which attributes
332 --   have NOT been specified we need to check if the parameter has a reserved
333 --   system default value. Therefore, for all parameters which have a
334 --   corresponding reserved system default mechanism specified we need to
335 --   check if a system default is being used. If a system default is being
336 --   used then we convert the defaulted value into its corresponding attribute
337 --   value held in the g_old_rec data structure.
338 --
339 -- Prerequisites:
340 --   This private function can only be called from the upd process.
341 --
342 -- In Parameters:
343 --   A Pl/Sql record structre.
344 --
345 -- Post Success:
346 --   The record structure will be returned with all system defaulted parameter
347 --   values converted into its current row attribute value.
348 --
349 -- Post Failure:
350 --   No direct error handling is required within this function. Any possible
351 --   errors within this procedure will be a PL/SQL value error due to conversion
352 --   of datatypes or data lengths.
353 --
354 -- Developer Implementation Notes:
355 --   None.
356 --
357 -- Access Status:
358 --   Internal Row Handler Use Only.
359 --
360 -- {End Of Comments}
361 -- ----------------------------------------------------------------------------
362 Procedure convert_defs(p_rec in out nocopy ben_cmd_shd.g_rec_type) is
363 --
364   l_proc  varchar2(72) := g_package||'convert_defs';
365 --
366 Begin
367   --
368   hr_utility.set_location('Entering:'||l_proc, 5);
369   --
370   -- We must now examine each argument value in the
371   -- p_rec plsql record structure
372   -- to see if a system default is being used. If a system default
373   -- is being used then we must set to the 'current' argument value.
374   --
375   If (p_rec.cm_dlvry_med_typ_cd = hr_api.g_varchar2) then
376     p_rec.cm_dlvry_med_typ_cd :=
377     ben_cmd_shd.g_old_rec.cm_dlvry_med_typ_cd;
378   End If;
379   If (p_rec.cm_dlvry_mthd_typ_id = hr_api.g_number) then
380     p_rec.cm_dlvry_mthd_typ_id :=
381     ben_cmd_shd.g_old_rec.cm_dlvry_mthd_typ_id;
382   End If;
383   If (p_rec.rqd_flag = hr_api.g_varchar2) then
384     p_rec.rqd_flag :=
385     ben_cmd_shd.g_old_rec.rqd_flag;
386   End If;
387   If (p_rec.dflt_flag = hr_api.g_varchar2) then
388     p_rec.dflt_flag :=
389     ben_cmd_shd.g_old_rec.dflt_flag;
390   End If;
391   If (p_rec.business_group_id = hr_api.g_number) then
392     p_rec.business_group_id :=
393     ben_cmd_shd.g_old_rec.business_group_id;
394   End If;
395   If (p_rec.cmd_attribute_category = hr_api.g_varchar2) then
396     p_rec.cmd_attribute_category :=
397     ben_cmd_shd.g_old_rec.cmd_attribute_category;
398   End If;
399   If (p_rec.cmd_attribute1 = hr_api.g_varchar2) then
400     p_rec.cmd_attribute1 :=
401     ben_cmd_shd.g_old_rec.cmd_attribute1;
402   End If;
403   If (p_rec.cmd_attribute2 = hr_api.g_varchar2) then
404     p_rec.cmd_attribute2 :=
405     ben_cmd_shd.g_old_rec.cmd_attribute2;
406   End If;
407   If (p_rec.cmd_attribute3 = hr_api.g_varchar2) then
408     p_rec.cmd_attribute3 :=
409     ben_cmd_shd.g_old_rec.cmd_attribute3;
410   End If;
411   If (p_rec.cmd_attribute4 = hr_api.g_varchar2) then
412     p_rec.cmd_attribute4 :=
413     ben_cmd_shd.g_old_rec.cmd_attribute4;
414   End If;
415   If (p_rec.cmd_attribute5 = hr_api.g_varchar2) then
416     p_rec.cmd_attribute5 :=
417     ben_cmd_shd.g_old_rec.cmd_attribute5;
418   End If;
419   If (p_rec.cmd_attribute6 = hr_api.g_varchar2) then
420     p_rec.cmd_attribute6 :=
421     ben_cmd_shd.g_old_rec.cmd_attribute6;
422   End If;
423   If (p_rec.cmd_attribute7 = hr_api.g_varchar2) then
424     p_rec.cmd_attribute7 :=
425     ben_cmd_shd.g_old_rec.cmd_attribute7;
426   End If;
427   If (p_rec.cmd_attribute8 = hr_api.g_varchar2) then
428     p_rec.cmd_attribute8 :=
429     ben_cmd_shd.g_old_rec.cmd_attribute8;
430   End If;
431   If (p_rec.cmd_attribute9 = hr_api.g_varchar2) then
432     p_rec.cmd_attribute9 :=
433     ben_cmd_shd.g_old_rec.cmd_attribute9;
434   End If;
435   If (p_rec.cmd_attribute10 = hr_api.g_varchar2) then
436     p_rec.cmd_attribute10 :=
437     ben_cmd_shd.g_old_rec.cmd_attribute10;
438   End If;
439   If (p_rec.cmd_attribute11 = hr_api.g_varchar2) then
440     p_rec.cmd_attribute11 :=
441     ben_cmd_shd.g_old_rec.cmd_attribute11;
442   End If;
443   If (p_rec.cmd_attribute12 = hr_api.g_varchar2) then
444     p_rec.cmd_attribute12 :=
445     ben_cmd_shd.g_old_rec.cmd_attribute12;
446   End If;
447   If (p_rec.cmd_attribute13 = hr_api.g_varchar2) then
448     p_rec.cmd_attribute13 :=
449     ben_cmd_shd.g_old_rec.cmd_attribute13;
450   End If;
451   If (p_rec.cmd_attribute14 = hr_api.g_varchar2) then
452     p_rec.cmd_attribute14 :=
453     ben_cmd_shd.g_old_rec.cmd_attribute14;
454   End If;
455   If (p_rec.cmd_attribute15 = hr_api.g_varchar2) then
456     p_rec.cmd_attribute15 :=
457     ben_cmd_shd.g_old_rec.cmd_attribute15;
458   End If;
459   If (p_rec.cmd_attribute16 = hr_api.g_varchar2) then
460     p_rec.cmd_attribute16 :=
461     ben_cmd_shd.g_old_rec.cmd_attribute16;
462   End If;
463   If (p_rec.cmd_attribute17 = hr_api.g_varchar2) then
464     p_rec.cmd_attribute17 :=
465     ben_cmd_shd.g_old_rec.cmd_attribute17;
466   End If;
467   If (p_rec.cmd_attribute18 = hr_api.g_varchar2) then
468     p_rec.cmd_attribute18 :=
469     ben_cmd_shd.g_old_rec.cmd_attribute18;
470   End If;
471   If (p_rec.cmd_attribute19 = hr_api.g_varchar2) then
472     p_rec.cmd_attribute19 :=
473     ben_cmd_shd.g_old_rec.cmd_attribute19;
474   End If;
475   If (p_rec.cmd_attribute20 = hr_api.g_varchar2) then
476     p_rec.cmd_attribute20 :=
477     ben_cmd_shd.g_old_rec.cmd_attribute20;
478   End If;
479   If (p_rec.cmd_attribute21 = hr_api.g_varchar2) then
480     p_rec.cmd_attribute21 :=
481     ben_cmd_shd.g_old_rec.cmd_attribute21;
482   End If;
483   If (p_rec.cmd_attribute22 = hr_api.g_varchar2) then
484     p_rec.cmd_attribute22 :=
485     ben_cmd_shd.g_old_rec.cmd_attribute22;
486   End If;
487   If (p_rec.cmd_attribute23 = hr_api.g_varchar2) then
488     p_rec.cmd_attribute23 :=
489     ben_cmd_shd.g_old_rec.cmd_attribute23;
490   End If;
491   If (p_rec.cmd_attribute24 = hr_api.g_varchar2) then
492     p_rec.cmd_attribute24 :=
493     ben_cmd_shd.g_old_rec.cmd_attribute24;
494   End If;
495   If (p_rec.cmd_attribute25 = hr_api.g_varchar2) then
496     p_rec.cmd_attribute25 :=
497     ben_cmd_shd.g_old_rec.cmd_attribute25;
498   End If;
499   If (p_rec.cmd_attribute26 = hr_api.g_varchar2) then
500     p_rec.cmd_attribute26 :=
501     ben_cmd_shd.g_old_rec.cmd_attribute26;
502   End If;
503   If (p_rec.cmd_attribute27 = hr_api.g_varchar2) then
504     p_rec.cmd_attribute27 :=
505     ben_cmd_shd.g_old_rec.cmd_attribute27;
506   End If;
507   If (p_rec.cmd_attribute28 = hr_api.g_varchar2) then
508     p_rec.cmd_attribute28 :=
509     ben_cmd_shd.g_old_rec.cmd_attribute28;
510   End If;
511   If (p_rec.cmd_attribute29 = hr_api.g_varchar2) then
512     p_rec.cmd_attribute29 :=
513     ben_cmd_shd.g_old_rec.cmd_attribute29;
514   End If;
515   If (p_rec.cmd_attribute30 = hr_api.g_varchar2) then
516     p_rec.cmd_attribute30 :=
517     ben_cmd_shd.g_old_rec.cmd_attribute30;
518   End If;
519 
520   --
521   hr_utility.set_location(' Leaving:'||l_proc, 10);
522 --
523 End convert_defs;
524 --
525 -- ----------------------------------------------------------------------------
526 -- |---------------------------------< upd >----------------------------------|
527 -- ----------------------------------------------------------------------------
528 Procedure upd
529   (
530   p_effective_date in date,
531   p_rec        in out nocopy ben_cmd_shd.g_rec_type
532   ) is
533 --
534   l_proc  varchar2(72) := g_package||'upd';
535 --
536 Begin
537   hr_utility.set_location('Entering:'||l_proc, 5);
538   --
539   -- We must lock the row which we need to update.
540   --
541   ben_cmd_shd.lck
542 	(
543 	p_rec.cm_dlvry_med_typ_id,
544 	p_rec.object_version_number
545 	);
546   --
547   -- 1. During an update system defaults are used to determine if
548   --    arguments have been defaulted or not. We must therefore
549   --    derive the full record structure values to be updated.
550   --
551   -- 2. Call the supporting update validate operations.
552   --
553   convert_defs(p_rec);
554   ben_cmd_bus.update_validate(p_rec
555   ,p_effective_date);
556   --
557   -- Call the supporting pre-update operation
558   --
559   pre_update(p_rec);
560   --
561   -- Update the row.
562   --
563   update_dml(p_rec);
564   --
565   -- Call the supporting post-update operation
566   --
567   post_update(
568 p_effective_date,p_rec);
569 End upd;
570 --
571 -- ----------------------------------------------------------------------------
572 -- |---------------------------------< upd >----------------------------------|
573 -- ----------------------------------------------------------------------------
574 Procedure upd
575   (
576   p_effective_date in date,
577   p_cm_dlvry_med_typ_id          in number,
578   p_cm_dlvry_med_typ_cd          in varchar2         default hr_api.g_varchar2,
579   p_cm_dlvry_mthd_typ_id         in number           default hr_api.g_number,
580   p_rqd_flag                     in varchar2         default hr_api.g_varchar2,
581   p_dflt_flag                    in varchar2         default hr_api.g_varchar2,
582   p_business_group_id            in number           default hr_api.g_number,
583   p_cmd_attribute_category       in varchar2         default hr_api.g_varchar2,
584   p_cmd_attribute1               in varchar2         default hr_api.g_varchar2,
585   p_cmd_attribute2               in varchar2         default hr_api.g_varchar2,
586   p_cmd_attribute3               in varchar2         default hr_api.g_varchar2,
587   p_cmd_attribute4               in varchar2         default hr_api.g_varchar2,
588   p_cmd_attribute5               in varchar2         default hr_api.g_varchar2,
589   p_cmd_attribute6               in varchar2         default hr_api.g_varchar2,
590   p_cmd_attribute7               in varchar2         default hr_api.g_varchar2,
591   p_cmd_attribute8               in varchar2         default hr_api.g_varchar2,
592   p_cmd_attribute9               in varchar2         default hr_api.g_varchar2,
593   p_cmd_attribute10              in varchar2         default hr_api.g_varchar2,
594   p_cmd_attribute11              in varchar2         default hr_api.g_varchar2,
595   p_cmd_attribute12              in varchar2         default hr_api.g_varchar2,
596   p_cmd_attribute13              in varchar2         default hr_api.g_varchar2,
597   p_cmd_attribute14              in varchar2         default hr_api.g_varchar2,
598   p_cmd_attribute15              in varchar2         default hr_api.g_varchar2,
599   p_cmd_attribute16              in varchar2         default hr_api.g_varchar2,
600   p_cmd_attribute17              in varchar2         default hr_api.g_varchar2,
601   p_cmd_attribute18              in varchar2         default hr_api.g_varchar2,
602   p_cmd_attribute19              in varchar2         default hr_api.g_varchar2,
603   p_cmd_attribute20              in varchar2         default hr_api.g_varchar2,
604   p_cmd_attribute21              in varchar2         default hr_api.g_varchar2,
605   p_cmd_attribute22              in varchar2         default hr_api.g_varchar2,
606   p_cmd_attribute23              in varchar2         default hr_api.g_varchar2,
607   p_cmd_attribute24              in varchar2         default hr_api.g_varchar2,
608   p_cmd_attribute25              in varchar2         default hr_api.g_varchar2,
609   p_cmd_attribute26              in varchar2         default hr_api.g_varchar2,
610   p_cmd_attribute27              in varchar2         default hr_api.g_varchar2,
611   p_cmd_attribute28              in varchar2         default hr_api.g_varchar2,
612   p_cmd_attribute29              in varchar2         default hr_api.g_varchar2,
613   p_cmd_attribute30              in varchar2         default hr_api.g_varchar2,
614   p_object_version_number        in out nocopy number
615   ) is
616 --
617   l_rec	  ben_cmd_shd.g_rec_type;
618   l_proc  varchar2(72) := g_package||'upd';
619 --
620 Begin
621   hr_utility.set_location('Entering:'||l_proc, 5);
622   --
623   -- Call conversion function to turn arguments into the
624   -- l_rec structure.
625   --
626   l_rec :=
627   ben_cmd_shd.convert_args
628   (
629   p_cm_dlvry_med_typ_id,
630   p_cm_dlvry_med_typ_cd,
631   p_cm_dlvry_mthd_typ_id,
632   p_rqd_flag,
633   p_dflt_flag,
634   p_business_group_id,
635   p_cmd_attribute_category,
636   p_cmd_attribute1,
637   p_cmd_attribute2,
638   p_cmd_attribute3,
639   p_cmd_attribute4,
640   p_cmd_attribute5,
641   p_cmd_attribute6,
642   p_cmd_attribute7,
643   p_cmd_attribute8,
644   p_cmd_attribute9,
645   p_cmd_attribute10,
646   p_cmd_attribute11,
647   p_cmd_attribute12,
648   p_cmd_attribute13,
649   p_cmd_attribute14,
650   p_cmd_attribute15,
651   p_cmd_attribute16,
652   p_cmd_attribute17,
653   p_cmd_attribute18,
654   p_cmd_attribute19,
655   p_cmd_attribute20,
656   p_cmd_attribute21,
657   p_cmd_attribute22,
658   p_cmd_attribute23,
659   p_cmd_attribute24,
660   p_cmd_attribute25,
661   p_cmd_attribute26,
662   p_cmd_attribute27,
663   p_cmd_attribute28,
664   p_cmd_attribute29,
665   p_cmd_attribute30,
666   p_object_version_number
667   );
668   --
669   -- Having converted the arguments into the
670   -- plsql record structure we call the corresponding record
671   -- business process.
672   --
673   upd(
674     p_effective_date,l_rec);
675   p_object_version_number := l_rec.object_version_number;
676   --
677   hr_utility.set_location(' Leaving:'||l_proc, 10);
678 End upd;
679 --
680 end ben_cmd_upd;