DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_GOS_UPD

Source


1 Package Body ben_gos_upd as
2 /* $Header: begosrhi.pkb 120.0 2005/05/28 03:08:26 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ben_gos_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_gos_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_gos_shd.g_api_dml := true;  -- Set the api dml status
66   --
67   -- Update the ben_gd_or_svc_typ Row
68   --
69   update ben_gd_or_svc_typ
70   set
71   gd_or_svc_typ_id                  = p_rec.gd_or_svc_typ_id,
72   business_group_id                 = p_rec.business_group_id,
73   name                              = p_rec.name,
74   typ_cd                            = p_rec.typ_cd,
75   description                       = p_rec.description,
76   gos_attribute_category            = p_rec.gos_attribute_category,
77   gos_attribute1                    = p_rec.gos_attribute1,
78   gos_attribute2                    = p_rec.gos_attribute2,
79   gos_attribute3                    = p_rec.gos_attribute3,
80   gos_attribute4                    = p_rec.gos_attribute4,
81   gos_attribute5                    = p_rec.gos_attribute5,
82   gos_attribute6                    = p_rec.gos_attribute6,
83   gos_attribute7                    = p_rec.gos_attribute7,
84   gos_attribute8                    = p_rec.gos_attribute8,
85   gos_attribute9                    = p_rec.gos_attribute9,
86   gos_attribute10                   = p_rec.gos_attribute10,
87   gos_attribute11                   = p_rec.gos_attribute11,
88   gos_attribute12                   = p_rec.gos_attribute12,
89   gos_attribute13                   = p_rec.gos_attribute13,
90   gos_attribute14                   = p_rec.gos_attribute14,
91   gos_attribute15                   = p_rec.gos_attribute15,
92   gos_attribute16                   = p_rec.gos_attribute16,
93   gos_attribute17                   = p_rec.gos_attribute17,
94   gos_attribute18                   = p_rec.gos_attribute18,
95   gos_attribute19                   = p_rec.gos_attribute19,
96   gos_attribute20                   = p_rec.gos_attribute20,
97   gos_attribute21                   = p_rec.gos_attribute21,
98   gos_attribute22                   = p_rec.gos_attribute22,
99   gos_attribute23                   = p_rec.gos_attribute23,
100   gos_attribute24                   = p_rec.gos_attribute24,
101   gos_attribute25                   = p_rec.gos_attribute25,
102   gos_attribute26                   = p_rec.gos_attribute26,
103   gos_attribute27                   = p_rec.gos_attribute27,
104   gos_attribute28                   = p_rec.gos_attribute28,
105   gos_attribute29                   = p_rec.gos_attribute29,
106   gos_attribute30                   = p_rec.gos_attribute30,
107   object_version_number             = p_rec.object_version_number
108   where gd_or_svc_typ_id = p_rec.gd_or_svc_typ_id;
109   --
110   ben_gos_shd.g_api_dml := false;   -- Unset the api dml status
111   --
112   hr_utility.set_location(' Leaving:'||l_proc, 10);
113 --
114 Exception
115   When hr_api.check_integrity_violated Then
116     -- A check constraint has been violated
117     ben_gos_shd.g_api_dml := false;   -- Unset the api dml status
118     ben_gos_shd.constraint_error
119       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
120   When hr_api.parent_integrity_violated Then
121     -- Parent integrity has been violated
122     ben_gos_shd.g_api_dml := false;   -- Unset the api dml status
123     ben_gos_shd.constraint_error
124       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
125   When hr_api.unique_integrity_violated Then
126     -- Unique integrity has been violated
127     ben_gos_shd.g_api_dml := false;   -- Unset the api dml status
128     ben_gos_shd.constraint_error
129       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
130   When Others Then
131     ben_gos_shd.g_api_dml := false;   -- Unset the api dml status
132     Raise;
133 End update_dml;
134 --
135 -- ----------------------------------------------------------------------------
136 -- |------------------------------< pre_update >------------------------------|
137 -- ----------------------------------------------------------------------------
138 -- {Start Of Comments}
139 --
140 -- Description:
141 --   This private procedure contains any processing which is required before
142 --   the update dml.
143 --
144 -- Prerequisites:
145 --   This is an internal procedure which is called from the upd procedure.
146 --
147 -- In Parameters:
148 --   A Pl/Sql record structre.
149 --
150 -- Post Success:
151 --   Processing continues.
152 --
153 -- Post Failure:
154 --   If an error has occurred, an error message and exception will be raised
155 --   but not handled.
156 --
157 -- Developer Implementation Notes:
158 --   Any pre-processing required before the update dml is issued should be
159 --   coded within this procedure. It is important to note that any 3rd party
160 --   maintenance should be reviewed before placing in this procedure.
161 --
162 -- Access Status:
163 --   Internal Row Handler Use Only.
164 --
165 -- {End Of Comments}
166 -- ----------------------------------------------------------------------------
167 Procedure pre_update(p_rec in ben_gos_shd.g_rec_type) is
168 --
169   l_proc  varchar2(72) := g_package||'pre_update';
170 --
171 Begin
172   hr_utility.set_location('Entering:'||l_proc, 5);
173   --
174   hr_utility.set_location(' Leaving:'||l_proc, 10);
175 End pre_update;
176 --
177 -- ----------------------------------------------------------------------------
178 -- |-----------------------------< post_update >------------------------------|
179 -- ----------------------------------------------------------------------------
180 -- {Start Of Comments}
181 --
182 -- Description:
183 --   This private procedure contains any processing which is required after the
184 --   update dml.
185 --
186 -- Prerequisites:
187 --   This is an internal procedure which is called from the upd procedure.
188 --
189 -- In Parameters:
190 --   A Pl/Sql record structre.
191 --
192 -- Post Success:
193 --   Processing continues.
194 --
195 -- Post Failure:
196 --   If an error has occurred, an error message and exception will be raised
197 --   but not handled.
198 --
199 -- Developer Implementation Notes:
200 --   Any post-processing required after the update dml is issued should be
201 --   coded within this procedure. It is important to note that any 3rd party
202 --   maintenance should be reviewed before placing in this procedure.
203 --
204 -- Access Status:
205 --   Internal Row Handler Use Only.
206 --
207 -- {End Of Comments}
208 -- ----------------------------------------------------------------------------
209 Procedure post_update(
210 p_effective_date in date,p_rec in ben_gos_shd.g_rec_type) is
211 --
212   l_proc  varchar2(72) := g_package||'post_update';
213 --
214 Begin
215   hr_utility.set_location('Entering:'||l_proc, 5);
216 --
217   --
218   -- Start of API User Hook for post_update.
219   --
220   begin
221     --
222     ben_gos_rku.after_update
223       (
224   p_gd_or_svc_typ_id              =>p_rec.gd_or_svc_typ_id
225  ,p_business_group_id             =>p_rec.business_group_id
226  ,p_name                          =>p_rec.name
227  ,p_typ_cd                        =>p_rec.typ_cd
228  ,p_description                   =>p_rec.description
229  ,p_gos_attribute_category        =>p_rec.gos_attribute_category
230  ,p_gos_attribute1                =>p_rec.gos_attribute1
231  ,p_gos_attribute2                =>p_rec.gos_attribute2
232  ,p_gos_attribute3                =>p_rec.gos_attribute3
233  ,p_gos_attribute4                =>p_rec.gos_attribute4
234  ,p_gos_attribute5                =>p_rec.gos_attribute5
235  ,p_gos_attribute6                =>p_rec.gos_attribute6
236  ,p_gos_attribute7                =>p_rec.gos_attribute7
237  ,p_gos_attribute8                =>p_rec.gos_attribute8
238  ,p_gos_attribute9                =>p_rec.gos_attribute9
239  ,p_gos_attribute10               =>p_rec.gos_attribute10
240  ,p_gos_attribute11               =>p_rec.gos_attribute11
241  ,p_gos_attribute12               =>p_rec.gos_attribute12
242  ,p_gos_attribute13               =>p_rec.gos_attribute13
243  ,p_gos_attribute14               =>p_rec.gos_attribute14
244  ,p_gos_attribute15               =>p_rec.gos_attribute15
245  ,p_gos_attribute16               =>p_rec.gos_attribute16
246  ,p_gos_attribute17               =>p_rec.gos_attribute17
247  ,p_gos_attribute18               =>p_rec.gos_attribute18
248  ,p_gos_attribute19               =>p_rec.gos_attribute19
249  ,p_gos_attribute20               =>p_rec.gos_attribute20
250  ,p_gos_attribute21               =>p_rec.gos_attribute21
251  ,p_gos_attribute22               =>p_rec.gos_attribute22
252  ,p_gos_attribute23               =>p_rec.gos_attribute23
253  ,p_gos_attribute24               =>p_rec.gos_attribute24
254  ,p_gos_attribute25               =>p_rec.gos_attribute25
255  ,p_gos_attribute26               =>p_rec.gos_attribute26
256  ,p_gos_attribute27               =>p_rec.gos_attribute27
257  ,p_gos_attribute28               =>p_rec.gos_attribute28
258  ,p_gos_attribute29               =>p_rec.gos_attribute29
259  ,p_gos_attribute30               =>p_rec.gos_attribute30
260  ,p_object_version_number         =>p_rec.object_version_number
261  ,p_effective_date                =>p_effective_date
262  ,p_business_group_id_o           =>ben_gos_shd.g_old_rec.business_group_id
263  ,p_name_o                        =>ben_gos_shd.g_old_rec.name
264  ,p_typ_cd_o                      =>ben_gos_shd.g_old_rec.typ_cd
265  ,p_description_o                 =>ben_gos_shd.g_old_rec.description
266  ,p_gos_attribute_category_o      =>ben_gos_shd.g_old_rec.gos_attribute_category
267  ,p_gos_attribute1_o              =>ben_gos_shd.g_old_rec.gos_attribute1
268  ,p_gos_attribute2_o              =>ben_gos_shd.g_old_rec.gos_attribute2
269  ,p_gos_attribute3_o              =>ben_gos_shd.g_old_rec.gos_attribute3
270  ,p_gos_attribute4_o              =>ben_gos_shd.g_old_rec.gos_attribute4
271  ,p_gos_attribute5_o              =>ben_gos_shd.g_old_rec.gos_attribute5
272  ,p_gos_attribute6_o              =>ben_gos_shd.g_old_rec.gos_attribute6
273  ,p_gos_attribute7_o              =>ben_gos_shd.g_old_rec.gos_attribute7
274  ,p_gos_attribute8_o              =>ben_gos_shd.g_old_rec.gos_attribute8
275  ,p_gos_attribute9_o              =>ben_gos_shd.g_old_rec.gos_attribute9
276  ,p_gos_attribute10_o             =>ben_gos_shd.g_old_rec.gos_attribute10
277  ,p_gos_attribute11_o             =>ben_gos_shd.g_old_rec.gos_attribute11
278  ,p_gos_attribute12_o             =>ben_gos_shd.g_old_rec.gos_attribute12
279  ,p_gos_attribute13_o             =>ben_gos_shd.g_old_rec.gos_attribute13
280  ,p_gos_attribute14_o             =>ben_gos_shd.g_old_rec.gos_attribute14
281  ,p_gos_attribute15_o             =>ben_gos_shd.g_old_rec.gos_attribute15
282  ,p_gos_attribute16_o             =>ben_gos_shd.g_old_rec.gos_attribute16
283  ,p_gos_attribute17_o             =>ben_gos_shd.g_old_rec.gos_attribute17
284  ,p_gos_attribute18_o             =>ben_gos_shd.g_old_rec.gos_attribute18
285  ,p_gos_attribute19_o             =>ben_gos_shd.g_old_rec.gos_attribute19
286  ,p_gos_attribute20_o             =>ben_gos_shd.g_old_rec.gos_attribute20
287  ,p_gos_attribute21_o             =>ben_gos_shd.g_old_rec.gos_attribute21
288  ,p_gos_attribute22_o             =>ben_gos_shd.g_old_rec.gos_attribute22
289  ,p_gos_attribute23_o             =>ben_gos_shd.g_old_rec.gos_attribute23
290  ,p_gos_attribute24_o             =>ben_gos_shd.g_old_rec.gos_attribute24
291  ,p_gos_attribute25_o             =>ben_gos_shd.g_old_rec.gos_attribute25
292  ,p_gos_attribute26_o             =>ben_gos_shd.g_old_rec.gos_attribute26
293  ,p_gos_attribute27_o             =>ben_gos_shd.g_old_rec.gos_attribute27
294  ,p_gos_attribute28_o             =>ben_gos_shd.g_old_rec.gos_attribute28
295  ,p_gos_attribute29_o             =>ben_gos_shd.g_old_rec.gos_attribute29
296  ,p_gos_attribute30_o             =>ben_gos_shd.g_old_rec.gos_attribute30
297  ,p_object_version_number_o       =>ben_gos_shd.g_old_rec.object_version_number
298       );
299     --
300   exception
301     --
302     when hr_api.cannot_find_prog_unit then
303       --
304       hr_api.cannot_find_prog_unit_error
305         (p_module_name => 'ben_gd_or_svc_typ'
306         ,p_hook_type   => 'AU');
307       --
308   end;
309   --
310   -- End of API User Hook for post_update.
311   --
312   --
313   hr_utility.set_location(' Leaving:'||l_proc, 10);
314 End post_update;
315 --
316 -- ----------------------------------------------------------------------------
317 -- |-----------------------------< convert_defs >-----------------------------|
318 -- ----------------------------------------------------------------------------
319 -- {Start Of Comments}
320 --
321 -- Description:
322 --   The Convert_Defs procedure has one very important function:
323 --   It must return the record structure for the row with all system defaulted
324 --   values converted into its corresponding parameter value for update. When
325 --   we attempt to update a row through the Upd process , certain
326 --   parameters can be defaulted which enables flexibility in the calling of
327 --   the upd process (e.g. only attributes which need to be updated need to be
328 --   specified). For the upd process to determine which attributes
329 --   have NOT been specified we need to check if the parameter has a reserved
330 --   system default value. Therefore, for all parameters which have a
331 --   corresponding reserved system default mechanism specified we need to
332 --   check if a system default is being used. If a system default is being
333 --   used then we convert the defaulted value into its corresponding attribute
334 --   value held in the g_old_rec data structure.
335 --
336 -- Prerequisites:
337 --   This private function can only be called from the upd process.
338 --
339 -- In Parameters:
340 --   A Pl/Sql record structre.
341 --
342 -- Post Success:
343 --   The record structure will be returned with all system defaulted parameter
344 --   values converted into its current row attribute value.
345 --
346 -- Post Failure:
347 --   No direct error handling is required within this function. Any possible
348 --   errors within this procedure will be a PL/SQL value error due to conversion
349 --   of datatypes or data lengths.
350 --
351 -- Developer Implementation Notes:
352 --   None.
353 --
354 -- Access Status:
355 --   Internal Row Handler Use Only.
356 --
357 -- {End Of Comments}
358 -- ----------------------------------------------------------------------------
359 Procedure convert_defs(p_rec in out nocopy ben_gos_shd.g_rec_type) is
360 --
361   l_proc  varchar2(72) := g_package||'convert_defs';
362 --
363 Begin
364   --
365   hr_utility.set_location('Entering:'||l_proc, 5);
366   --
367   -- We must now examine each argument value in the
368   -- p_rec plsql record structure
369   -- to see if a system default is being used. If a system default
370   -- is being used then we must set to the 'current' argument value.
371   --
372   If (p_rec.business_group_id = hr_api.g_number) then
373     p_rec.business_group_id :=
374     ben_gos_shd.g_old_rec.business_group_id;
375   End If;
376   If (p_rec.name = hr_api.g_varchar2) then
377     p_rec.name :=
378     ben_gos_shd.g_old_rec.name;
379   End If;
380   If (p_rec.typ_cd = hr_api.g_varchar2) then
381     p_rec.typ_cd :=
382     ben_gos_shd.g_old_rec.typ_cd;
383   End If;
384   If (p_rec.description = hr_api.g_varchar2) then
385     p_rec.description :=
386     ben_gos_shd.g_old_rec.description;
387   End If;
388   If (p_rec.gos_attribute_category = hr_api.g_varchar2) then
389     p_rec.gos_attribute_category :=
390     ben_gos_shd.g_old_rec.gos_attribute_category;
391   End If;
392   If (p_rec.gos_attribute1 = hr_api.g_varchar2) then
393     p_rec.gos_attribute1 :=
394     ben_gos_shd.g_old_rec.gos_attribute1;
395   End If;
396   If (p_rec.gos_attribute2 = hr_api.g_varchar2) then
397     p_rec.gos_attribute2 :=
398     ben_gos_shd.g_old_rec.gos_attribute2;
399   End If;
400   If (p_rec.gos_attribute3 = hr_api.g_varchar2) then
401     p_rec.gos_attribute3 :=
402     ben_gos_shd.g_old_rec.gos_attribute3;
403   End If;
404   If (p_rec.gos_attribute4 = hr_api.g_varchar2) then
405     p_rec.gos_attribute4 :=
406     ben_gos_shd.g_old_rec.gos_attribute4;
407   End If;
408   If (p_rec.gos_attribute5 = hr_api.g_varchar2) then
409     p_rec.gos_attribute5 :=
410     ben_gos_shd.g_old_rec.gos_attribute5;
411   End If;
412   If (p_rec.gos_attribute6 = hr_api.g_varchar2) then
413     p_rec.gos_attribute6 :=
414     ben_gos_shd.g_old_rec.gos_attribute6;
415   End If;
416   If (p_rec.gos_attribute7 = hr_api.g_varchar2) then
417     p_rec.gos_attribute7 :=
418     ben_gos_shd.g_old_rec.gos_attribute7;
419   End If;
420   If (p_rec.gos_attribute8 = hr_api.g_varchar2) then
421     p_rec.gos_attribute8 :=
422     ben_gos_shd.g_old_rec.gos_attribute8;
423   End If;
424   If (p_rec.gos_attribute9 = hr_api.g_varchar2) then
425     p_rec.gos_attribute9 :=
426     ben_gos_shd.g_old_rec.gos_attribute9;
427   End If;
428   If (p_rec.gos_attribute10 = hr_api.g_varchar2) then
429     p_rec.gos_attribute10 :=
430     ben_gos_shd.g_old_rec.gos_attribute10;
431   End If;
432   If (p_rec.gos_attribute11 = hr_api.g_varchar2) then
433     p_rec.gos_attribute11 :=
434     ben_gos_shd.g_old_rec.gos_attribute11;
435   End If;
436   If (p_rec.gos_attribute12 = hr_api.g_varchar2) then
437     p_rec.gos_attribute12 :=
438     ben_gos_shd.g_old_rec.gos_attribute12;
439   End If;
440   If (p_rec.gos_attribute13 = hr_api.g_varchar2) then
441     p_rec.gos_attribute13 :=
442     ben_gos_shd.g_old_rec.gos_attribute13;
443   End If;
444   If (p_rec.gos_attribute14 = hr_api.g_varchar2) then
445     p_rec.gos_attribute14 :=
446     ben_gos_shd.g_old_rec.gos_attribute14;
447   End If;
448   If (p_rec.gos_attribute15 = hr_api.g_varchar2) then
449     p_rec.gos_attribute15 :=
450     ben_gos_shd.g_old_rec.gos_attribute15;
451   End If;
452   If (p_rec.gos_attribute16 = hr_api.g_varchar2) then
453     p_rec.gos_attribute16 :=
454     ben_gos_shd.g_old_rec.gos_attribute16;
455   End If;
456   If (p_rec.gos_attribute17 = hr_api.g_varchar2) then
457     p_rec.gos_attribute17 :=
458     ben_gos_shd.g_old_rec.gos_attribute17;
459   End If;
460   If (p_rec.gos_attribute18 = hr_api.g_varchar2) then
461     p_rec.gos_attribute18 :=
462     ben_gos_shd.g_old_rec.gos_attribute18;
463   End If;
464   If (p_rec.gos_attribute19 = hr_api.g_varchar2) then
465     p_rec.gos_attribute19 :=
466     ben_gos_shd.g_old_rec.gos_attribute19;
467   End If;
468   If (p_rec.gos_attribute20 = hr_api.g_varchar2) then
469     p_rec.gos_attribute20 :=
470     ben_gos_shd.g_old_rec.gos_attribute20;
471   End If;
472   If (p_rec.gos_attribute21 = hr_api.g_varchar2) then
473     p_rec.gos_attribute21 :=
474     ben_gos_shd.g_old_rec.gos_attribute21;
475   End If;
476   If (p_rec.gos_attribute22 = hr_api.g_varchar2) then
477     p_rec.gos_attribute22 :=
478     ben_gos_shd.g_old_rec.gos_attribute22;
479   End If;
480   If (p_rec.gos_attribute23 = hr_api.g_varchar2) then
481     p_rec.gos_attribute23 :=
482     ben_gos_shd.g_old_rec.gos_attribute23;
483   End If;
484   If (p_rec.gos_attribute24 = hr_api.g_varchar2) then
485     p_rec.gos_attribute24 :=
486     ben_gos_shd.g_old_rec.gos_attribute24;
487   End If;
488   If (p_rec.gos_attribute25 = hr_api.g_varchar2) then
489     p_rec.gos_attribute25 :=
490     ben_gos_shd.g_old_rec.gos_attribute25;
491   End If;
492   If (p_rec.gos_attribute26 = hr_api.g_varchar2) then
493     p_rec.gos_attribute26 :=
494     ben_gos_shd.g_old_rec.gos_attribute26;
495   End If;
496   If (p_rec.gos_attribute27 = hr_api.g_varchar2) then
497     p_rec.gos_attribute27 :=
498     ben_gos_shd.g_old_rec.gos_attribute27;
499   End If;
500   If (p_rec.gos_attribute28 = hr_api.g_varchar2) then
501     p_rec.gos_attribute28 :=
502     ben_gos_shd.g_old_rec.gos_attribute28;
503   End If;
504   If (p_rec.gos_attribute29 = hr_api.g_varchar2) then
505     p_rec.gos_attribute29 :=
506     ben_gos_shd.g_old_rec.gos_attribute29;
507   End If;
508   If (p_rec.gos_attribute30 = hr_api.g_varchar2) then
509     p_rec.gos_attribute30 :=
510     ben_gos_shd.g_old_rec.gos_attribute30;
511   End If;
512 
513   --
514   hr_utility.set_location(' Leaving:'||l_proc, 10);
515 --
516 End convert_defs;
517 --
518 -- ----------------------------------------------------------------------------
519 -- |---------------------------------< upd >----------------------------------|
520 -- ----------------------------------------------------------------------------
521 Procedure upd
522   (
523   p_effective_date in date,
524   p_rec        in out nocopy ben_gos_shd.g_rec_type
525   ) is
526 --
527   l_proc  varchar2(72) := g_package||'upd';
528 --
529 Begin
530   hr_utility.set_location('Entering:'||l_proc, 5);
531   --
532   -- We must lock the row which we need to update.
533   --
534   ben_gos_shd.lck
535 	(
536 	p_rec.gd_or_svc_typ_id,
537 	p_rec.object_version_number
538 	);
539   --
540   -- 1. During an update system defaults are used to determine if
541   --    arguments have been defaulted or not. We must therefore
542   --    derive the full record structure values to be updated.
543   --
544   -- 2. Call the supporting update validate operations.
545   --
546   convert_defs(p_rec);
547   ben_gos_bus.update_validate(p_rec
548   ,p_effective_date);
549   --
550   -- Call the supporting pre-update operation
551   --
552   pre_update(p_rec);
553   --
554   -- Update the row.
555   --
556   update_dml(p_rec);
557   --
558   -- Call the supporting post-update operation
559   --
560   post_update(
561 p_effective_date,p_rec);
562 End upd;
563 --
564 -- ----------------------------------------------------------------------------
565 -- |---------------------------------< upd >----------------------------------|
566 -- ----------------------------------------------------------------------------
567 Procedure upd
568   (
569   p_effective_date in date,
570   p_gd_or_svc_typ_id             in number,
571   p_business_group_id            in number           default hr_api.g_number,
572   p_name                         in varchar2         default hr_api.g_varchar2,
573   p_typ_cd                       in varchar2         default hr_api.g_varchar2,
574   p_description                  in varchar2         default hr_api.g_varchar2,
575   p_gos_attribute_category       in varchar2         default hr_api.g_varchar2,
576   p_gos_attribute1               in varchar2         default hr_api.g_varchar2,
577   p_gos_attribute2               in varchar2         default hr_api.g_varchar2,
578   p_gos_attribute3               in varchar2         default hr_api.g_varchar2,
579   p_gos_attribute4               in varchar2         default hr_api.g_varchar2,
580   p_gos_attribute5               in varchar2         default hr_api.g_varchar2,
581   p_gos_attribute6               in varchar2         default hr_api.g_varchar2,
582   p_gos_attribute7               in varchar2         default hr_api.g_varchar2,
583   p_gos_attribute8               in varchar2         default hr_api.g_varchar2,
584   p_gos_attribute9               in varchar2         default hr_api.g_varchar2,
585   p_gos_attribute10              in varchar2         default hr_api.g_varchar2,
586   p_gos_attribute11              in varchar2         default hr_api.g_varchar2,
587   p_gos_attribute12              in varchar2         default hr_api.g_varchar2,
588   p_gos_attribute13              in varchar2         default hr_api.g_varchar2,
589   p_gos_attribute14              in varchar2         default hr_api.g_varchar2,
590   p_gos_attribute15              in varchar2         default hr_api.g_varchar2,
591   p_gos_attribute16              in varchar2         default hr_api.g_varchar2,
592   p_gos_attribute17              in varchar2         default hr_api.g_varchar2,
593   p_gos_attribute18              in varchar2         default hr_api.g_varchar2,
594   p_gos_attribute19              in varchar2         default hr_api.g_varchar2,
595   p_gos_attribute20              in varchar2         default hr_api.g_varchar2,
596   p_gos_attribute21              in varchar2         default hr_api.g_varchar2,
597   p_gos_attribute22              in varchar2         default hr_api.g_varchar2,
598   p_gos_attribute23              in varchar2         default hr_api.g_varchar2,
599   p_gos_attribute24              in varchar2         default hr_api.g_varchar2,
600   p_gos_attribute25              in varchar2         default hr_api.g_varchar2,
601   p_gos_attribute26              in varchar2         default hr_api.g_varchar2,
602   p_gos_attribute27              in varchar2         default hr_api.g_varchar2,
603   p_gos_attribute28              in varchar2         default hr_api.g_varchar2,
604   p_gos_attribute29              in varchar2         default hr_api.g_varchar2,
605   p_gos_attribute30              in varchar2         default hr_api.g_varchar2,
606   p_object_version_number        in out nocopy number
607   ) is
608 --
609   l_rec	  ben_gos_shd.g_rec_type;
610   l_proc  varchar2(72) := g_package||'upd';
611 --
612 Begin
613   hr_utility.set_location('Entering:'||l_proc, 5);
614   --
615   -- Call conversion function to turn arguments into the
616   -- l_rec structure.
617   --
618   l_rec :=
619   ben_gos_shd.convert_args
620   (
621   p_gd_or_svc_typ_id,
622   p_business_group_id,
623   p_name,
624   p_typ_cd,
625   p_description,
626   p_gos_attribute_category,
627   p_gos_attribute1,
628   p_gos_attribute2,
629   p_gos_attribute3,
630   p_gos_attribute4,
631   p_gos_attribute5,
632   p_gos_attribute6,
633   p_gos_attribute7,
634   p_gos_attribute8,
635   p_gos_attribute9,
636   p_gos_attribute10,
637   p_gos_attribute11,
638   p_gos_attribute12,
639   p_gos_attribute13,
640   p_gos_attribute14,
641   p_gos_attribute15,
642   p_gos_attribute16,
643   p_gos_attribute17,
644   p_gos_attribute18,
645   p_gos_attribute19,
646   p_gos_attribute20,
647   p_gos_attribute21,
648   p_gos_attribute22,
649   p_gos_attribute23,
650   p_gos_attribute24,
651   p_gos_attribute25,
652   p_gos_attribute26,
653   p_gos_attribute27,
654   p_gos_attribute28,
655   p_gos_attribute29,
656   p_gos_attribute30,
657   p_object_version_number
658   );
659   --
660   -- Having converted the arguments into the
661   -- plsql record structure we call the corresponding record
662   -- business process.
663   --
664   upd(
665     p_effective_date,l_rec);
666   p_object_version_number := l_rec.object_version_number;
667   --
668   hr_utility.set_location(' Leaving:'||l_proc, 10);
669 End upd;
670 --
671 end ben_gos_upd;