DBA Data[Home] [Help]

PACKAGE BODY: APPS.PQH_CPD_UPD

Source


1 Package Body pqh_cpd_upd as
2 /* $Header: pqcpdrhi.pkb 120.0 2005/05/29 01:44:39 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  pqh_cpd_upd.';  -- Global package name
9 g_debug    boolean      := hr_utility.debug_enabled;
10 --
11 -- ----------------------------------------------------------------------------
12 -- |------------------------------< update_dml >------------------------------|
13 -- ----------------------------------------------------------------------------
14 -- {Start Of Comments}
15 --
16 -- Description:
17 --   This procedure controls the actual dml update logic. The processing of
18 --   this procedure is:
19 --   1) Increment the object_version_number by 1 if the object_version_number
20 --      is defined as an attribute for this entity.
21 --   2) To set and unset the g_api_dml status as required (as we are about to
22 --      perform dml).
23 --   3) To update the specified row in the schema using the primary key in
24 --      the predicates.
25 --   4) To trap any constraint violations that may have occurred.
26 --   5) To raise any other errors.
27 --
28 -- Prerequisites:
29 --   This is an internal private procedure which must be called from the upd
30 --   procedure.
31 --
32 -- In Parameters:
33 --   A Pl/Sql record structre.
34 --
35 -- Post Success:
36 --   The specified row will be updated in the schema.
37 --
38 -- Post Failure:
39 --   On the update dml failure it is important to note that we always reset the
40 --   g_api_dml status to false.
41 --   If a check, unique or parent integrity constraint violation is raised the
42 --   constraint_error procedure will be called.
43 --   If any other error is reported, the error will be raised after the
44 --   g_api_dml status is reset.
45 --
46 -- Developer Implementation Notes:
47 --   The update 'set' attribute list should be modified if any of your
48 --   attributes are not updateable.
49 --
50 -- Access Status:
51 --   Internal Row Handler Use Only.
52 --
53 -- {End Of Comments}
54 -- ----------------------------------------------------------------------------
55 Procedure update_dml
56   (p_rec in out nocopy pqh_cpd_shd.g_rec_type
57   ) is
58 --
59   l_proc  varchar2(72);
60 --
61 Begin
62   if g_debug then
63      l_proc := g_package||'update_dml';
64      hr_utility.set_location('Entering:'||l_proc, 5);
65   end if;
66   --
67   -- Increment the object version
68   p_rec.object_version_number := p_rec.object_version_number + 1;
69   --
70   pqh_cpd_shd.g_api_dml := true;  -- Set the api dml status
71   --
72   -- Update the pqh_corps_definitions Row
73   --
74   update pqh_corps_definitions
75     set
76      corps_definition_id             = p_rec.corps_definition_id
77     ,business_group_id               = p_rec.business_group_id
78     ,name                            = p_rec.name
79     ,status_cd                       = p_rec.status_cd
80     ,retirement_age                  = p_rec.retirement_age
81     ,category_cd                     = p_rec.category_cd
82     ,recruitment_end_date            = p_rec.recruitment_end_date
83     ,corps_type_cd                   = p_rec.corps_type_cd
84     ,starting_grade_step_id          = p_rec.starting_grade_step_id
85     ,task_desc                       = p_rec.task_desc
86     ,secondment_threshold            = p_rec.secondment_threshold
87     ,normal_hours                    = p_rec.normal_hours
88     ,normal_hours_frequency          = p_rec.normal_hours_frequency
89     ,minimum_hours                   = p_rec.minimum_hours
90     ,minimum_hours_frequency         = p_rec.minimum_hours_frequency
91     ,attribute1                      = p_rec.attribute1
92     ,attribute2                      = p_rec.attribute2
93     ,attribute3                      = p_rec.attribute3
94     ,attribute4                      = p_rec.attribute4
95     ,attribute5                      = p_rec.attribute5
96     ,attribute6                      = p_rec.attribute6
97     ,attribute7                      = p_rec.attribute7
98     ,attribute8                      = p_rec.attribute8
99     ,attribute9                      = p_rec.attribute9
100     ,attribute10                     = p_rec.attribute10
101     ,attribute11                     = p_rec.attribute11
102     ,attribute12                     = p_rec.attribute12
103     ,attribute13                     = p_rec.attribute13
104     ,attribute14                     = p_rec.attribute14
105     ,attribute15                     = p_rec.attribute15
106     ,attribute16                     = p_rec.attribute16
107     ,attribute17                     = p_rec.attribute17
108     ,attribute18                     = p_rec.attribute18
109     ,attribute19                     = p_rec.attribute19
110     ,attribute20                     = p_rec.attribute20
111     ,attribute21                     = p_rec.attribute21
112     ,attribute22                     = p_rec.attribute22
113     ,attribute23                     = p_rec.attribute23
114     ,attribute24                     = p_rec.attribute24
115     ,attribute25                     = p_rec.attribute25
116     ,attribute26                     = p_rec.attribute26
117     ,attribute27                     = p_rec.attribute27
118     ,attribute28                     = p_rec.attribute28
119     ,attribute29                     = p_rec.attribute29
120     ,attribute30                     = p_rec.attribute30
121     ,attribute_category              = p_rec.attribute_category
122     ,object_version_number           = p_rec.object_version_number
123     ,type_of_ps                      = p_rec.type_of_ps
124     ,date_from                       = p_rec.date_from
125     ,date_to                         = p_rec.date_to
126     ,primary_prof_field_id           = p_rec.primary_prof_field_id
127     ,starting_grade_id               = p_rec.starting_grade_id
128     ,ben_pgm_id                      = p_rec.ben_pgm_id
129     ,probation_period                = p_rec.probation_period
130     ,probation_units                 = p_rec.probation_units
131     where corps_definition_id = p_rec.corps_definition_id;
132   --
133   pqh_cpd_shd.g_api_dml := false;   -- Unset the api dml status
134   --
135   if g_debug then
136     hr_utility.set_location(' Leaving:'||l_proc, 10);
137   end if;
138 --
139 Exception
140   When hr_api.check_integrity_violated Then
141     -- A check constraint has been violated
142     pqh_cpd_shd.g_api_dml := false;   -- Unset the api dml status
143     pqh_cpd_shd.constraint_error
144       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
145   When hr_api.parent_integrity_violated Then
146     -- Parent integrity has been violated
147     pqh_cpd_shd.g_api_dml := false;   -- Unset the api dml status
148     pqh_cpd_shd.constraint_error
149       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
150   When hr_api.unique_integrity_violated Then
151     -- Unique integrity has been violated
152     pqh_cpd_shd.g_api_dml := false;   -- Unset the api dml status
153     pqh_cpd_shd.constraint_error
154       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
155   When Others Then
156     pqh_cpd_shd.g_api_dml := false;   -- Unset the api dml status
157     Raise;
158 End update_dml;
159 --
160 -- ----------------------------------------------------------------------------
161 -- |------------------------------< pre_update >------------------------------|
162 -- ----------------------------------------------------------------------------
163 -- {Start Of Comments}
164 --
165 -- Description:
166 --   This private procedure contains any processing which is required before
167 --   the update dml.
168 --
169 -- Prerequisites:
170 --   This is an internal procedure which is called from the upd procedure.
171 --
172 -- In Parameters:
173 --   A Pl/Sql record structure.
174 --
175 -- Post Success:
176 --   Processing continues.
177 --
178 -- Post Failure:
179 --   If an error has occurred, an error message and exception wil be raised
180 --   but not handled.
181 --
182 -- Developer Implementation Notes:
183 --   Any pre-processing required before the update dml is issued should be
184 --   coded within this procedure. It is important to note that any 3rd party
185 --   maintenance should be reviewed before placing in this procedure.
186 --
187 -- Access Status:
188 --   Internal Row Handler Use Only.
189 --
190 -- {End Of Comments}
191 -- ----------------------------------------------------------------------------
192 Procedure pre_update
193   (p_rec in pqh_cpd_shd.g_rec_type
194   ) is
195 --
196   l_proc  varchar2(72);
197 --
198 Begin
199   if g_debug then
200     l_proc := g_package||'pre_update';
201     hr_utility.set_location('Entering:'||l_proc, 5);
202   end if;
203   --
204   if g_debug then
205     hr_utility.set_location(' Leaving:'||l_proc, 10);
206   end if;
207 End pre_update;
208 --
209 -- ----------------------------------------------------------------------------
210 -- |-----------------------------< post_update >------------------------------|
211 -- ----------------------------------------------------------------------------
212 -- {Start Of Comments}
213 --
214 -- Description:
215 --   This private procedure contains any processing which is required after
216 --   the update dml.
217 --
218 -- Prerequisites:
219 --   This is an internal procedure which is called from the upd procedure.
220 --
221 -- In Parameters:
222 --   A Pl/Sql record structure.
223 --
224 -- Post Success:
225 --   Processing continues.
226 --
227 -- Post Failure:
228 --   If an error has occurred, an error message and exception will be raised
229 --   but not handled.
230 --
231 -- Developer Implementation Notes:
232 --   Any post-processing required after the update dml is issued should be
233 --   coded within this procedure. It is important to note that any 3rd party
234 --   maintenance should be reviewed before placing in this procedure.
235 --
236 -- Access Status:
237 --   Internal Row Handler Use Only.
238 --
239 -- {End Of Comments}
240 -- ----------------------------------------------------------------------------
241 Procedure post_update
242   (p_effective_date               in date
243   ,p_rec                          in pqh_cpd_shd.g_rec_type
244   ) is
245 --
246   l_proc  varchar2(72);
247 --
248 Begin
249   if g_debug then
250      l_proc := g_package||'post_update';
251      hr_utility.set_location('Entering:'||l_proc, 5);
252   end if;
253   begin
254     --
255     pqh_cpd_rku.after_update
256       (p_effective_date              => p_effective_date
257       ,p_corps_definition_id
258       => p_rec.corps_definition_id
259       ,p_business_group_id
260       => p_rec.business_group_id
261       ,p_name
262       => p_rec.name
263       ,p_status_cd
264       => p_rec.status_cd
265       ,p_retirement_age
266       => p_rec.retirement_age
267       ,p_category_cd
268       => p_rec.category_cd
269       ,p_recruitment_end_date
270       => p_rec.recruitment_end_date
271       ,p_corps_type_cd
272       => p_rec.corps_type_cd
273       ,p_starting_grade_step_id
274       => p_rec.starting_grade_step_id
275       ,p_task_desc
276       => p_rec.task_desc
277       ,p_secondment_threshold
278       => p_rec.secondment_threshold
279       ,p_normal_hours
280       => p_rec.normal_hours
281       ,p_normal_hours_frequency
282       => p_rec.normal_hours_frequency
283       ,p_minimum_hours
284       => p_rec.minimum_hours
285       ,p_minimum_hours_frequency
286       => p_rec.minimum_hours_frequency
287       ,p_attribute1
288       => p_rec.attribute1
289       ,p_attribute2
290       => p_rec.attribute2
291       ,p_attribute3
292       => p_rec.attribute3
293       ,p_attribute4
294       => p_rec.attribute4
295       ,p_attribute5
296       => p_rec.attribute5
297       ,p_attribute6
298       => p_rec.attribute6
299       ,p_attribute7
300       => p_rec.attribute7
301       ,p_attribute8
302       => p_rec.attribute8
303       ,p_attribute9
304       => p_rec.attribute9
305       ,p_attribute10
306       => p_rec.attribute10
307       ,p_attribute11
308       => p_rec.attribute11
309       ,p_attribute12
310       => p_rec.attribute12
311       ,p_attribute13
312       => p_rec.attribute13
313       ,p_attribute14
314       => p_rec.attribute14
315       ,p_attribute15
316       => p_rec.attribute15
317       ,p_attribute16
318       => p_rec.attribute16
319       ,p_attribute17
320       => p_rec.attribute17
321       ,p_attribute18
322       => p_rec.attribute18
323       ,p_attribute19
324       => p_rec.attribute19
325       ,p_attribute20
326       => p_rec.attribute20
327       ,p_attribute21
328       => p_rec.attribute21
329       ,p_attribute22
330       => p_rec.attribute22
331       ,p_attribute23
332       => p_rec.attribute23
333       ,p_attribute24
334       => p_rec.attribute24
335       ,p_attribute25
336       => p_rec.attribute25
337       ,p_attribute26
338       => p_rec.attribute26
339       ,p_attribute27
340       => p_rec.attribute27
341       ,p_attribute28
342       => p_rec.attribute28
343       ,p_attribute29
344       => p_rec.attribute29
345       ,p_attribute30
346       => p_rec.attribute30
347       ,p_attribute_category
348       => p_rec.attribute_category
349       ,p_object_version_number
350       => p_rec.object_version_number
351       ,p_type_of_ps
352       => p_rec.type_of_ps
353       ,p_date_from
354       => p_rec.date_from
355       ,p_date_to
356       => p_rec.date_to
357       ,p_primary_prof_field_id
358       => p_rec.primary_prof_field_id
359       ,p_starting_grade_id
360       => p_rec.starting_grade_id
361       ,p_ben_pgm_id
362       => p_rec.ben_pgm_id
363       ,p_probation_period
364       => p_rec.probation_period
365       ,p_probation_units
366       => p_rec.probation_units
367       ,p_business_group_id_o
368       => pqh_cpd_shd.g_old_rec.business_group_id
369       ,p_name_o
370       => pqh_cpd_shd.g_old_rec.name
371       ,p_status_cd_o
372       => pqh_cpd_shd.g_old_rec.status_cd
373       ,p_retirement_age_o
374       => pqh_cpd_shd.g_old_rec.retirement_age
375       ,p_category_cd_o
376       => pqh_cpd_shd.g_old_rec.category_cd
377       ,p_recruitment_end_date_o
378       => pqh_cpd_shd.g_old_rec.recruitment_end_date
379       ,p_corps_type_cd_o
380       => pqh_cpd_shd.g_old_rec.corps_type_cd
381       ,p_starting_grade_step_id_o
382       => pqh_cpd_shd.g_old_rec.starting_grade_step_id
383       ,p_task_desc_o
384       => pqh_cpd_shd.g_old_rec.task_desc
385       ,p_secondment_threshold_o
386       => pqh_cpd_shd.g_old_rec.secondment_threshold
387       ,p_normal_hours_o
388       => pqh_cpd_shd.g_old_rec.normal_hours
389       ,p_normal_hours_frequency_o
390       => pqh_cpd_shd.g_old_rec.normal_hours_frequency
391       ,p_minimum_hours_o
392       => pqh_cpd_shd.g_old_rec.minimum_hours
393       ,p_minimum_hours_frequency_o
394       => pqh_cpd_shd.g_old_rec.minimum_hours_frequency
395       ,p_attribute1_o
396       => pqh_cpd_shd.g_old_rec.attribute1
397       ,p_attribute2_o
398       => pqh_cpd_shd.g_old_rec.attribute2
399       ,p_attribute3_o
400       => pqh_cpd_shd.g_old_rec.attribute3
401       ,p_attribute4_o
402       => pqh_cpd_shd.g_old_rec.attribute4
403       ,p_attribute5_o
404       => pqh_cpd_shd.g_old_rec.attribute5
405       ,p_attribute6_o
406       => pqh_cpd_shd.g_old_rec.attribute6
407       ,p_attribute7_o
408       => pqh_cpd_shd.g_old_rec.attribute7
409       ,p_attribute8_o
410       => pqh_cpd_shd.g_old_rec.attribute8
411       ,p_attribute9_o
412       => pqh_cpd_shd.g_old_rec.attribute9
413       ,p_attribute10_o
414       => pqh_cpd_shd.g_old_rec.attribute10
415       ,p_attribute11_o
416       => pqh_cpd_shd.g_old_rec.attribute11
417       ,p_attribute12_o
418       => pqh_cpd_shd.g_old_rec.attribute12
419       ,p_attribute13_o
420       => pqh_cpd_shd.g_old_rec.attribute13
421       ,p_attribute14_o
422       => pqh_cpd_shd.g_old_rec.attribute14
423       ,p_attribute15_o
424       => pqh_cpd_shd.g_old_rec.attribute15
425       ,p_attribute16_o
426       => pqh_cpd_shd.g_old_rec.attribute16
427       ,p_attribute17_o
428       => pqh_cpd_shd.g_old_rec.attribute17
429       ,p_attribute18_o
430       => pqh_cpd_shd.g_old_rec.attribute18
431       ,p_attribute19_o
432       => pqh_cpd_shd.g_old_rec.attribute19
433       ,p_attribute20_o
434       => pqh_cpd_shd.g_old_rec.attribute20
435       ,p_attribute21_o
436       => pqh_cpd_shd.g_old_rec.attribute21
437       ,p_attribute22_o
438       => pqh_cpd_shd.g_old_rec.attribute22
439       ,p_attribute23_o
440       => pqh_cpd_shd.g_old_rec.attribute23
441       ,p_attribute24_o
442       => pqh_cpd_shd.g_old_rec.attribute24
443       ,p_attribute25_o
444       => pqh_cpd_shd.g_old_rec.attribute25
445       ,p_attribute26_o
446       => pqh_cpd_shd.g_old_rec.attribute26
447       ,p_attribute27_o
448       => pqh_cpd_shd.g_old_rec.attribute27
449       ,p_attribute28_o
450       => pqh_cpd_shd.g_old_rec.attribute28
451       ,p_attribute29_o
452       => pqh_cpd_shd.g_old_rec.attribute29
453       ,p_attribute30_o
454       => pqh_cpd_shd.g_old_rec.attribute30
455       ,p_attribute_category_o
456       => pqh_cpd_shd.g_old_rec.attribute_category
457       ,p_object_version_number_o
458       => pqh_cpd_shd.g_old_rec.object_version_number
459       ,p_type_of_ps_o
460       => pqh_cpd_shd.g_old_rec.type_of_ps
461       ,p_date_from_o
462       => pqh_cpd_shd.g_old_rec.date_from
463       ,p_date_to_o
464       => pqh_cpd_shd.g_old_rec.date_to
465       ,p_primary_prof_field_id_o
466       => pqh_cpd_shd.g_old_rec.primary_prof_field_id
467       ,p_starting_grade_id_o
468       => pqh_cpd_shd.g_old_rec.starting_grade_id
469       ,p_ben_pgm_id_o
470       => pqh_cpd_shd.g_old_rec.ben_pgm_id
471       ,p_probation_period_o
472       => pqh_cpd_shd.g_old_rec.probation_period
473       ,p_probation_units_o
474       => pqh_cpd_shd.g_old_rec.probation_units
475       );
476     --
477   exception
478     --
479     when hr_api.cannot_find_prog_unit then
480       --
481       hr_api.cannot_find_prog_unit_error
482         (p_module_name => 'PQH_CORPS_DEFINITIONS'
483         ,p_hook_type   => 'AU');
484       --
485   end;
486   --
487   if g_debug then
488      hr_utility.set_location(' Leaving:'||l_proc, 10);
489   end if;
490 End post_update;
491 --
492 -- ----------------------------------------------------------------------------
493 -- |-----------------------------< convert_defs >-----------------------------|
494 -- ----------------------------------------------------------------------------
495 -- {Start Of Comments}
496 --
497 -- Description:
498 --   The Convert_Defs procedure has one very important function:
499 --   It must return the record structure for the row with all system defaulted
500 --   values converted into its corresponding parameter value for update. When
501 --   we attempt to update a row through the Upd process , certain
502 --   parameters can be defaulted which enables flexibility in the calling of
503 --   the upd process (e.g. only attributes which need to be updated need to be
504 --   specified). For the upd process to determine which attributes
505 --   have NOT been specified we need to check if the parameter has a reserved
506 --   system default value. Therefore, for all parameters which have a
507 --   corresponding reserved system default mechanism specified we need to
508 --   check if a system default is being used. If a system default is being
509 --   used then we convert the defaulted value into its corresponding attribute
510 --   value held in the g_old_rec data structure.
511 --
512 -- Prerequisites:
513 --   This private function can only be called from the upd process.
514 --
515 -- In Parameters:
516 --   A Pl/Sql record structure.
517 --
518 -- Post Success:
519 --   The record structure will be returned with all system defaulted parameter
520 --   values converted into its current row attribute value.
521 --
522 -- Post Failure:
523 --   No direct error handling is required within this function. Any possible
524 --   errors within this procedure will be a PL/SQL value error due to
525 --   conversion of datatypes or data lengths.
526 --
527 -- Developer Implementation Notes:
528 --   None.
529 --
530 -- Access Status:
531 --   Internal Row Handler Use Only.
532 --
533 -- {End Of Comments}
534 -- ----------------------------------------------------------------------------
535 Procedure convert_defs
536   (p_rec in out nocopy pqh_cpd_shd.g_rec_type
537   ) is
538 --
539 Begin
540   --
541   -- We must now examine each argument value in the
542   -- p_rec plsql record structure
543   -- to see if a system default is being used. If a system default
544   -- is being used then we must set to the 'current' argument value.
545   --
546   If (p_rec.business_group_id = hr_api.g_number) then
547     p_rec.business_group_id :=
548     pqh_cpd_shd.g_old_rec.business_group_id;
549   End If;
550   If (p_rec.name = hr_api.g_varchar2) then
551     p_rec.name :=
552     pqh_cpd_shd.g_old_rec.name;
553   End If;
554   If (p_rec.status_cd = hr_api.g_varchar2) then
555     p_rec.status_cd :=
556     pqh_cpd_shd.g_old_rec.status_cd;
557   End If;
558   If (p_rec.retirement_age = hr_api.g_number) then
559     p_rec.retirement_age :=
560     pqh_cpd_shd.g_old_rec.retirement_age;
561   End If;
562   If (p_rec.category_cd = hr_api.g_varchar2) then
563     p_rec.category_cd :=
564     pqh_cpd_shd.g_old_rec.category_cd;
565   End If;
566   If (p_rec.recruitment_end_date = hr_api.g_date) then
567     p_rec.recruitment_end_date :=
568     pqh_cpd_shd.g_old_rec.recruitment_end_date;
569   End If;
570   If (p_rec.corps_type_cd = hr_api.g_varchar2) then
571     p_rec.corps_type_cd :=
572     pqh_cpd_shd.g_old_rec.corps_type_cd;
573   End If;
574   If (p_rec.starting_grade_step_id = hr_api.g_number) then
575     p_rec.starting_grade_step_id :=
576     pqh_cpd_shd.g_old_rec.starting_grade_step_id;
577   End If;
578   If (p_rec.task_desc = hr_api.g_varchar2) then
579     p_rec.task_desc :=
580     pqh_cpd_shd.g_old_rec.task_desc;
581   End If;
582   If (p_rec.secondment_threshold = hr_api.g_number) then
583     p_rec.secondment_threshold :=
584     pqh_cpd_shd.g_old_rec.secondment_threshold;
585   End If;
586   If (p_rec.normal_hours = hr_api.g_number) then
587     p_rec.normal_hours :=
588     pqh_cpd_shd.g_old_rec.normal_hours;
589   End If;
590   If (p_rec.normal_hours_frequency = hr_api.g_varchar2) then
591     p_rec.normal_hours_frequency :=
592     pqh_cpd_shd.g_old_rec.normal_hours_frequency;
593   End If;
594   If (p_rec.minimum_hours = hr_api.g_number) then
595     p_rec.minimum_hours :=
596     pqh_cpd_shd.g_old_rec.minimum_hours;
597   End If;
598   If (p_rec.minimum_hours_frequency = hr_api.g_varchar2) then
599     p_rec.minimum_hours_frequency :=
600     pqh_cpd_shd.g_old_rec.minimum_hours_frequency;
601   End If;
602   If (p_rec.attribute1 = hr_api.g_varchar2) then
603     p_rec.attribute1 :=
604     pqh_cpd_shd.g_old_rec.attribute1;
605   End If;
606   If (p_rec.attribute2 = hr_api.g_varchar2) then
607     p_rec.attribute2 :=
608     pqh_cpd_shd.g_old_rec.attribute2;
609   End If;
610   If (p_rec.attribute3 = hr_api.g_varchar2) then
611     p_rec.attribute3 :=
612     pqh_cpd_shd.g_old_rec.attribute3;
613   End If;
614   If (p_rec.attribute4 = hr_api.g_varchar2) then
615     p_rec.attribute4 :=
616     pqh_cpd_shd.g_old_rec.attribute4;
617   End If;
618   If (p_rec.attribute5 = hr_api.g_varchar2) then
619     p_rec.attribute5 :=
620     pqh_cpd_shd.g_old_rec.attribute5;
621   End If;
622   If (p_rec.attribute6 = hr_api.g_varchar2) then
623     p_rec.attribute6 :=
624     pqh_cpd_shd.g_old_rec.attribute6;
625   End If;
626   If (p_rec.attribute7 = hr_api.g_varchar2) then
627     p_rec.attribute7 :=
628     pqh_cpd_shd.g_old_rec.attribute7;
629   End If;
630   If (p_rec.attribute8 = hr_api.g_varchar2) then
631     p_rec.attribute8 :=
632     pqh_cpd_shd.g_old_rec.attribute8;
633   End If;
634   If (p_rec.attribute9 = hr_api.g_varchar2) then
635     p_rec.attribute9 :=
636     pqh_cpd_shd.g_old_rec.attribute9;
637   End If;
638   If (p_rec.attribute10 = hr_api.g_varchar2) then
639     p_rec.attribute10 :=
640     pqh_cpd_shd.g_old_rec.attribute10;
641   End If;
642   If (p_rec.attribute11 = hr_api.g_varchar2) then
643     p_rec.attribute11 :=
644     pqh_cpd_shd.g_old_rec.attribute11;
645   End If;
646   If (p_rec.attribute12 = hr_api.g_varchar2) then
647     p_rec.attribute12 :=
648     pqh_cpd_shd.g_old_rec.attribute12;
649   End If;
650   If (p_rec.attribute13 = hr_api.g_varchar2) then
651     p_rec.attribute13 :=
652     pqh_cpd_shd.g_old_rec.attribute13;
653   End If;
654   If (p_rec.attribute14 = hr_api.g_varchar2) then
655     p_rec.attribute14 :=
656     pqh_cpd_shd.g_old_rec.attribute14;
657   End If;
658   If (p_rec.attribute15 = hr_api.g_varchar2) then
659     p_rec.attribute15 :=
660     pqh_cpd_shd.g_old_rec.attribute15;
661   End If;
662   If (p_rec.attribute16 = hr_api.g_varchar2) then
663     p_rec.attribute16 :=
664     pqh_cpd_shd.g_old_rec.attribute16;
665   End If;
666   If (p_rec.attribute17 = hr_api.g_varchar2) then
667     p_rec.attribute17 :=
668     pqh_cpd_shd.g_old_rec.attribute17;
669   End If;
670   If (p_rec.attribute18 = hr_api.g_varchar2) then
671     p_rec.attribute18 :=
672     pqh_cpd_shd.g_old_rec.attribute18;
673   End If;
674   If (p_rec.attribute19 = hr_api.g_varchar2) then
675     p_rec.attribute19 :=
676     pqh_cpd_shd.g_old_rec.attribute19;
677   End If;
678   If (p_rec.attribute20 = hr_api.g_varchar2) then
679     p_rec.attribute20 :=
680     pqh_cpd_shd.g_old_rec.attribute20;
681   End If;
682   If (p_rec.attribute21 = hr_api.g_varchar2) then
683     p_rec.attribute21 :=
684     pqh_cpd_shd.g_old_rec.attribute21;
685   End If;
686   If (p_rec.attribute22 = hr_api.g_varchar2) then
687     p_rec.attribute22 :=
688     pqh_cpd_shd.g_old_rec.attribute22;
689   End If;
690   If (p_rec.attribute23 = hr_api.g_varchar2) then
691     p_rec.attribute23 :=
692     pqh_cpd_shd.g_old_rec.attribute23;
693   End If;
694   If (p_rec.attribute24 = hr_api.g_varchar2) then
695     p_rec.attribute24 :=
696     pqh_cpd_shd.g_old_rec.attribute24;
697   End If;
698   If (p_rec.attribute25 = hr_api.g_varchar2) then
699     p_rec.attribute25 :=
700     pqh_cpd_shd.g_old_rec.attribute25;
701   End If;
702   If (p_rec.attribute26 = hr_api.g_varchar2) then
703     p_rec.attribute26 :=
704     pqh_cpd_shd.g_old_rec.attribute26;
705   End If;
706   If (p_rec.attribute27 = hr_api.g_varchar2) then
707     p_rec.attribute27 :=
708     pqh_cpd_shd.g_old_rec.attribute27;
709   End If;
710   If (p_rec.attribute28 = hr_api.g_varchar2) then
711     p_rec.attribute28 :=
712     pqh_cpd_shd.g_old_rec.attribute28;
713   End If;
714   If (p_rec.attribute29 = hr_api.g_varchar2) then
715     p_rec.attribute29 :=
716     pqh_cpd_shd.g_old_rec.attribute29;
717   End If;
718   If (p_rec.attribute30 = hr_api.g_varchar2) then
719     p_rec.attribute30 :=
720     pqh_cpd_shd.g_old_rec.attribute30;
721   End If;
722   If (p_rec.attribute_category = hr_api.g_varchar2) then
723     p_rec.attribute_category :=
724     pqh_cpd_shd.g_old_rec.attribute_category;
725   End If;
726   If (p_rec.type_of_ps = hr_api.g_varchar2) then
727     p_rec.type_of_ps :=
728     pqh_cpd_shd.g_old_rec.type_of_ps;
729   End If;
730   If (p_rec.date_from = hr_api.g_date) then
731     p_rec.date_from :=
732     pqh_cpd_shd.g_old_rec.date_from;
733   End If;
734   If (p_rec.date_to = hr_api.g_date) then
735     p_rec.date_to :=
736     pqh_cpd_shd.g_old_rec.date_to;
737   End If;
738   If (p_rec.primary_prof_field_id = hr_api.g_number) then
739     p_rec.primary_prof_field_id :=
740     pqh_cpd_shd.g_old_rec.primary_prof_field_id;
741   End If;
742   If (p_rec.starting_grade_id = hr_api.g_number) then
743     p_rec.starting_grade_id :=
744     pqh_cpd_shd.g_old_rec.starting_grade_id;
745   End If;
746   If (p_rec.ben_pgm_id = hr_api.g_number) then
747     p_rec.ben_pgm_id :=
748     pqh_cpd_shd.g_old_rec.ben_pgm_id;
749   End If;
750   If (p_rec.probation_period = hr_api.g_number) then
751     p_rec.probation_period :=
752     pqh_cpd_shd.g_old_rec.probation_period;
753   End If;
754   If (p_rec.probation_units = hr_api.g_varchar2) then
755     p_rec.probation_units :=
756     pqh_cpd_shd.g_old_rec.probation_units;
757   End If;
758   --
759 End convert_defs;
760 --
761 -- ----------------------------------------------------------------------------
762 -- |---------------------------------< upd >----------------------------------|
763 -- ----------------------------------------------------------------------------
764 Procedure upd
765   (p_effective_date               in date
766   ,p_rec                          in out nocopy pqh_cpd_shd.g_rec_type
767   ) is
768 --
769   l_proc  varchar2(72);
770 --
771 Begin
772   if g_debug then
773     l_proc := g_package||'upd';
774     hr_utility.set_location('Entering:'||l_proc, 5);
775   end if;
776   --
777   -- We must lock the row which we need to update.
778   --
779   pqh_cpd_shd.lck
780     (p_rec.corps_definition_id
781     ,p_rec.object_version_number
782     );
783   --
784   -- 1. During an update system defaults are used to determine if
785   --    arguments have been defaulted or not. We must therefore
786   --    derive the full record structure values to be updated.
787   --
788   -- 2. Call the supporting update validate operations.
789   --
790   convert_defs(p_rec);
791   pqh_cpd_bus.update_validate
792      (p_effective_date
793      ,p_rec
794      );
795   --
796   -- Call to raise any errors on multi-message list
797   hr_multi_message.end_validation_set;
798   --
799   -- Call the supporting pre-update operation
800   --
801   pqh_cpd_upd.pre_update(p_rec);
802   --
803   -- Update the row.
804   --
805   pqh_cpd_upd.update_dml(p_rec);
806   --
807   -- Call the supporting post-update operation
808   --
809   pqh_cpd_upd.post_update
810      (p_effective_date
811      ,p_rec
812      );
813   --
814   -- Call to raise any errors on multi-message list
815   hr_multi_message.end_validation_set;
816 End upd;
817 --
818 -- ----------------------------------------------------------------------------
819 -- |---------------------------------< upd >----------------------------------|
820 -- ----------------------------------------------------------------------------
821 Procedure upd
822   (p_effective_date               in     date
823   ,p_corps_definition_id          in     number
824   ,p_object_version_number        in out nocopy number
825   ,p_business_group_id            in     number    default hr_api.g_number
826   ,p_name                         in     varchar2  default hr_api.g_varchar2
827   ,p_status_cd                    in     varchar2  default hr_api.g_varchar2
828   ,p_category_cd                  in     varchar2  default hr_api.g_varchar2
829   ,p_retirement_age               in     number    default hr_api.g_number
830   ,p_recruitment_end_date         in     date      default hr_api.g_date
831   ,p_corps_type_cd                in     varchar2  default hr_api.g_varchar2
832   ,p_starting_grade_step_id       in     number    default hr_api.g_number
833   ,p_task_desc                    in     varchar2  default hr_api.g_varchar2
834   ,p_secondment_threshold         in     number    default hr_api.g_number
835   ,p_normal_hours                 in     number    default hr_api.g_number
836   ,p_normal_hours_frequency       in     varchar2  default hr_api.g_varchar2
837   ,p_minimum_hours                in     number    default hr_api.g_number
838   ,p_minimum_hours_frequency      in     varchar2  default hr_api.g_varchar2
839   ,p_attribute1                   in     varchar2  default hr_api.g_varchar2
840   ,p_attribute2                   in     varchar2  default hr_api.g_varchar2
841   ,p_attribute3                   in     varchar2  default hr_api.g_varchar2
842   ,p_attribute4                   in     varchar2  default hr_api.g_varchar2
843   ,p_attribute5                   in     varchar2  default hr_api.g_varchar2
844   ,p_attribute6                   in     varchar2  default hr_api.g_varchar2
845   ,p_attribute7                   in     varchar2  default hr_api.g_varchar2
846   ,p_attribute8                   in     varchar2  default hr_api.g_varchar2
847   ,p_attribute9                   in     varchar2  default hr_api.g_varchar2
848   ,p_attribute10                  in     varchar2  default hr_api.g_varchar2
849   ,p_attribute11                  in     varchar2  default hr_api.g_varchar2
850   ,p_attribute12                  in     varchar2  default hr_api.g_varchar2
851   ,p_attribute13                  in     varchar2  default hr_api.g_varchar2
852   ,p_attribute14                  in     varchar2  default hr_api.g_varchar2
853   ,p_attribute15                  in     varchar2  default hr_api.g_varchar2
854   ,p_attribute16                  in     varchar2  default hr_api.g_varchar2
855   ,p_attribute17                  in     varchar2  default hr_api.g_varchar2
856   ,p_attribute18                  in     varchar2  default hr_api.g_varchar2
857   ,p_attribute19                  in     varchar2  default hr_api.g_varchar2
858   ,p_attribute20                  in     varchar2  default hr_api.g_varchar2
859   ,p_attribute21                  in     varchar2  default hr_api.g_varchar2
860   ,p_attribute22                  in     varchar2  default hr_api.g_varchar2
861   ,p_attribute23                  in     varchar2  default hr_api.g_varchar2
862   ,p_attribute24                  in     varchar2  default hr_api.g_varchar2
863   ,p_attribute25                  in     varchar2  default hr_api.g_varchar2
864   ,p_attribute26                  in     varchar2  default hr_api.g_varchar2
865   ,p_attribute27                  in     varchar2  default hr_api.g_varchar2
866   ,p_attribute28                  in     varchar2  default hr_api.g_varchar2
867   ,p_attribute29                  in     varchar2  default hr_api.g_varchar2
868   ,p_attribute30                  in     varchar2  default hr_api.g_varchar2
869   ,p_attribute_category           in     varchar2  default hr_api.g_varchar2
870   ,p_type_of_ps                   in     varchar2  default hr_api.g_varchar2
871   ,p_date_from                    in     date      default hr_api.g_date
872   ,p_date_to                      in     date      default hr_api.g_date
873   ,p_primary_prof_field_id        in     number    default hr_api.g_number
874   ,p_starting_grade_id            in     number    default hr_api.g_number
875   ,p_ben_pgm_id                   in     number    default hr_api.g_number
876   ,p_probation_period             in     number    default hr_api.g_number
877   ,p_probation_units              in     varchar2  default hr_api.g_varchar2
878   ) is
879 --
880   l_rec   pqh_cpd_shd.g_rec_type;
881   l_proc  varchar2(72);
882 --
883 Begin
884   if g_debug then
885      l_proc := g_package||'upd';
886       hr_utility.set_location('Entering:'||l_proc, 5);
887   end if;
888 
889   --
890   -- Call conversion function to turn arguments into the
891   -- l_rec structure.
892   --
893   l_rec :=
894   pqh_cpd_shd.convert_args
895   (p_corps_definition_id
896   ,p_business_group_id
897   ,p_name
898   ,p_status_cd
899   ,p_retirement_age
900   ,p_category_cd
901   ,p_recruitment_end_date
902   ,p_corps_type_cd
903   ,p_starting_grade_step_id
904   ,p_task_desc
905   ,p_secondment_threshold
906   ,p_normal_hours
907   ,p_normal_hours_frequency
908   ,p_minimum_hours
909   ,p_minimum_hours_frequency
910   ,p_attribute1
911   ,p_attribute2
912   ,p_attribute3
913   ,p_attribute4
914   ,p_attribute5
915   ,p_attribute6
916   ,p_attribute7
917   ,p_attribute8
918   ,p_attribute9
919   ,p_attribute10
920   ,p_attribute11
921   ,p_attribute12
922   ,p_attribute13
923   ,p_attribute14
924   ,p_attribute15
925   ,p_attribute16
926   ,p_attribute17
927   ,p_attribute18
928   ,p_attribute19
929   ,p_attribute20
930   ,p_attribute21
931   ,p_attribute22
932   ,p_attribute23
933   ,p_attribute24
934   ,p_attribute25
935   ,p_attribute26
936   ,p_attribute27
937   ,p_attribute28
938   ,p_attribute29
939   ,p_attribute30
940   ,p_attribute_category
941   ,p_object_version_number
942   ,p_type_of_ps
943   ,p_date_from
944   ,p_date_to
945   ,p_primary_prof_field_id
946   ,p_starting_grade_id
947   ,p_ben_pgm_id
948   ,p_probation_period
949   ,p_probation_units
950   );
951   --
952   -- Having converted the arguments into the
953   -- plsql record structure we call the corresponding record
954   -- business process.
955   --
956   pqh_cpd_upd.upd
957      (p_effective_date
958      ,l_rec
959      );
960   p_object_version_number := l_rec.object_version_number;
961   --
962   if g_debug then
963      hr_utility.set_location(' Leaving:'||l_proc, 10);
964   end if;
965 End upd;
966 --
967 end pqh_cpd_upd;