DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_CRD_UPD

Source


1 Package Body ben_crd_upd as
2 /* $Header: becrdrhi.pkb 115.4 2002/12/16 11:03:52 rpgupta ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ben_crd_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_crd_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_crd_shd.g_api_dml := true;  -- Set the api dml status
66   --
67   -- Update the ben_crt_ordr_cvrd_per Row
68   --
69   update ben_crt_ordr_cvrd_per
70   set
71   crt_ordr_cvrd_per_id              = p_rec.crt_ordr_cvrd_per_id,
72   crt_ordr_id                       = p_rec.crt_ordr_id,
73   person_id                         = p_rec.person_id,
74   business_group_id                 = p_rec.business_group_id,
75   crd_attribute_category            = p_rec.crd_attribute_category,
76   crd_attribute1                    = p_rec.crd_attribute1,
77   crd_attribute2                    = p_rec.crd_attribute2,
78   crd_attribute3                    = p_rec.crd_attribute3,
79   crd_attribute4                    = p_rec.crd_attribute4,
80   crd_attribute5                    = p_rec.crd_attribute5,
81   crd_attribute6                    = p_rec.crd_attribute6,
82   crd_attribute7                    = p_rec.crd_attribute7,
83   crd_attribute8                    = p_rec.crd_attribute8,
84   crd_attribute9                    = p_rec.crd_attribute9,
85   crd_attribute10                   = p_rec.crd_attribute10,
86   crd_attribute11                   = p_rec.crd_attribute11,
87   crd_attribute12                   = p_rec.crd_attribute12,
88   crd_attribute13                   = p_rec.crd_attribute13,
89   crd_attribute14                   = p_rec.crd_attribute14,
90   crd_attribute15                   = p_rec.crd_attribute15,
91   crd_attribute16                   = p_rec.crd_attribute16,
92   crd_attribute17                   = p_rec.crd_attribute17,
93   crd_attribute18                   = p_rec.crd_attribute18,
94   crd_attribute19                   = p_rec.crd_attribute19,
95   crd_attribute20                   = p_rec.crd_attribute20,
96   crd_attribute21                   = p_rec.crd_attribute21,
97   crd_attribute22                   = p_rec.crd_attribute22,
98   crd_attribute23                   = p_rec.crd_attribute23,
99   crd_attribute24                   = p_rec.crd_attribute24,
100   crd_attribute25                   = p_rec.crd_attribute25,
101   crd_attribute26                   = p_rec.crd_attribute26,
102   crd_attribute27                   = p_rec.crd_attribute27,
103   crd_attribute28                   = p_rec.crd_attribute28,
104   crd_attribute29                   = p_rec.crd_attribute29,
105   crd_attribute30                   = p_rec.crd_attribute30,
106   object_version_number             = p_rec.object_version_number
107   where crt_ordr_cvrd_per_id = p_rec.crt_ordr_cvrd_per_id;
108   --
109   ben_crd_shd.g_api_dml := false;   -- Unset the api dml status
110   --
111   hr_utility.set_location(' Leaving:'||l_proc, 10);
112 --
113 Exception
114   When hr_api.check_integrity_violated Then
115     -- A check constraint has been violated
116     ben_crd_shd.g_api_dml := false;   -- Unset the api dml status
117     ben_crd_shd.constraint_error
118       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
119   When hr_api.parent_integrity_violated Then
120     -- Parent integrity has been violated
121     ben_crd_shd.g_api_dml := false;   -- Unset the api dml status
122     ben_crd_shd.constraint_error
123       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
124   When hr_api.unique_integrity_violated Then
125     -- Unique integrity has been violated
126     ben_crd_shd.g_api_dml := false;   -- Unset the api dml status
127     ben_crd_shd.constraint_error
128       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
129   When Others Then
130     ben_crd_shd.g_api_dml := false;   -- Unset the api dml status
131     Raise;
132 End update_dml;
133 --
134 -- ----------------------------------------------------------------------------
135 -- |------------------------------< pre_update >------------------------------|
136 -- ----------------------------------------------------------------------------
137 -- {Start Of Comments}
138 --
139 -- Description:
140 --   This private procedure contains any processing which is required before
141 --   the update dml.
142 --
143 -- Prerequisites:
144 --   This is an internal procedure which is called from the upd procedure.
145 --
146 -- In Parameters:
147 --   A Pl/Sql record structre.
148 --
149 -- Post Success:
150 --   Processing continues.
151 --
152 -- Post Failure:
153 --   If an error has occurred, an error message and exception will be raised
154 --   but not handled.
155 --
156 -- Developer Implementation Notes:
157 --   Any pre-processing required before the update dml is issued should be
158 --   coded within this procedure. It is important to note that any 3rd party
159 --   maintenance should be reviewed before placing in this procedure.
160 --
161 -- Access Status:
162 --   Internal Row Handler Use Only.
163 --
164 -- {End Of Comments}
165 -- ----------------------------------------------------------------------------
166 Procedure pre_update(p_rec in ben_crd_shd.g_rec_type) is
167 --
168   l_proc  varchar2(72) := g_package||'pre_update';
169 --
170 Begin
171   hr_utility.set_location('Entering:'||l_proc, 5);
172   --
173   hr_utility.set_location(' Leaving:'||l_proc, 10);
174 End pre_update;
175 --
176 -- ----------------------------------------------------------------------------
177 -- |-----------------------------< post_update >------------------------------|
178 -- ----------------------------------------------------------------------------
179 -- {Start Of Comments}
180 --
181 -- Description:
182 --   This private procedure contains any processing which is required after the
183 --   update dml.
184 --
185 -- Prerequisites:
186 --   This is an internal procedure which is called from the upd procedure.
187 --
188 -- In Parameters:
189 --   A Pl/Sql record structre.
190 --
191 -- Post Success:
192 --   Processing continues.
193 --
194 -- Post Failure:
195 --   If an error has occurred, an error message and exception will be raised
196 --   but not handled.
197 --
198 -- Developer Implementation Notes:
199 --   Any post-processing required after the update dml is issued should be
200 --   coded within this procedure. It is important to note that any 3rd party
201 --   maintenance should be reviewed before placing in this procedure.
202 --
203 -- Access Status:
204 --   Internal Row Handler Use Only.
205 --
206 -- {End Of Comments}
207 -- ----------------------------------------------------------------------------
208 Procedure post_update(p_rec in ben_crd_shd.g_rec_type) is
209 --
210   l_proc  varchar2(72) := g_package||'post_update';
211 --
212 Begin
213   hr_utility.set_location('Entering:'||l_proc, 5);
214 --
215   --
216   -- Start of API User Hook for post_update.
217   --
218   begin
219     --
220     ben_crd_rku.after_update
221       (
222   p_crt_ordr_cvrd_per_id          =>p_rec.crt_ordr_cvrd_per_id
223  ,p_crt_ordr_id                   =>p_rec.crt_ordr_id
224  ,p_person_id                     =>p_rec.person_id
225  ,p_business_group_id             =>p_rec.business_group_id
226  ,p_crd_attribute_category        =>p_rec.crd_attribute_category
227  ,p_crd_attribute1                =>p_rec.crd_attribute1
228  ,p_crd_attribute2                =>p_rec.crd_attribute2
229  ,p_crd_attribute3                =>p_rec.crd_attribute3
230  ,p_crd_attribute4                =>p_rec.crd_attribute4
231  ,p_crd_attribute5                =>p_rec.crd_attribute5
232  ,p_crd_attribute6                =>p_rec.crd_attribute6
233  ,p_crd_attribute7                =>p_rec.crd_attribute7
234  ,p_crd_attribute8                =>p_rec.crd_attribute8
235  ,p_crd_attribute9                =>p_rec.crd_attribute9
236  ,p_crd_attribute10               =>p_rec.crd_attribute10
237  ,p_crd_attribute11               =>p_rec.crd_attribute11
238  ,p_crd_attribute12               =>p_rec.crd_attribute12
239  ,p_crd_attribute13               =>p_rec.crd_attribute13
240  ,p_crd_attribute14               =>p_rec.crd_attribute14
241  ,p_crd_attribute15               =>p_rec.crd_attribute15
242  ,p_crd_attribute16               =>p_rec.crd_attribute16
243  ,p_crd_attribute17               =>p_rec.crd_attribute17
244  ,p_crd_attribute18               =>p_rec.crd_attribute18
245  ,p_crd_attribute19               =>p_rec.crd_attribute19
246  ,p_crd_attribute20               =>p_rec.crd_attribute20
247  ,p_crd_attribute21               =>p_rec.crd_attribute21
248  ,p_crd_attribute22               =>p_rec.crd_attribute22
249  ,p_crd_attribute23               =>p_rec.crd_attribute23
250  ,p_crd_attribute24               =>p_rec.crd_attribute24
251  ,p_crd_attribute25               =>p_rec.crd_attribute25
252  ,p_crd_attribute26               =>p_rec.crd_attribute26
253  ,p_crd_attribute27               =>p_rec.crd_attribute27
254  ,p_crd_attribute28               =>p_rec.crd_attribute28
255  ,p_crd_attribute29               =>p_rec.crd_attribute29
256  ,p_crd_attribute30               =>p_rec.crd_attribute30
257  ,p_object_version_number         =>p_rec.object_version_number
258  ,p_crt_ordr_id_o                 =>ben_crd_shd.g_old_rec.crt_ordr_id
259  ,p_person_id_o                   =>ben_crd_shd.g_old_rec.person_id
260  ,p_business_group_id_o           =>ben_crd_shd.g_old_rec.business_group_id
261  ,p_crd_attribute_category_o      =>ben_crd_shd.g_old_rec.crd_attribute_category
262  ,p_crd_attribute1_o              =>ben_crd_shd.g_old_rec.crd_attribute1
263  ,p_crd_attribute2_o              =>ben_crd_shd.g_old_rec.crd_attribute2
264  ,p_crd_attribute3_o              =>ben_crd_shd.g_old_rec.crd_attribute3
265  ,p_crd_attribute4_o              =>ben_crd_shd.g_old_rec.crd_attribute4
266  ,p_crd_attribute5_o              =>ben_crd_shd.g_old_rec.crd_attribute5
267  ,p_crd_attribute6_o              =>ben_crd_shd.g_old_rec.crd_attribute6
268  ,p_crd_attribute7_o              =>ben_crd_shd.g_old_rec.crd_attribute7
269  ,p_crd_attribute8_o              =>ben_crd_shd.g_old_rec.crd_attribute8
270  ,p_crd_attribute9_o              =>ben_crd_shd.g_old_rec.crd_attribute9
271  ,p_crd_attribute10_o             =>ben_crd_shd.g_old_rec.crd_attribute10
272  ,p_crd_attribute11_o             =>ben_crd_shd.g_old_rec.crd_attribute11
273  ,p_crd_attribute12_o             =>ben_crd_shd.g_old_rec.crd_attribute12
274  ,p_crd_attribute13_o             =>ben_crd_shd.g_old_rec.crd_attribute13
275  ,p_crd_attribute14_o             =>ben_crd_shd.g_old_rec.crd_attribute14
276  ,p_crd_attribute15_o             =>ben_crd_shd.g_old_rec.crd_attribute15
277  ,p_crd_attribute16_o             =>ben_crd_shd.g_old_rec.crd_attribute16
278  ,p_crd_attribute17_o             =>ben_crd_shd.g_old_rec.crd_attribute17
279  ,p_crd_attribute18_o             =>ben_crd_shd.g_old_rec.crd_attribute18
280  ,p_crd_attribute19_o             =>ben_crd_shd.g_old_rec.crd_attribute19
281  ,p_crd_attribute20_o             =>ben_crd_shd.g_old_rec.crd_attribute20
282  ,p_crd_attribute21_o             =>ben_crd_shd.g_old_rec.crd_attribute21
283  ,p_crd_attribute22_o             =>ben_crd_shd.g_old_rec.crd_attribute22
284  ,p_crd_attribute23_o             =>ben_crd_shd.g_old_rec.crd_attribute23
285  ,p_crd_attribute24_o             =>ben_crd_shd.g_old_rec.crd_attribute24
286  ,p_crd_attribute25_o             =>ben_crd_shd.g_old_rec.crd_attribute25
287  ,p_crd_attribute26_o             =>ben_crd_shd.g_old_rec.crd_attribute26
288  ,p_crd_attribute27_o             =>ben_crd_shd.g_old_rec.crd_attribute27
289  ,p_crd_attribute28_o             =>ben_crd_shd.g_old_rec.crd_attribute28
290  ,p_crd_attribute29_o             =>ben_crd_shd.g_old_rec.crd_attribute29
291  ,p_crd_attribute30_o             =>ben_crd_shd.g_old_rec.crd_attribute30
292  ,p_object_version_number_o       =>ben_crd_shd.g_old_rec.object_version_number
293       );
294     --
295   exception
296     --
297     when hr_api.cannot_find_prog_unit then
298       --
299       hr_api.cannot_find_prog_unit_error
300         (p_module_name => 'ben_crt_ordr_cvrd_per'
301         ,p_hook_type   => 'AU');
302       --
303   end;
304   --
305   -- End of API User Hook for post_update.
306   --
307   --
308   hr_utility.set_location(' Leaving:'||l_proc, 10);
309 End post_update;
310 --
311 -- ----------------------------------------------------------------------------
312 -- |-----------------------------< convert_defs >-----------------------------|
313 -- ----------------------------------------------------------------------------
314 -- {Start Of Comments}
315 --
316 -- Description:
317 --   The Convert_Defs procedure has one very important function:
318 --   It must return the record structure for the row with all system defaulted
319 --   values converted into its corresponding parameter value for update. When
320 --   we attempt to update a row through the Upd process , certain
321 --   parameters can be defaulted which enables flexibility in the calling of
322 --   the upd process (e.g. only attributes which need to be updated need to be
323 --   specified). For the upd process to determine which attributes
324 --   have NOT been specified we need to check if the parameter has a reserved
325 --   system default value. Therefore, for all parameters which have a
326 --   corresponding reserved system default mechanism specified we need to
327 --   check if a system default is being used. If a system default is being
328 --   used then we convert the defaulted value into its corresponding attribute
329 --   value held in the g_old_rec data structure.
330 --
331 -- Prerequisites:
332 --   This private function can only be called from the upd process.
333 --
334 -- In Parameters:
335 --   A Pl/Sql record structre.
336 --
337 -- Post Success:
338 --   The record structure will be returned with all system defaulted parameter
339 --   values converted into its current row attribute value.
340 --
341 -- Post Failure:
342 --   No direct error handling is required within this function. Any possible
343 --   errors within this procedure will be a PL/SQL value error due to conversion
344 --   of datatypes or data lengths.
345 --
346 -- Developer Implementation Notes:
347 --   None.
348 --
349 -- Access Status:
350 --   Internal Row Handler Use Only.
351 --
352 -- {End Of Comments}
353 -- ----------------------------------------------------------------------------
354 Procedure convert_defs(p_rec in out nocopy ben_crd_shd.g_rec_type) is
355 --
356   l_proc  varchar2(72) := g_package||'convert_defs';
357 --
358 Begin
359   --
360   hr_utility.set_location('Entering:'||l_proc, 5);
361   --
362   -- We must now examine each argument value in the
363   -- p_rec plsql record structure
364   -- to see if a system default is being used. If a system default
365   -- is being used then we must set to the 'current' argument value.
366   --
367   If (p_rec.crt_ordr_id = hr_api.g_number) then
368     p_rec.crt_ordr_id :=
369     ben_crd_shd.g_old_rec.crt_ordr_id;
370   End If;
371   If (p_rec.person_id = hr_api.g_number) then
372     p_rec.person_id :=
373     ben_crd_shd.g_old_rec.person_id;
374   End If;
375   If (p_rec.business_group_id = hr_api.g_number) then
376     p_rec.business_group_id :=
377     ben_crd_shd.g_old_rec.business_group_id;
378   End If;
379   If (p_rec.crd_attribute_category = hr_api.g_varchar2) then
380     p_rec.crd_attribute_category :=
381     ben_crd_shd.g_old_rec.crd_attribute_category;
382   End If;
383   If (p_rec.crd_attribute1 = hr_api.g_varchar2) then
384     p_rec.crd_attribute1 :=
385     ben_crd_shd.g_old_rec.crd_attribute1;
386   End If;
387   If (p_rec.crd_attribute2 = hr_api.g_varchar2) then
388     p_rec.crd_attribute2 :=
389     ben_crd_shd.g_old_rec.crd_attribute2;
390   End If;
391   If (p_rec.crd_attribute3 = hr_api.g_varchar2) then
392     p_rec.crd_attribute3 :=
393     ben_crd_shd.g_old_rec.crd_attribute3;
394   End If;
395   If (p_rec.crd_attribute4 = hr_api.g_varchar2) then
396     p_rec.crd_attribute4 :=
397     ben_crd_shd.g_old_rec.crd_attribute4;
398   End If;
399   If (p_rec.crd_attribute5 = hr_api.g_varchar2) then
400     p_rec.crd_attribute5 :=
401     ben_crd_shd.g_old_rec.crd_attribute5;
402   End If;
403   If (p_rec.crd_attribute6 = hr_api.g_varchar2) then
404     p_rec.crd_attribute6 :=
405     ben_crd_shd.g_old_rec.crd_attribute6;
406   End If;
407   If (p_rec.crd_attribute7 = hr_api.g_varchar2) then
408     p_rec.crd_attribute7 :=
409     ben_crd_shd.g_old_rec.crd_attribute7;
410   End If;
411   If (p_rec.crd_attribute8 = hr_api.g_varchar2) then
412     p_rec.crd_attribute8 :=
413     ben_crd_shd.g_old_rec.crd_attribute8;
414   End If;
415   If (p_rec.crd_attribute9 = hr_api.g_varchar2) then
416     p_rec.crd_attribute9 :=
417     ben_crd_shd.g_old_rec.crd_attribute9;
418   End If;
419   If (p_rec.crd_attribute10 = hr_api.g_varchar2) then
420     p_rec.crd_attribute10 :=
421     ben_crd_shd.g_old_rec.crd_attribute10;
422   End If;
423   If (p_rec.crd_attribute11 = hr_api.g_varchar2) then
424     p_rec.crd_attribute11 :=
425     ben_crd_shd.g_old_rec.crd_attribute11;
426   End If;
427   If (p_rec.crd_attribute12 = hr_api.g_varchar2) then
428     p_rec.crd_attribute12 :=
429     ben_crd_shd.g_old_rec.crd_attribute12;
430   End If;
431   If (p_rec.crd_attribute13 = hr_api.g_varchar2) then
432     p_rec.crd_attribute13 :=
433     ben_crd_shd.g_old_rec.crd_attribute13;
434   End If;
435   If (p_rec.crd_attribute14 = hr_api.g_varchar2) then
436     p_rec.crd_attribute14 :=
437     ben_crd_shd.g_old_rec.crd_attribute14;
438   End If;
439   If (p_rec.crd_attribute15 = hr_api.g_varchar2) then
440     p_rec.crd_attribute15 :=
441     ben_crd_shd.g_old_rec.crd_attribute15;
442   End If;
443   If (p_rec.crd_attribute16 = hr_api.g_varchar2) then
444     p_rec.crd_attribute16 :=
445     ben_crd_shd.g_old_rec.crd_attribute16;
446   End If;
447   If (p_rec.crd_attribute17 = hr_api.g_varchar2) then
448     p_rec.crd_attribute17 :=
449     ben_crd_shd.g_old_rec.crd_attribute17;
450   End If;
451   If (p_rec.crd_attribute18 = hr_api.g_varchar2) then
452     p_rec.crd_attribute18 :=
453     ben_crd_shd.g_old_rec.crd_attribute18;
454   End If;
455   If (p_rec.crd_attribute19 = hr_api.g_varchar2) then
456     p_rec.crd_attribute19 :=
457     ben_crd_shd.g_old_rec.crd_attribute19;
458   End If;
459   If (p_rec.crd_attribute20 = hr_api.g_varchar2) then
460     p_rec.crd_attribute20 :=
461     ben_crd_shd.g_old_rec.crd_attribute20;
462   End If;
463   If (p_rec.crd_attribute21 = hr_api.g_varchar2) then
464     p_rec.crd_attribute21 :=
465     ben_crd_shd.g_old_rec.crd_attribute21;
466   End If;
467   If (p_rec.crd_attribute22 = hr_api.g_varchar2) then
468     p_rec.crd_attribute22 :=
469     ben_crd_shd.g_old_rec.crd_attribute22;
470   End If;
471   If (p_rec.crd_attribute23 = hr_api.g_varchar2) then
472     p_rec.crd_attribute23 :=
473     ben_crd_shd.g_old_rec.crd_attribute23;
474   End If;
475   If (p_rec.crd_attribute24 = hr_api.g_varchar2) then
476     p_rec.crd_attribute24 :=
477     ben_crd_shd.g_old_rec.crd_attribute24;
478   End If;
479   If (p_rec.crd_attribute25 = hr_api.g_varchar2) then
480     p_rec.crd_attribute25 :=
481     ben_crd_shd.g_old_rec.crd_attribute25;
482   End If;
483   If (p_rec.crd_attribute26 = hr_api.g_varchar2) then
484     p_rec.crd_attribute26 :=
485     ben_crd_shd.g_old_rec.crd_attribute26;
486   End If;
487   If (p_rec.crd_attribute27 = hr_api.g_varchar2) then
488     p_rec.crd_attribute27 :=
489     ben_crd_shd.g_old_rec.crd_attribute27;
490   End If;
491   If (p_rec.crd_attribute28 = hr_api.g_varchar2) then
492     p_rec.crd_attribute28 :=
493     ben_crd_shd.g_old_rec.crd_attribute28;
494   End If;
495   If (p_rec.crd_attribute29 = hr_api.g_varchar2) then
496     p_rec.crd_attribute29 :=
497     ben_crd_shd.g_old_rec.crd_attribute29;
498   End If;
499   If (p_rec.crd_attribute30 = hr_api.g_varchar2) then
500     p_rec.crd_attribute30 :=
501     ben_crd_shd.g_old_rec.crd_attribute30;
502   End If;
503 
504   --
505   hr_utility.set_location(' Leaving:'||l_proc, 10);
506 --
507 End convert_defs;
508 --
509 -- ----------------------------------------------------------------------------
510 -- |---------------------------------< upd >----------------------------------|
511 -- ----------------------------------------------------------------------------
512 Procedure upd
513   (
514   p_rec        in out nocopy ben_crd_shd.g_rec_type
515   ) is
516 --
517   l_proc  varchar2(72) := g_package||'upd';
518 --
519 Begin
520   hr_utility.set_location('Entering:'||l_proc, 5);
521   --
522   -- We must lock the row which we need to update.
523   --
524   ben_crd_shd.lck
525 	(
526 	p_rec.crt_ordr_cvrd_per_id,
527 	p_rec.object_version_number
528 	);
529   --
530   -- 1. During an update system defaults are used to determine if
531   --    arguments have been defaulted or not. We must therefore
532   --    derive the full record structure values to be updated.
533   --
534   -- 2. Call the supporting update validate operations.
535   --
536   convert_defs(p_rec);
537   ben_crd_bus.update_validate(p_rec);
538   --
539   -- Call the supporting pre-update operation
540   --
541   pre_update(p_rec);
542   --
543   -- Update the row.
544   --
545   update_dml(p_rec);
546   --
547   -- Call the supporting post-update operation
548   --
549   post_update(p_rec);
550 End upd;
551 --
552 -- ----------------------------------------------------------------------------
553 -- |---------------------------------< upd >----------------------------------|
554 -- ----------------------------------------------------------------------------
555 Procedure upd
556   (
557   p_crt_ordr_cvrd_per_id         in number,
558   p_crt_ordr_id                  in number           default hr_api.g_number,
559   p_person_id                    in number           default hr_api.g_number,
560   p_business_group_id            in number           default hr_api.g_number,
561   p_crd_attribute_category       in varchar2         default hr_api.g_varchar2,
562   p_crd_attribute1               in varchar2         default hr_api.g_varchar2,
563   p_crd_attribute2               in varchar2         default hr_api.g_varchar2,
564   p_crd_attribute3               in varchar2         default hr_api.g_varchar2,
565   p_crd_attribute4               in varchar2         default hr_api.g_varchar2,
566   p_crd_attribute5               in varchar2         default hr_api.g_varchar2,
567   p_crd_attribute6               in varchar2         default hr_api.g_varchar2,
568   p_crd_attribute7               in varchar2         default hr_api.g_varchar2,
569   p_crd_attribute8               in varchar2         default hr_api.g_varchar2,
570   p_crd_attribute9               in varchar2         default hr_api.g_varchar2,
571   p_crd_attribute10              in varchar2         default hr_api.g_varchar2,
572   p_crd_attribute11              in varchar2         default hr_api.g_varchar2,
573   p_crd_attribute12              in varchar2         default hr_api.g_varchar2,
574   p_crd_attribute13              in varchar2         default hr_api.g_varchar2,
575   p_crd_attribute14              in varchar2         default hr_api.g_varchar2,
576   p_crd_attribute15              in varchar2         default hr_api.g_varchar2,
577   p_crd_attribute16              in varchar2         default hr_api.g_varchar2,
578   p_crd_attribute17              in varchar2         default hr_api.g_varchar2,
579   p_crd_attribute18              in varchar2         default hr_api.g_varchar2,
580   p_crd_attribute19              in varchar2         default hr_api.g_varchar2,
581   p_crd_attribute20              in varchar2         default hr_api.g_varchar2,
582   p_crd_attribute21              in varchar2         default hr_api.g_varchar2,
583   p_crd_attribute22              in varchar2         default hr_api.g_varchar2,
584   p_crd_attribute23              in varchar2         default hr_api.g_varchar2,
585   p_crd_attribute24              in varchar2         default hr_api.g_varchar2,
586   p_crd_attribute25              in varchar2         default hr_api.g_varchar2,
587   p_crd_attribute26              in varchar2         default hr_api.g_varchar2,
588   p_crd_attribute27              in varchar2         default hr_api.g_varchar2,
589   p_crd_attribute28              in varchar2         default hr_api.g_varchar2,
590   p_crd_attribute29              in varchar2         default hr_api.g_varchar2,
591   p_crd_attribute30              in varchar2         default hr_api.g_varchar2,
592   p_object_version_number        in out nocopy number
593   ) is
594 --
595   l_rec	  ben_crd_shd.g_rec_type;
596   l_proc  varchar2(72) := g_package||'upd';
597 --
598 Begin
599   hr_utility.set_location('Entering:'||l_proc, 5);
600   --
601   -- Call conversion function to turn arguments into the
602   -- l_rec structure.
603   --
604   l_rec :=
605   ben_crd_shd.convert_args
606   (
607   p_crt_ordr_cvrd_per_id,
608   p_crt_ordr_id,
609   p_person_id,
610   p_business_group_id,
611   p_crd_attribute_category,
612   p_crd_attribute1,
613   p_crd_attribute2,
614   p_crd_attribute3,
615   p_crd_attribute4,
616   p_crd_attribute5,
617   p_crd_attribute6,
618   p_crd_attribute7,
619   p_crd_attribute8,
620   p_crd_attribute9,
621   p_crd_attribute10,
622   p_crd_attribute11,
623   p_crd_attribute12,
624   p_crd_attribute13,
625   p_crd_attribute14,
626   p_crd_attribute15,
627   p_crd_attribute16,
628   p_crd_attribute17,
629   p_crd_attribute18,
630   p_crd_attribute19,
631   p_crd_attribute20,
632   p_crd_attribute21,
633   p_crd_attribute22,
634   p_crd_attribute23,
635   p_crd_attribute24,
636   p_crd_attribute25,
637   p_crd_attribute26,
638   p_crd_attribute27,
639   p_crd_attribute28,
640   p_crd_attribute29,
641   p_crd_attribute30,
642   p_object_version_number
643   );
644   --
645   -- Having converted the arguments into the
646   -- plsql record structure we call the corresponding record
647   -- business process.
648   --
649   upd(l_rec);
650   p_object_version_number := l_rec.object_version_number;
651   --
652   hr_utility.set_location(' Leaving:'||l_proc, 10);
653 End upd;
654 --
655 end ben_crd_upd;