DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_CAG_UPD

Source


1 Package Body per_cag_upd as
2 /* $Header: pecagrhi.pkb 120.1 2006/10/18 08:42:10 grreddy noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  per_cag_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 --   (Note: Philippe 4/20/99 Removed the need for setting g_api_dml as this is a new
23 --    table and therefore there is no ovn trigger to use it).
24 --   3) To update the specified row in the schema using the primary key in
25 --      the predicates.
26 --   4) To trap any constraint violations that may have occurred.
27 --   5) To raise any other errors.
28 --
29 -- Prerequisites:
30 --   This is an internal private procedure which must be called from the upd
31 --   procedure.
32 --
33 -- In Parameters:
34 --   A Pl/Sql record structre.
35 --
36 -- Post Success:
37 --   The specified row will be updated in the schema.
38 --
39 -- Post Failure:
40 --   On the update dml failure it is important to note that we always reset the
41 --   g_api_dml status to false.
42 --   If a check, unique or parent integrity constraint violation is raised the
43 --   constraint_error procedure will be called.
44 --   If any other error is reported, the error will be raised after the
45 --   g_api_dml status is reset.
46 --
47 -- Developer Implementation Notes:
48 --   The update 'set' attribute list should be modified if any of your
49 --   attributes are not updateable.
50 --
51 -- Access Status:
52 --   Internal Row Handler Use Only.
53 --
54 -- {End Of Comments}
55 -- ----------------------------------------------------------------------------
56 Procedure update_dml(p_rec in out nocopy per_cag_shd.g_rec_type) is
57 --
58   l_proc  varchar2(72) := g_package||'update_dml';
59 --
60 Begin
61   hr_utility.set_location('Entering:'||l_proc, 5);
62   --
63   -- Increment the object version
64   --
65   p_rec.object_version_number := p_rec.object_version_number + 1;
66   --
67   --
68   -- Update the per_collective_agreements Row
69   --
70   update per_collective_agreements
71   set
72   collective_agreement_id           = p_rec.collective_agreement_id,
73   business_group_id                 = p_rec.business_group_id,
74   object_version_number             = p_rec.object_version_number,
75   name                              = p_rec.name,
76   status		            	    = p_rec.status,
77   cag_number                        = p_rec.cag_number,
78   description                       = p_rec.description,
79   start_date                        = p_rec.start_date,
80   end_date                          = p_rec.end_date,
81   employer_organization_id          = p_rec.employer_organization_id,
82   employer_signatory                = p_rec.employer_signatory,
83   bargaining_organization_id        = p_rec.bargaining_organization_id,
84   bargaining_unit_signatory         = p_rec.bargaining_unit_signatory,
85   jurisdiction                      = p_rec.jurisdiction,
86   authorizing_body                  = p_rec.authorizing_body,
87   authorized_date                   = p_rec.authorized_date,
88   cag_information_category          = p_rec.cag_information_category,
89   cag_information1                  = p_rec.cag_information1,
90   cag_information2                  = p_rec.cag_information2,
91   cag_information3                  = p_rec.cag_information3,
92   cag_information4                  = p_rec.cag_information4,
93   cag_information5                  = p_rec.cag_information5,
94   cag_information6                  = p_rec.cag_information6,
95   cag_information7                  = p_rec.cag_information7,
96   cag_information8                  = p_rec.cag_information8,
97   cag_information9                  = p_rec.cag_information9,
98   cag_information10                 = p_rec.cag_information10,
99   cag_information11                 = p_rec.cag_information11,
100   cag_information12                 = p_rec.cag_information12,
101   cag_information13                 = p_rec.cag_information13,
102   cag_information14                 = p_rec.cag_information14,
103   cag_information15                 = p_rec.cag_information15,
104   cag_information16                 = p_rec.cag_information16,
105   cag_information17                 = p_rec.cag_information17,
106   cag_information18                 = p_rec.cag_information18,
107   cag_information19                 = p_rec.cag_information19,
108   cag_information20                 = p_rec.cag_information20,
109   attribute_category                = p_rec.attribute_category,
110   attribute1                        = p_rec.attribute1,
111   attribute2                        = p_rec.attribute2,
112   attribute3                        = p_rec.attribute3,
113   attribute4                        = p_rec.attribute4,
114   attribute5                        = p_rec.attribute5,
115   attribute6                        = p_rec.attribute6,
116   attribute7                        = p_rec.attribute7,
117   attribute8                        = p_rec.attribute8,
118   attribute9                        = p_rec.attribute9,
119   attribute10                       = p_rec.attribute10,
120   attribute11                       = p_rec.attribute11,
121   attribute12                       = p_rec.attribute12,
122   attribute13                       = p_rec.attribute13,
123   attribute14                       = p_rec.attribute14,
124   attribute15                       = p_rec.attribute15,
125   attribute16                       = p_rec.attribute16,
126   attribute17                       = p_rec.attribute17,
127   attribute18                       = p_rec.attribute18,
128   attribute19                       = p_rec.attribute19,
129   attribute20                       = p_rec.attribute20
130   where collective_agreement_id = p_rec.collective_agreement_id;
131   --
132   --
133   hr_utility.set_location(' Leaving:'||l_proc, 10);
134 --
135 Exception
136   When hr_api.check_integrity_violated Then
137     -- A check constraint has been violated
138     per_cag_shd.constraint_error
139       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
140   When hr_api.parent_integrity_violated Then
141     -- Parent integrity has been violated
142     per_cag_shd.constraint_error
143       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
144   When hr_api.unique_integrity_violated Then
145     -- Unique integrity has been violated
146     per_cag_shd.constraint_error
147       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
148   When Others Then
149      Raise;
150 End update_dml;
151 --
152 -- ----------------------------------------------------------------------------
153 -- |------------------------------< pre_update >------------------------------|
154 -- ----------------------------------------------------------------------------
155 -- {Start Of Comments}
156 --
157 -- Description:
158 --   This private procedure contains any processing which is required before
159 --   the update dml.
160 --
161 -- Prerequisites:
162 --   This is an internal procedure which is called from the upd procedure.
163 --
164 -- In Parameters:
165 --   A Pl/Sql record structre.
166 --
167 -- Post Success:
168 --   Processing continues.
169 --
170 -- Post Failure:
171 --   If an error has occurred, an error message and exception will be raised
172 --   but not handled.
173 --
174 -- Developer Implementation Notes:
175 --   Any pre-processing required before the update dml is issued should be
176 --   coded within this procedure. It is important to note that any 3rd party
177 --   maintenance should be reviewed before placing in this procedure.
178 --
179 -- Access Status:
180 --   Internal Row Handler Use Only.
181 --
182 -- {End Of Comments}
183 -- ----------------------------------------------------------------------------
184 Procedure pre_update(p_rec in per_cag_shd.g_rec_type) is
185 --
186   l_proc  varchar2(72) := g_package||'pre_update';
187 --
188 Begin
189   hr_utility.set_location('Entering:'||l_proc, 5);
190   --
191   hr_utility.set_location(' Leaving:'||l_proc, 10);
192 End pre_update;
193 --
194 -- ----------------------------------------------------------------------------
195 -- |-----------------------------< post_update >------------------------------|
196 -- ----------------------------------------------------------------------------
197 -- {Start Of Comments}
198 --
199 -- Description:
200 --   This private procedure contains any processing which is required after the
201 --   update dml.
202 --
203 -- Prerequisites:
204 --   This is an internal procedure which is called from the upd procedure.
205 --
206 -- In Parameters:
207 --   A Pl/Sql record structre.
208 --
209 -- Post Success:
210 --   Processing continues.
211 --
212 -- Post Failure:
213 --   If an error has occurred, an error message and exception will be raised
214 --   but not handled.
215 --
216 -- Developer Implementation Notes:
217 --   Any post-processing required after the update dml is issued should be
218 --   coded within this procedure. It is important to note that any 3rd party
219 --   maintenance should be reviewed before placing in this procedure.
220 --
221 -- Access Status:
222 --   Internal Row Handler Use Only.
223 --
224 -- {End Of Comments}
225 -- ----------------------------------------------------------------------------
226 Procedure post_update(p_rec in per_cag_shd.g_rec_type) is
227 --
228   l_proc  varchar2(72) := g_package||'post_update';
229 --
230 Begin
231   hr_utility.set_location('Entering:'||l_proc, 5);
232   --
233   --
234   --
235   -- Start of API User Hook for post_update.
236   --
237   begin
238     --
239     per_cag_rku.after_update
240      ( p_collective_agreement_id      =>p_rec.collective_agreement_id,
241        p_business_group_id            =>p_rec.business_group_id,
242        p_object_version_number        =>p_rec.object_version_number,
243        p_name                         =>p_rec.name,
244        p_status                       =>p_rec.status,
245        p_cag_number                   =>p_rec.cag_number,
246        p_description                  =>p_rec.description,
247        p_start_date                   =>p_rec.start_date,
248        p_end_date                     =>p_rec.end_date,
249        p_employer_organization_id     =>p_rec.employer_organization_id,
250        p_employer_signatory           =>p_rec.employer_signatory,
251        p_bargaining_organization_id   =>p_rec.bargaining_organization_id,
252        p_bargaining_unit_signatory    =>p_rec.bargaining_unit_signatory,
253        p_jurisdiction                 =>p_rec.jurisdiction,
254        p_authorizing_body             =>p_rec.authorizing_body,
255        p_authorized_date              =>p_rec.authorized_date,
256        p_cag_information_category     =>p_rec.cag_information_category,
257        p_cag_information1             =>p_rec.cag_information1,
258        p_cag_information2             =>p_rec.cag_information2,
259        p_cag_information3             =>p_rec.cag_information3,
260        p_cag_information4             =>p_rec.cag_information4,
261        p_cag_information5             =>p_rec.cag_information5,
262        p_cag_information6             =>p_rec.cag_information6,
263        p_cag_information7             =>p_rec.cag_information7,
264        p_cag_information8             =>p_rec.cag_information8,
265        p_cag_information9             =>p_rec.cag_information9,
266        p_cag_information10            =>p_rec.cag_information10,
267        p_cag_information11            =>p_rec.cag_information11,
268        p_cag_information12            =>p_rec.cag_information12,
269        p_cag_information13            =>p_rec.cag_information13,
270        p_cag_information14            =>p_rec.cag_information14,
271        p_cag_information15            =>p_rec.cag_information15,
272        p_cag_information16            =>p_rec.cag_information16,
273        p_cag_information17            =>p_rec.cag_information17,
274        p_cag_information18            =>p_rec.cag_information18,
275        p_cag_information19            =>p_rec.cag_information19,
276        p_cag_information20            =>p_rec.cag_information20,
277        p_attribute_category           =>p_rec.attribute_category,
278        p_attribute1                   =>p_rec.attribute1,
279        p_attribute2                   =>p_rec.attribute2,
280        p_attribute3                   =>p_rec.attribute3,
281        p_attribute4                   =>p_rec.attribute4,
282        p_attribute5                   =>p_rec.attribute5,
283        p_attribute6                   =>p_rec.attribute6,
284        p_attribute7                   =>p_rec.attribute7,
285        p_attribute8                   =>p_rec.attribute8,
286        p_attribute9                   =>p_rec.attribute9,
287        p_attribute10                  =>p_rec.attribute10,
288        p_attribute11                  =>p_rec.attribute11,
289        p_attribute12                  =>p_rec.attribute12,
290        p_attribute13                  =>p_rec.attribute13,
291        p_attribute14                  =>p_rec.attribute14,
292        p_attribute15                  =>p_rec.attribute15,
293        p_attribute16                  =>p_rec.attribute16,
294        p_attribute17                  =>p_rec.attribute17,
295        p_attribute18                  =>p_rec.attribute18,
296        p_attribute19                  =>p_rec.attribute19,
297        p_attribute20                  =>p_rec.attribute20,
298        p_business_group_id_o          =>per_cag_shd.g_old_rec.business_group_id,
299        p_object_version_number_o      =>per_cag_shd.g_old_rec.object_version_number,
300        p_name_o                       =>per_cag_shd.g_old_rec.name,
301        p_status_o                     =>per_cag_shd.g_old_rec.status,
302        p_cag_number_o                 =>per_cag_shd.g_old_rec.cag_number,
303        p_description_o                =>per_cag_shd.g_old_rec.description,
304        p_start_date_o                 =>per_cag_shd.g_old_rec.start_date,
305        p_end_date_o                   =>per_cag_shd.g_old_rec.end_date,
306        p_employer_organization_id_o   =>per_cag_shd.g_old_rec.employer_organization_id,
307        p_employer_signatory_o         =>per_cag_shd.g_old_rec.employer_signatory,
308        p_bargaining_organization_id_o =>per_cag_shd.g_old_rec.bargaining_organization_id,
309        p_bargaining_unit_signatory_o  =>per_cag_shd.g_old_rec.bargaining_unit_signatory,
310        p_jurisdiction_o               =>per_cag_shd.g_old_rec.jurisdiction,
311        p_authorizing_body_o           =>per_cag_shd.g_old_rec.authorizing_body,
312        p_authorized_date_o            =>per_cag_shd.g_old_rec.authorized_date,
313        p_cag_information_category_o   =>per_cag_shd.g_old_rec.cag_information_category,
314        p_cag_information1_o           =>per_cag_shd.g_old_rec.cag_information1,
315        p_cag_information2_o           =>per_cag_shd.g_old_rec.cag_information2,
316        p_cag_information3_o           =>per_cag_shd.g_old_rec.cag_information3,
317        p_cag_information4_o           =>per_cag_shd.g_old_rec.cag_information4,
318        p_cag_information5_o           =>per_cag_shd.g_old_rec.cag_information5,
319        p_cag_information6_o           =>per_cag_shd.g_old_rec.cag_information6,
320        p_cag_information7_o           =>per_cag_shd.g_old_rec.cag_information7,
321        p_cag_information8_o           =>per_cag_shd.g_old_rec.cag_information8,
322        p_cag_information9_o           =>per_cag_shd.g_old_rec.cag_information9,
323        p_cag_information10_o          =>per_cag_shd.g_old_rec.cag_information10,
324        p_cag_information11_o          =>per_cag_shd.g_old_rec.cag_information11,
325        p_cag_information12_o          =>per_cag_shd.g_old_rec.cag_information12,
326        p_cag_information13_o          =>per_cag_shd.g_old_rec.cag_information13,
327        p_cag_information14_o          =>per_cag_shd.g_old_rec.cag_information14,
328        p_cag_information15_o          =>per_cag_shd.g_old_rec.cag_information15,
329        p_cag_information16_o          =>per_cag_shd.g_old_rec.cag_information16,
330        p_cag_information17_o          =>per_cag_shd.g_old_rec.cag_information17,
331        p_cag_information18_o          =>per_cag_shd.g_old_rec.cag_information18,
332        p_cag_information19_o          =>per_cag_shd.g_old_rec.cag_information19,
333        p_cag_information20_o          =>per_cag_shd.g_old_rec.cag_information20,
334        p_attribute_category_o         =>per_cag_shd.g_old_rec.attribute_category,
335        p_attribute1_o                 =>per_cag_shd.g_old_rec.attribute1,
336        p_attribute2_o                 =>per_cag_shd.g_old_rec.attribute2,
337        p_attribute3_o                 =>per_cag_shd.g_old_rec.attribute3,
338        p_attribute4_o                 =>per_cag_shd.g_old_rec.attribute4,
339        p_attribute5_o                 =>per_cag_shd.g_old_rec.attribute5,
340        p_attribute6_o                 =>per_cag_shd.g_old_rec.attribute6,
341        p_attribute7_o                 =>per_cag_shd.g_old_rec.attribute7,
342        p_attribute8_o                 =>per_cag_shd.g_old_rec.attribute8,
343        p_attribute9_o                 =>per_cag_shd.g_old_rec.attribute9,
344        p_attribute10_o                =>per_cag_shd.g_old_rec.attribute10,
345        p_attribute11_o                =>per_cag_shd.g_old_rec.attribute11,
346        p_attribute12_o                =>per_cag_shd.g_old_rec.attribute12,
347        p_attribute13_o                =>per_cag_shd.g_old_rec.attribute13,
348        p_attribute14_o                =>per_cag_shd.g_old_rec.attribute14,
349        p_attribute15_o                =>per_cag_shd.g_old_rec.attribute15,
350        p_attribute16_o                =>per_cag_shd.g_old_rec.attribute16,
351        p_attribute17_o                =>per_cag_shd.g_old_rec.attribute17,
352        p_attribute18_o                =>per_cag_shd.g_old_rec.attribute18,
353        p_attribute19_o                =>per_cag_shd.g_old_rec.attribute19,
354        p_attribute20_o                =>per_cag_shd.g_old_rec.attribute20
355      );
356     --
357   exception
358     --
359     when hr_api.cannot_find_prog_unit then
360       --
361       hr_api.cannot_find_prog_unit_error
362         (p_module_name => 'per_collective_agreements'
363         ,p_hook_type   => 'AU');
364       --
365   end;
366   --
367   -- End of API User Hook for post_update.
368   --
369   --
370 
371   hr_utility.set_location(' Leaving:'||l_proc, 10);
372 End post_update;
373 --
374 -- ----------------------------------------------------------------------------
375 -- |-----------------------------< convert_defs >-----------------------------|
376 -- ----------------------------------------------------------------------------
377 -- {Start Of Comments}
378 --
379 -- Description:
380 --   The Convert_Defs procedure has one very important function:
381 --   It must return the record structure for the row with all system defaulted
382 --   values converted into its corresponding parameter value for update. When
383 --   we attempt to update a row through the Upd process , certain
384 --   parameters can be defaulted which enables flexibility in the calling of
385 --   the upd process (e.g. only attributes which need to be updated need to be
386 --   specified). For the upd process to determine which attributes
387 --   have NOT been specified we need to check if the parameter has a reserved
388 --   system default value. Therefore, for all parameters which have a
389 --   corresponding reserved system default mechanism specified we need to
390 --   check if a system default is being used. If a system default is being
391 --   used then we convert the defaulted value into its corresponding attribute
392 --   value held in the g_old_rec data structure.
393 --
394 -- Prerequisites:
395 --   This private function can only be called from the upd process.
396 --
397 -- In Parameters:
398 --   A Pl/Sql record structre.
399 --
400 -- Post Success:
401 --   The record structure will be returned with all system defaulted parameter
402 --   values converted into its current row attribute value.
403 --
404 -- Post Failure:
405 --   No direct error handling is required within this function. Any possible
406 --   errors within this procedure will be a PL/SQL value error due to conversion
407 --   of datatypes or data lengths.
408 --
409 -- Developer Implementation Notes:
410 --   None.
411 --
412 -- Access Status:
413 --   Internal Row Handler Use Only.
414 --
415 -- {End Of Comments}
416 -- ----------------------------------------------------------------------------
417 Procedure convert_defs(p_rec in out nocopy per_cag_shd.g_rec_type) is
418 --
419   l_proc  varchar2(72) := g_package||'convert_defs';
420 --
421 Begin
422   --
423   hr_utility.set_location('Entering:'||l_proc, 5);
424   --
425   -- We must now examine each argument value in the
426   -- p_rec plsql record structure
427   -- to see if a system default is being used. If a system default
428   -- is being used then we must set to the 'current' argument value.
429   --
430   If (p_rec.business_group_id = hr_api.g_number) then
431     p_rec.business_group_id :=
432     per_cag_shd.g_old_rec.business_group_id;
433   End If;
434   If (p_rec.name = hr_api.g_varchar2) then
435     p_rec.name :=
436     per_cag_shd.g_old_rec.name;
437   End If;
438   If (p_rec.status = hr_api.g_varchar2) then
439     p_rec.status :=
440     per_cag_shd.g_old_rec.status;
441   End If;
442 
443 
444   If (p_rec.cag_number = hr_api.g_number) then
445     p_rec.cag_number :=
446     per_cag_shd.g_old_rec.cag_number;
447   End If;
448   If (p_rec.description = hr_api.g_varchar2) then
449     p_rec.description :=
450     per_cag_shd.g_old_rec.description;
451   End If;
452   If (p_rec.start_date = hr_api.g_date) then
453     p_rec.start_date :=
454     per_cag_shd.g_old_rec.start_date;
455   End If;
456   If (p_rec.end_date = hr_api.g_date) then
457     p_rec.end_date :=
458     per_cag_shd.g_old_rec.end_date;
459   End If;
460   If (p_rec.employer_organization_id = hr_api.g_number) then
461     p_rec.employer_organization_id :=
462     per_cag_shd.g_old_rec.employer_organization_id;
463   End If;
464   If (p_rec.employer_signatory = hr_api.g_varchar2) then
465     p_rec.employer_signatory :=
466     per_cag_shd.g_old_rec.employer_signatory;
467   End If;
468   If (p_rec.bargaining_organization_id = hr_api.g_number) then
469     p_rec.bargaining_organization_id :=
470     per_cag_shd.g_old_rec.bargaining_organization_id;
471   End If;
472   If (p_rec.bargaining_unit_signatory = hr_api.g_varchar2) then
473     p_rec.bargaining_unit_signatory :=
474     per_cag_shd.g_old_rec.bargaining_unit_signatory;
475   End If;
476   If (p_rec.jurisdiction = hr_api.g_varchar2) then
477     p_rec.jurisdiction :=
478     per_cag_shd.g_old_rec.jurisdiction;
479   End If;
480   If (p_rec.authorizing_body = hr_api.g_varchar2) then
481     p_rec.authorizing_body :=
482     per_cag_shd.g_old_rec.authorizing_body;
483   End If;
484   If (p_rec.authorized_date = hr_api.g_date) then
485     p_rec.authorized_date :=
486     per_cag_shd.g_old_rec.authorized_date;
487   End If;
488   If (p_rec.cag_information_category = hr_api.g_varchar2) then
489     p_rec.cag_information_category :=
490     per_cag_shd.g_old_rec.cag_information_category;
491   End If;
492   If (p_rec.cag_information1 = hr_api.g_varchar2) then
493     p_rec.cag_information1 :=
494     per_cag_shd.g_old_rec.cag_information1;
495   End If;
496   If (p_rec.cag_information2 = hr_api.g_varchar2) then
497     p_rec.cag_information2 :=
498     per_cag_shd.g_old_rec.cag_information2;
499   End If;
500   If (p_rec.cag_information3 = hr_api.g_varchar2) then
501     p_rec.cag_information3 :=
502     per_cag_shd.g_old_rec.cag_information3;
503   End If;
504   If (p_rec.cag_information4 = hr_api.g_varchar2) then
505     p_rec.cag_information4 :=
506     per_cag_shd.g_old_rec.cag_information4;
507   End If;
508   If (p_rec.cag_information5 = hr_api.g_varchar2) then
509     p_rec.cag_information5 :=
510     per_cag_shd.g_old_rec.cag_information5;
511   End If;
512   If (p_rec.cag_information6 = hr_api.g_varchar2) then
513     p_rec.cag_information6 :=
514     per_cag_shd.g_old_rec.cag_information6;
515   End If;
516   If (p_rec.cag_information7 = hr_api.g_varchar2) then
517     p_rec.cag_information7 :=
518     per_cag_shd.g_old_rec.cag_information7;
519   End If;
520   If (p_rec.cag_information8 = hr_api.g_varchar2) then
521     p_rec.cag_information8 :=
522     per_cag_shd.g_old_rec.cag_information8;
523   End If;
524   If (p_rec.cag_information9 = hr_api.g_varchar2) then
525     p_rec.cag_information9 :=
526     per_cag_shd.g_old_rec.cag_information9;
527   End If;
528   If (p_rec.cag_information10 = hr_api.g_varchar2) then
529     p_rec.cag_information10 :=
530     per_cag_shd.g_old_rec.cag_information10;
531   End If;
532   If (p_rec.cag_information11 = hr_api.g_varchar2) then
533     p_rec.cag_information11 :=
534     per_cag_shd.g_old_rec.cag_information11;
535   End If;
536   If (p_rec.cag_information12 = hr_api.g_varchar2) then
537     p_rec.cag_information12 :=
538     per_cag_shd.g_old_rec.cag_information12;
539   End If;
540   If (p_rec.cag_information13 = hr_api.g_varchar2) then
541     p_rec.cag_information13 :=
542     per_cag_shd.g_old_rec.cag_information13;
543   End If;
544   If (p_rec.cag_information14 = hr_api.g_varchar2) then
545     p_rec.cag_information14 :=
546     per_cag_shd.g_old_rec.cag_information14;
547   End If;
548   If (p_rec.cag_information15 = hr_api.g_varchar2) then
549     p_rec.cag_information15 :=
550     per_cag_shd.g_old_rec.cag_information15;
551   End If;
552   If (p_rec.cag_information16 = hr_api.g_varchar2) then
553     p_rec.cag_information16 :=
554     per_cag_shd.g_old_rec.cag_information16;
555   End If;
556   If (p_rec.cag_information17 = hr_api.g_varchar2) then
557     p_rec.cag_information17 :=
558     per_cag_shd.g_old_rec.cag_information17;
559   End If;
560   If (p_rec.cag_information18 = hr_api.g_varchar2) then
561     p_rec.cag_information18 :=
562     per_cag_shd.g_old_rec.cag_information18;
563   End If;
564   If (p_rec.cag_information19 = hr_api.g_varchar2) then
565     p_rec.cag_information19 :=
566     per_cag_shd.g_old_rec.cag_information19;
567   End If;
568   If (p_rec.cag_information20 = hr_api.g_varchar2) then
569     p_rec.cag_information20 :=
570     per_cag_shd.g_old_rec.cag_information20;
571   End If;
572   If (p_rec.attribute_category = hr_api.g_varchar2) then
573     p_rec.attribute_category :=
574     per_cag_shd.g_old_rec.attribute_category;
575   End If;
576   If (p_rec.attribute1 = hr_api.g_varchar2) then
577     p_rec.attribute1 :=
578     per_cag_shd.g_old_rec.attribute1;
579   End If;
580   If (p_rec.attribute2 = hr_api.g_varchar2) then
581     p_rec.attribute2 :=
582     per_cag_shd.g_old_rec.attribute2;
583   End If;
584   If (p_rec.attribute3 = hr_api.g_varchar2) then
585     p_rec.attribute3 :=
586     per_cag_shd.g_old_rec.attribute3;
587   End If;
588   If (p_rec.attribute4 = hr_api.g_varchar2) then
589     p_rec.attribute4 :=
590     per_cag_shd.g_old_rec.attribute4;
591   End If;
592   If (p_rec.attribute5 = hr_api.g_varchar2) then
593     p_rec.attribute5 :=
594     per_cag_shd.g_old_rec.attribute5;
595   End If;
596   If (p_rec.attribute6 = hr_api.g_varchar2) then
597     p_rec.attribute6 :=
598     per_cag_shd.g_old_rec.attribute6;
599   End If;
600   If (p_rec.attribute7 = hr_api.g_varchar2) then
601     p_rec.attribute7 :=
602     per_cag_shd.g_old_rec.attribute7;
603   End If;
604   If (p_rec.attribute8 = hr_api.g_varchar2) then
605     p_rec.attribute8 :=
606     per_cag_shd.g_old_rec.attribute8;
607   End If;
608   If (p_rec.attribute9 = hr_api.g_varchar2) then
609     p_rec.attribute9 :=
610     per_cag_shd.g_old_rec.attribute9;
611   End If;
612   If (p_rec.attribute10 = hr_api.g_varchar2) then
613     p_rec.attribute10 :=
614     per_cag_shd.g_old_rec.attribute10;
615   End If;
616   If (p_rec.attribute11 = hr_api.g_varchar2) then
617     p_rec.attribute11 :=
618     per_cag_shd.g_old_rec.attribute11;
619   End If;
620   If (p_rec.attribute12 = hr_api.g_varchar2) then
621     p_rec.attribute12 :=
622     per_cag_shd.g_old_rec.attribute12;
623   End If;
624   If (p_rec.attribute13 = hr_api.g_varchar2) then
625     p_rec.attribute13 :=
626     per_cag_shd.g_old_rec.attribute13;
627   End If;
628   If (p_rec.attribute14 = hr_api.g_varchar2) then
629     p_rec.attribute14 :=
630     per_cag_shd.g_old_rec.attribute14;
631   End If;
632   If (p_rec.attribute15 = hr_api.g_varchar2) then
633     p_rec.attribute15 :=
634     per_cag_shd.g_old_rec.attribute15;
635   End If;
636   If (p_rec.attribute16 = hr_api.g_varchar2) then
637     p_rec.attribute16 :=
638     per_cag_shd.g_old_rec.attribute16;
639   End If;
640   If (p_rec.attribute17 = hr_api.g_varchar2) then
641     p_rec.attribute17 :=
642     per_cag_shd.g_old_rec.attribute17;
643   End If;
644   If (p_rec.attribute18 = hr_api.g_varchar2) then
645     p_rec.attribute18 :=
646     per_cag_shd.g_old_rec.attribute18;
647   End If;
648   If (p_rec.attribute19 = hr_api.g_varchar2) then
649     p_rec.attribute19 :=
650     per_cag_shd.g_old_rec.attribute19;
651   End If;
652   If (p_rec.attribute20 = hr_api.g_varchar2) then
653     p_rec.attribute20 :=
654     per_cag_shd.g_old_rec.attribute20;
655   End If;
656   --
657   hr_utility.set_location(' Leaving:'||l_proc, 10);
658 --
659 End convert_defs;
660 --
661 -- ----------------------------------------------------------------------------
662 -- |---------------------------------< upd >----------------------------------|
663 -- ----------------------------------------------------------------------------
664 Procedure upd
665   (
666   p_rec        in out nocopy per_cag_shd.g_rec_type
667   ) is
668 --
669   l_proc  varchar2(72) := g_package||'upd';
670 --
671 Begin
672   hr_utility.set_location('Entering:'||l_proc, 5);
673   --
674   -- We must lock the row which we need to update.
675   --
676   per_cag_shd.lck
677 	(
678 	p_rec.collective_agreement_id,
679 	p_rec.object_version_number
680 	);
681   --
682   -- 1. During an update system defaults are used to determine if
683   --    arguments have been defaulted or not. We must therefore
684   --    derive the full record structure values to be updated.
685   --
686   -- 2. Call the supporting update validate operations.
687   --
688   convert_defs(p_rec);
689   per_cag_bus.update_validate(p_rec);
690   --
691   -- Call the supporting pre-update operation
692   --
693   pre_update(p_rec);
694   --
695   -- Update the row.
696   --
697   update_dml(p_rec);
698   --
699   -- Call the supporting post-update operation
700   --
701   post_update(p_rec);
702 End upd;
703 --
704 -- ----------------------------------------------------------------------------
705 -- |---------------------------------< upd >----------------------------------|
706 -- ----------------------------------------------------------------------------
707 Procedure upd
708   (
709   p_collective_agreement_id      in number,
710   p_business_group_id            in number           default hr_api.g_number,
711   p_object_version_number        in out nocopy number,
712   p_name                         in varchar2         default hr_api.g_varchar2,
713   p_status                       in varchar2         default hr_api.g_varchar2,
714   p_cag_number                   in number           default hr_api.g_number,
715   p_description                  in varchar2         default hr_api.g_varchar2,
716   p_start_date                   in date             default hr_api.g_date,
717   p_end_date                     in date             default hr_api.g_date,
718   p_employer_organization_id     in number           default hr_api.g_number,
719   p_employer_signatory           in varchar2         default hr_api.g_varchar2,
720   p_bargaining_organization_id   in number           default hr_api.g_number,
721   p_bargaining_unit_signatory    in varchar2         default hr_api.g_varchar2,
722   p_jurisdiction                 in varchar2         default hr_api.g_varchar2,
723   p_authorizing_body             in varchar2         default hr_api.g_varchar2,
724   p_authorized_date              in date             default hr_api.g_date,
725   p_cag_information_category     in varchar2         default hr_api.g_varchar2,
726   p_cag_information1             in varchar2         default hr_api.g_varchar2,
727   p_cag_information2             in varchar2         default hr_api.g_varchar2,
728   p_cag_information3             in varchar2         default hr_api.g_varchar2,
729   p_cag_information4             in varchar2         default hr_api.g_varchar2,
730   p_cag_information5             in varchar2         default hr_api.g_varchar2,
731   p_cag_information6             in varchar2         default hr_api.g_varchar2,
732   p_cag_information7             in varchar2         default hr_api.g_varchar2,
733   p_cag_information8             in varchar2         default hr_api.g_varchar2,
734   p_cag_information9             in varchar2         default hr_api.g_varchar2,
735   p_cag_information10            in varchar2         default hr_api.g_varchar2,
736   p_cag_information11            in varchar2         default hr_api.g_varchar2,
737   p_cag_information12            in varchar2         default hr_api.g_varchar2,
738   p_cag_information13            in varchar2         default hr_api.g_varchar2,
739   p_cag_information14            in varchar2         default hr_api.g_varchar2,
740   p_cag_information15            in varchar2         default hr_api.g_varchar2,
741   p_cag_information16            in varchar2         default hr_api.g_varchar2,
742   p_cag_information17            in varchar2         default hr_api.g_varchar2,
743   p_cag_information18            in varchar2         default hr_api.g_varchar2,
744   p_cag_information19            in varchar2         default hr_api.g_varchar2,
745   p_cag_information20            in varchar2         default hr_api.g_varchar2,
746   p_attribute_category           in varchar2         default hr_api.g_varchar2,
747   p_attribute1                   in varchar2         default hr_api.g_varchar2,
748   p_attribute2                   in varchar2         default hr_api.g_varchar2,
749   p_attribute3                   in varchar2         default hr_api.g_varchar2,
750   p_attribute4                   in varchar2         default hr_api.g_varchar2,
751   p_attribute5                   in varchar2         default hr_api.g_varchar2,
752   p_attribute6                   in varchar2         default hr_api.g_varchar2,
753   p_attribute7                   in varchar2         default hr_api.g_varchar2,
754   p_attribute8                   in varchar2         default hr_api.g_varchar2,
755   p_attribute9                   in varchar2         default hr_api.g_varchar2,
756   p_attribute10                  in varchar2         default hr_api.g_varchar2,
757   p_attribute11                  in varchar2         default hr_api.g_varchar2,
758   p_attribute12                  in varchar2         default hr_api.g_varchar2,
759   p_attribute13                  in varchar2         default hr_api.g_varchar2,
760   p_attribute14                  in varchar2         default hr_api.g_varchar2,
761   p_attribute15                  in varchar2         default hr_api.g_varchar2,
762   p_attribute16                  in varchar2         default hr_api.g_varchar2,
763   p_attribute17                  in varchar2         default hr_api.g_varchar2,
764   p_attribute18                  in varchar2         default hr_api.g_varchar2,
765   p_attribute19                  in varchar2         default hr_api.g_varchar2,
766   p_attribute20                  in varchar2         default hr_api.g_varchar2
767   ) is
768 --
769   l_rec	  per_cag_shd.g_rec_type;
770   l_proc  varchar2(72) := g_package||'upd';
771 --
772 Begin
773   hr_utility.set_location('Entering:'||l_proc, 5);
774   --
775   -- Call conversion function to turn arguments into the
776   -- l_rec structure.
777   --
778   l_rec :=
779   per_cag_shd.convert_args
780   (
781   p_collective_agreement_id,
782   p_business_group_id,
783   p_object_version_number,
784   p_name,
785   NULL, -- Pl_ID is not updatable so not included as a parameter.
786   p_status,
787   p_cag_number,
788   p_description,
789   p_start_date,
790   p_end_date,
791   p_employer_organization_id,
792   p_employer_signatory,
793   p_bargaining_organization_id,
794   p_bargaining_unit_signatory,
795   p_jurisdiction,
796   p_authorizing_body,
797   p_authorized_date,
798   p_cag_information_category,
799   p_cag_information1,
800   p_cag_information2,
801   p_cag_information3,
802   p_cag_information4,
803   p_cag_information5,
804   p_cag_information6,
805   p_cag_information7,
806   p_cag_information8,
807   p_cag_information9,
808   p_cag_information10,
809   p_cag_information11,
810   p_cag_information12,
811   p_cag_information13,
812   p_cag_information14,
813   p_cag_information15,
814   p_cag_information16,
815   p_cag_information17,
816   p_cag_information18,
817   p_cag_information19,
818   p_cag_information20,
819   p_attribute_category,
820   p_attribute1,
821   p_attribute2,
822   p_attribute3,
823   p_attribute4,
824   p_attribute5,
825   p_attribute6,
826   p_attribute7,
827   p_attribute8,
828   p_attribute9,
829   p_attribute10,
830   p_attribute11,
831   p_attribute12,
832   p_attribute13,
833   p_attribute14,
834   p_attribute15,
835   p_attribute16,
836   p_attribute17,
837   p_attribute18,
838   p_attribute19,
839   p_attribute20
840   );
841   --
842   -- Having converted the arguments into the
843   -- plsql record structure we call the corresponding record
844   -- business process.
845   --
846   upd(l_rec);
847   p_object_version_number := l_rec.object_version_number;
848   --
849   hr_utility.set_location(' Leaving:'||l_proc, 10);
850 End upd;
851 --
852 end per_cag_upd;