DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_ECA_UPD

Source


1 Package Body per_eca_upd as
2 /* $Header: peecarhi.pkb 115.6 2002/12/05 10:25:53 pkakar noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  per_eca_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
55   (p_rec in out nocopy per_eca_shd.g_rec_type
56   ) is
57 --
58   l_proc  varchar2(72) := g_package||'update_dml';
59   l_last_update_date    per_election_candidates.last_update_date%TYPE;
60   l_last_updated_by     per_election_candidates.last_updated_by%TYPE;
61   l_last_update_login   per_election_candidates.last_update_login%TYPE;
62 --
63 Begin
64   hr_utility.set_location('Entering:'||l_proc, 5);
65   --
66   -- Increment the object version
67   p_rec.object_version_number := p_rec.object_version_number + 1;
68   --
69   --
70   -- Set the who columns
71   --
72   l_last_update_date   := sysdate;
73   l_last_updated_by    := fnd_global.user_id;
74   l_last_update_login  := fnd_global.login_id;
75   --
76   -- Update the per_election_candidates Row
77   --
78   update per_election_candidates
79     set
80      election_candidate_id           = p_rec.election_candidate_id
81     ,business_group_id               = p_rec.business_group_id
82     ,election_id                     = p_rec.election_id
83     ,person_id                       = p_rec.person_id
84     ,rank                            = p_rec.rank
85     ,role_id                         = p_rec.role_id
86     ,attribute_category              = p_rec.attribute_category
87     ,attribute1                      = p_rec.attribute1
88     ,attribute2                      = p_rec.attribute2
89     ,attribute3                      = p_rec.attribute3
90     ,attribute4                      = p_rec.attribute4
91     ,attribute5                      = p_rec.attribute5
92     ,attribute6                      = p_rec.attribute6
93     ,attribute7                      = p_rec.attribute7
94     ,attribute8                      = p_rec.attribute8
95     ,attribute9                      = p_rec.attribute9
96     ,attribute10                     = p_rec.attribute10
97     ,attribute11                     = p_rec.attribute11
98     ,attribute12                     = p_rec.attribute12
99     ,attribute13                     = p_rec.attribute13
100     ,attribute14                     = p_rec.attribute14
101     ,attribute15                     = p_rec.attribute15
102     ,attribute16                     = p_rec.attribute16
103     ,attribute17                     = p_rec.attribute17
104     ,attribute18                     = p_rec.attribute18
105     ,attribute19                     = p_rec.attribute19
106     ,attribute20                     = p_rec.attribute20
107     ,attribute21                     = p_rec.attribute21
108     ,attribute22                     = p_rec.attribute22
109     ,attribute23                     = p_rec.attribute23
110     ,attribute24                     = p_rec.attribute24
111     ,attribute25                     = p_rec.attribute25
112     ,attribute26                     = p_rec.attribute26
113     ,attribute27                     = p_rec.attribute27
114     ,attribute28                     = p_rec.attribute28
115     ,attribute29                     = p_rec.attribute29
116     ,attribute30                     = p_rec.attribute30
117     ,candidate_info_category  = p_rec.candidate_info_category
118     ,candidate_information1          = p_rec.candidate_information1
119     ,candidate_information2          = p_rec.candidate_information2
120     ,candidate_information3          = p_rec.candidate_information3
121     ,candidate_information4          = p_rec.candidate_information4
122     ,candidate_information5          = p_rec.candidate_information5
123     ,candidate_information6          = p_rec.candidate_information6
124     ,candidate_information7          = p_rec.candidate_information7
125     ,candidate_information8          = p_rec.candidate_information8
126     ,candidate_information9          = p_rec.candidate_information9
127     ,candidate_information10         = p_rec.candidate_information10
128     ,candidate_information11         = p_rec.candidate_information11
129     ,candidate_information12         = p_rec.candidate_information12
130     ,candidate_information13         = p_rec.candidate_information13
131     ,candidate_information14         = p_rec.candidate_information14
132     ,candidate_information15         = p_rec.candidate_information15
133     ,candidate_information16         = p_rec.candidate_information16
134     ,candidate_information17         = p_rec.candidate_information17
135     ,candidate_information18         = p_rec.candidate_information18
136     ,candidate_information19         = p_rec.candidate_information19
137     ,candidate_information20         = p_rec.candidate_information20
138     ,candidate_information21         = p_rec.candidate_information21
139     ,candidate_information22         = p_rec.candidate_information22
140     ,candidate_information23         = p_rec.candidate_information23
141     ,candidate_information24         = p_rec.candidate_information24
142     ,candidate_information25         = p_rec.candidate_information25
143     ,candidate_information26         = p_rec.candidate_information26
144     ,candidate_information27         = p_rec.candidate_information27
145     ,candidate_information28         = p_rec.candidate_information28
146     ,candidate_information29         = p_rec.candidate_information29
147     ,candidate_information30         = p_rec.candidate_information30
148     ,object_version_number           = p_rec.object_version_number
149     ,last_update_date                = l_last_update_date
150     ,last_updated_by                 = l_last_updated_by
151     ,last_update_login               = l_last_update_login
152     where election_candidate_id = p_rec.election_candidate_id;
153   --
154   --
155   --
156   hr_utility.set_location(' Leaving:'||l_proc, 10);
157 --
158 Exception
159   When hr_api.check_integrity_violated Then
160     -- A check constraint has been violated
161     --
162     per_eca_shd.constraint_error
163       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
164   When hr_api.parent_integrity_violated Then
165     -- Parent integrity has been violated
166     --
167     per_eca_shd.constraint_error
168       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
169   When hr_api.unique_integrity_violated Then
170     -- Unique integrity has been violated
171     --
172     per_eca_shd.constraint_error
173       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
174   When Others Then
175     --
176     Raise;
177 End update_dml;
178 --
179 -- ----------------------------------------------------------------------------
180 -- |------------------------------< pre_update >------------------------------|
181 -- ----------------------------------------------------------------------------
182 -- {Start Of Comments}
183 --
184 -- Description:
185 --   This private procedure contains any processing which is required before
186 --   the update dml.
187 --
188 -- Prerequisites:
189 --   This is an internal procedure which is called from the upd procedure.
190 --
191 -- In Parameters:
192 --   A Pl/Sql record structure.
193 --
194 -- Post Success:
195 --   Processing continues.
196 --
197 -- Post Failure:
198 --   If an error has occurred, an error message and exception wil be raised
199 --   but not handled.
200 --
201 -- Developer Implementation Notes:
202 --   Any pre-processing required before the update dml is issued should be
203 --   coded within this procedure. It is important to note that any 3rd party
204 --   maintenance should be reviewed before placing in this procedure.
205 --
206 -- Access Status:
207 --   Internal Row Handler Use Only.
208 --
209 -- {End Of Comments}
210 -- ----------------------------------------------------------------------------
211 Procedure pre_update
212   (p_rec in per_eca_shd.g_rec_type
213   ) is
214 --
215   l_proc  varchar2(72) := g_package||'pre_update';
216 --
217 Begin
218   hr_utility.set_location('Entering:'||l_proc, 5);
219   --
220   hr_utility.set_location(' Leaving:'||l_proc, 10);
221 End pre_update;
222 --
223 -- ----------------------------------------------------------------------------
224 -- |-----------------------------< post_update >------------------------------|
225 -- ----------------------------------------------------------------------------
226 -- {Start Of Comments}
227 --
228 -- Description:
229 --   This private procedure contains any processing which is required after the
230 --   update dml.
231 --
232 -- Prerequisites:
233 --   This is an internal procedure which is called from the upd procedure.
234 --
235 -- In Parameters:
236 --   A Pl/Sql record structure.
237 --
238 -- Post Success:
239 --   Processing continues.
240 --
241 -- Post Failure:
242 --   If an error has occurred, an error message and exception will be raised
243 --   but not handled.
244 --
245 -- Developer Implementation Notes:
246 --   Any post-processing required after the update dml is issued should be
247 --   coded within this procedure. It is important to note that any 3rd party
248 --   maintenance should be reviewed before placing in this procedure.
249 --
250 -- Access Status:
251 --   Internal Row Handler Use Only.
252 --
253 -- {End Of Comments}
254 -- ----------------------------------------------------------------------------
255 Procedure post_update
256   (p_rec                          in per_eca_shd.g_rec_type
257   ) is
258 --
259   l_proc  varchar2(72) := g_package||'post_update';
260 --
261 Begin
262   hr_utility.set_location('Entering:'||l_proc, 5);
263   begin
264     --
265     per_eca_rku.after_update
266       (p_election_candidate_id
267       => p_rec.election_candidate_id
268       ,p_business_group_id
269       => p_rec.business_group_id
270       ,p_election_id
271       => p_rec.election_id
272       ,p_person_id
273       => p_rec.person_id
274       ,p_rank
275       => p_rec.rank
276       ,p_role_id
277       => p_rec.role_id
278       ,p_attribute_category
279       => p_rec.attribute_category
280       ,p_attribute1
281       => p_rec.attribute1
282       ,p_attribute2
283       => p_rec.attribute2
284       ,p_attribute3
285       => p_rec.attribute3
286       ,p_attribute4
287       => p_rec.attribute4
288       ,p_attribute5
289       => p_rec.attribute5
290       ,p_attribute6
291       => p_rec.attribute6
292       ,p_attribute7
293       => p_rec.attribute7
294       ,p_attribute8
295       => p_rec.attribute8
296       ,p_attribute9
297       => p_rec.attribute9
298       ,p_attribute10
299       => p_rec.attribute10
300       ,p_attribute11
301       => p_rec.attribute11
302       ,p_attribute12
303       => p_rec.attribute12
304       ,p_attribute13
305       => p_rec.attribute13
306       ,p_attribute14
307       => p_rec.attribute14
308       ,p_attribute15
309       => p_rec.attribute15
310       ,p_attribute16
311       => p_rec.attribute16
312       ,p_attribute17
313       => p_rec.attribute17
314       ,p_attribute18
315       => p_rec.attribute18
316       ,p_attribute19
317       => p_rec.attribute19
318       ,p_attribute20
319       => p_rec.attribute20
320       ,p_attribute21
321       => p_rec.attribute21
322       ,p_attribute22
323       => p_rec.attribute22
324       ,p_attribute23
325       => p_rec.attribute23
326       ,p_attribute24
327       => p_rec.attribute24
328       ,p_attribute25
329       => p_rec.attribute25
330       ,p_attribute26
331       => p_rec.attribute26
332       ,p_attribute27
333       => p_rec.attribute27
334       ,p_attribute28
335       => p_rec.attribute28
336       ,p_attribute29
337       => p_rec.attribute29
338       ,p_attribute30
339       => p_rec.attribute30
340       ,p_candidate_info_category
341       => p_rec.candidate_info_category
342       ,p_candidate_information1
343       => p_rec.candidate_information1
344       ,p_candidate_information2
345       => p_rec.candidate_information2
346       ,p_candidate_information3
347       => p_rec.candidate_information3
348       ,p_candidate_information4
349       => p_rec.candidate_information4
350       ,p_candidate_information5
351       => p_rec.candidate_information5
352       ,p_candidate_information6
353       => p_rec.candidate_information6
354       ,p_candidate_information7
355       => p_rec.candidate_information7
356       ,p_candidate_information8
357       => p_rec.candidate_information8
358       ,p_candidate_information9
359       => p_rec.candidate_information9
360       ,p_candidate_information10
361       => p_rec.candidate_information10
362       ,p_candidate_information11
363       => p_rec.candidate_information11
364       ,p_candidate_information12
365       => p_rec.candidate_information12
366       ,p_candidate_information13
367       => p_rec.candidate_information13
368       ,p_candidate_information14
369       => p_rec.candidate_information14
370       ,p_candidate_information15
371       => p_rec.candidate_information15
372       ,p_candidate_information16
373       => p_rec.candidate_information16
374       ,p_candidate_information17
375       => p_rec.candidate_information17
376       ,p_candidate_information18
377       => p_rec.candidate_information18
378       ,p_candidate_information19
379       => p_rec.candidate_information19
380       ,p_candidate_information20
381       => p_rec.candidate_information20
382       ,p_candidate_information21
383       => p_rec.candidate_information21
384       ,p_candidate_information22
385       => p_rec.candidate_information22
386       ,p_candidate_information23
387       => p_rec.candidate_information23
388       ,p_candidate_information24
389       => p_rec.candidate_information24
390       ,p_candidate_information25
391       => p_rec.candidate_information25
392       ,p_candidate_information26
393       => p_rec.candidate_information26
394       ,p_candidate_information27
395       => p_rec.candidate_information27
396       ,p_candidate_information28
397       => p_rec.candidate_information28
398       ,p_candidate_information29
399       => p_rec.candidate_information29
400       ,p_candidate_information30
401       => p_rec.candidate_information30
402       ,p_object_version_number
403       => p_rec.object_version_number
404       ,p_business_group_id_o
405       => per_eca_shd.g_old_rec.business_group_id
406       ,p_election_id_o
407       => per_eca_shd.g_old_rec.election_id
408       ,p_person_id_o
409       => per_eca_shd.g_old_rec.person_id
410       ,p_rank_o
411       => per_eca_shd.g_old_rec.rank
412       ,p_role_id_o
413       => per_eca_shd.g_old_rec.role_id
414       ,p_attribute_category_o
415       => per_eca_shd.g_old_rec.attribute_category
416       ,p_attribute1_o
417       => per_eca_shd.g_old_rec.attribute1
418       ,p_attribute2_o
419       => per_eca_shd.g_old_rec.attribute2
420       ,p_attribute3_o
421       => per_eca_shd.g_old_rec.attribute3
422       ,p_attribute4_o
423       => per_eca_shd.g_old_rec.attribute4
424       ,p_attribute5_o
425       => per_eca_shd.g_old_rec.attribute5
426       ,p_attribute6_o
427       => per_eca_shd.g_old_rec.attribute6
428       ,p_attribute7_o
429       => per_eca_shd.g_old_rec.attribute7
430       ,p_attribute8_o
431       => per_eca_shd.g_old_rec.attribute8
432       ,p_attribute9_o
433       => per_eca_shd.g_old_rec.attribute9
434       ,p_attribute10_o
435       => per_eca_shd.g_old_rec.attribute10
436       ,p_attribute11_o
437       => per_eca_shd.g_old_rec.attribute11
438       ,p_attribute12_o
439       => per_eca_shd.g_old_rec.attribute12
440       ,p_attribute13_o
441       => per_eca_shd.g_old_rec.attribute13
442       ,p_attribute14_o
443       => per_eca_shd.g_old_rec.attribute14
444       ,p_attribute15_o
445       => per_eca_shd.g_old_rec.attribute15
446       ,p_attribute16_o
447       => per_eca_shd.g_old_rec.attribute16
448       ,p_attribute17_o
449       => per_eca_shd.g_old_rec.attribute17
450       ,p_attribute18_o
451       => per_eca_shd.g_old_rec.attribute18
452       ,p_attribute19_o
453       => per_eca_shd.g_old_rec.attribute19
454       ,p_attribute20_o
455       => per_eca_shd.g_old_rec.attribute20
456       ,p_attribute21_o
457       => per_eca_shd.g_old_rec.attribute21
458       ,p_attribute22_o
459       => per_eca_shd.g_old_rec.attribute22
460       ,p_attribute23_o
461       => per_eca_shd.g_old_rec.attribute23
462       ,p_attribute24_o
463       => per_eca_shd.g_old_rec.attribute24
464       ,p_attribute25_o
465       => per_eca_shd.g_old_rec.attribute25
466       ,p_attribute26_o
467       => per_eca_shd.g_old_rec.attribute26
468       ,p_attribute27_o
469       => per_eca_shd.g_old_rec.attribute27
470       ,p_attribute28_o
471       => per_eca_shd.g_old_rec.attribute28
472       ,p_attribute29_o
473       => per_eca_shd.g_old_rec.attribute29
474       ,p_attribute30_o
475       => per_eca_shd.g_old_rec.attribute30
476       ,p_candidate_information_cate_o
477       => per_eca_shd.g_old_rec.candidate_info_category
478       ,p_candidate_information1_o
479       => per_eca_shd.g_old_rec.candidate_information1
480       ,p_candidate_information2_o
481       => per_eca_shd.g_old_rec.candidate_information2
482       ,p_candidate_information3_o
483       => per_eca_shd.g_old_rec.candidate_information3
484       ,p_candidate_information4_o
485       => per_eca_shd.g_old_rec.candidate_information4
486       ,p_candidate_information5_o
487       => per_eca_shd.g_old_rec.candidate_information5
488       ,p_candidate_information6_o
489       => per_eca_shd.g_old_rec.candidate_information6
490       ,p_candidate_information7_o
491       => per_eca_shd.g_old_rec.candidate_information7
492       ,p_candidate_information8_o
493       => per_eca_shd.g_old_rec.candidate_information8
494       ,p_candidate_information9_o
495       => per_eca_shd.g_old_rec.candidate_information9
496       ,p_candidate_information10_o
497       => per_eca_shd.g_old_rec.candidate_information10
498       ,p_candidate_information11_o
499       => per_eca_shd.g_old_rec.candidate_information11
500       ,p_candidate_information12_o
501       => per_eca_shd.g_old_rec.candidate_information12
502       ,p_candidate_information13_o
503       => per_eca_shd.g_old_rec.candidate_information13
504       ,p_candidate_information14_o
505       => per_eca_shd.g_old_rec.candidate_information14
506       ,p_candidate_information15_o
507       => per_eca_shd.g_old_rec.candidate_information15
508       ,p_candidate_information16_o
509       => per_eca_shd.g_old_rec.candidate_information16
510       ,p_candidate_information17_o
511       => per_eca_shd.g_old_rec.candidate_information17
512       ,p_candidate_information18_o
513       => per_eca_shd.g_old_rec.candidate_information18
514       ,p_candidate_information19_o
515       => per_eca_shd.g_old_rec.candidate_information19
516       ,p_candidate_information20_o
517       => per_eca_shd.g_old_rec.candidate_information20
518       ,p_candidate_information21_o
519       => per_eca_shd.g_old_rec.candidate_information21
520       ,p_candidate_information22_o
521       => per_eca_shd.g_old_rec.candidate_information22
522       ,p_candidate_information23_o
523       => per_eca_shd.g_old_rec.candidate_information23
524       ,p_candidate_information24_o
525       => per_eca_shd.g_old_rec.candidate_information24
526       ,p_candidate_information25_o
527       => per_eca_shd.g_old_rec.candidate_information25
528       ,p_candidate_information26_o
529       => per_eca_shd.g_old_rec.candidate_information26
530       ,p_candidate_information27_o
531       => per_eca_shd.g_old_rec.candidate_information27
532       ,p_candidate_information28_o
533       => per_eca_shd.g_old_rec.candidate_information28
534       ,p_candidate_information29_o
535       => per_eca_shd.g_old_rec.candidate_information29
536       ,p_candidate_information30_o
537       => per_eca_shd.g_old_rec.candidate_information30
538       ,p_object_version_number_o
539       => per_eca_shd.g_old_rec.object_version_number
540       );
541     --
542   exception
543     --
544     when hr_api.cannot_find_prog_unit then
545       --
546       hr_api.cannot_find_prog_unit_error
547         (p_module_name => 'PER_ELECTION_CANDIDATES'
548         ,p_hook_type   => 'AU');
549       --
550   end;
551   --
552   hr_utility.set_location(' Leaving:'||l_proc, 10);
553 End post_update;
554 --
555 -- ----------------------------------------------------------------------------
556 -- |-----------------------------< convert_defs >-----------------------------|
557 -- ----------------------------------------------------------------------------
558 -- {Start Of Comments}
559 --
560 -- Description:
561 --   The Convert_Defs procedure has one very important function:
562 --   It must return the record structure for the row with all system defaulted
563 --   values converted into its corresponding parameter value for update. When
564 --   we attempt to update a row through the Upd process , certain
565 --   parameters can be defaulted which enables flexibility in the calling of
566 --   the upd process (e.g. only attributes which need to be updated need to be
567 --   specified). For the upd process to determine which attributes
568 --   have NOT been specified we need to check if the parameter has a reserved
569 --   system default value. Therefore, for all parameters which have a
570 --   corresponding reserved system default mechanism specified we need to
571 --   check if a system default is being used. If a system default is being
572 --   used then we convert the defaulted value into its corresponding attribute
573 --   value held in the g_old_rec data structure.
574 --
575 -- Prerequisites:
576 --   This private function can only be called from the upd process.
577 --
578 -- In Parameters:
579 --   A Pl/Sql record structure.
580 --
581 -- Post Success:
582 --   The record structure will be returned with all system defaulted parameter
583 --   values converted into its current row attribute value.
584 --
585 -- Post Failure:
586 --   No direct error handling is required within this function. Any possible
587 --   errors within this procedure will be a PL/SQL value error due to
588 --   conversion of datatypes or data lengths.
589 --
590 -- Developer Implementation Notes:
591 --   None.
592 --
593 -- Access Status:
594 --   Internal Row Handler Use Only.
595 --
596 -- {End Of Comments}
597 -- ----------------------------------------------------------------------------
598 Procedure convert_defs
599   (p_rec in out nocopy per_eca_shd.g_rec_type
600   ) is
601 --
602 Begin
603   --
604   -- We must now examine each argument value in the
605   -- p_rec plsql record structure
606   -- to see if a system default is being used. If a system default
607   -- is being used then we must set to the 'current' argument value.
608   --
609   If (p_rec.business_group_id = hr_api.g_number) then
610     p_rec.business_group_id :=
611     per_eca_shd.g_old_rec.business_group_id;
612   End If;
613   If (p_rec.election_id = hr_api.g_number) then
614     p_rec.election_id :=
615     per_eca_shd.g_old_rec.election_id;
616   End If;
617   If (p_rec.person_id = hr_api.g_number) then
618     p_rec.person_id :=
619     per_eca_shd.g_old_rec.person_id;
620   End If;
621   If (p_rec.rank = hr_api.g_number) then
622     p_rec.rank :=
623     per_eca_shd.g_old_rec.rank;
624   End If;
625   If (p_rec.role_id = hr_api.g_number) then
626     p_rec.role_id :=
627     per_eca_shd.g_old_rec.role_id;
628   End If;
629   If (p_rec.attribute_category = hr_api.g_varchar2) then
630     p_rec.attribute_category :=
631     per_eca_shd.g_old_rec.attribute_category;
632   End If;
633   If (p_rec.attribute1 = hr_api.g_varchar2) then
634     p_rec.attribute1 :=
635     per_eca_shd.g_old_rec.attribute1;
636   End If;
637   If (p_rec.attribute2 = hr_api.g_varchar2) then
638     p_rec.attribute2 :=
639     per_eca_shd.g_old_rec.attribute2;
640   End If;
641   If (p_rec.attribute3 = hr_api.g_varchar2) then
642     p_rec.attribute3 :=
643     per_eca_shd.g_old_rec.attribute3;
644   End If;
645   If (p_rec.attribute4 = hr_api.g_varchar2) then
646     p_rec.attribute4 :=
647     per_eca_shd.g_old_rec.attribute4;
648   End If;
649   If (p_rec.attribute5 = hr_api.g_varchar2) then
650     p_rec.attribute5 :=
651     per_eca_shd.g_old_rec.attribute5;
652   End If;
653   If (p_rec.attribute6 = hr_api.g_varchar2) then
654     p_rec.attribute6 :=
655     per_eca_shd.g_old_rec.attribute6;
656   End If;
657   If (p_rec.attribute7 = hr_api.g_varchar2) then
658     p_rec.attribute7 :=
659     per_eca_shd.g_old_rec.attribute7;
660   End If;
661   If (p_rec.attribute8 = hr_api.g_varchar2) then
662     p_rec.attribute8 :=
663     per_eca_shd.g_old_rec.attribute8;
664   End If;
665   If (p_rec.attribute9 = hr_api.g_varchar2) then
666     p_rec.attribute9 :=
667     per_eca_shd.g_old_rec.attribute9;
668   End If;
669   If (p_rec.attribute10 = hr_api.g_varchar2) then
670     p_rec.attribute10 :=
671     per_eca_shd.g_old_rec.attribute10;
672   End If;
673   If (p_rec.attribute11 = hr_api.g_varchar2) then
674     p_rec.attribute11 :=
675     per_eca_shd.g_old_rec.attribute11;
676   End If;
677   If (p_rec.attribute12 = hr_api.g_varchar2) then
678     p_rec.attribute12 :=
679     per_eca_shd.g_old_rec.attribute12;
680   End If;
681   If (p_rec.attribute13 = hr_api.g_varchar2) then
682     p_rec.attribute13 :=
683     per_eca_shd.g_old_rec.attribute13;
684   End If;
685   If (p_rec.attribute14 = hr_api.g_varchar2) then
686     p_rec.attribute14 :=
687     per_eca_shd.g_old_rec.attribute14;
688   End If;
689   If (p_rec.attribute15 = hr_api.g_varchar2) then
690     p_rec.attribute15 :=
691     per_eca_shd.g_old_rec.attribute15;
692   End If;
693   If (p_rec.attribute16 = hr_api.g_varchar2) then
694     p_rec.attribute16 :=
695     per_eca_shd.g_old_rec.attribute16;
696   End If;
697   If (p_rec.attribute17 = hr_api.g_varchar2) then
698     p_rec.attribute17 :=
699     per_eca_shd.g_old_rec.attribute17;
700   End If;
701   If (p_rec.attribute18 = hr_api.g_varchar2) then
702     p_rec.attribute18 :=
703     per_eca_shd.g_old_rec.attribute18;
704   End If;
705   If (p_rec.attribute19 = hr_api.g_varchar2) then
706     p_rec.attribute19 :=
707     per_eca_shd.g_old_rec.attribute19;
708   End If;
709   If (p_rec.attribute20 = hr_api.g_varchar2) then
710     p_rec.attribute20 :=
711     per_eca_shd.g_old_rec.attribute20;
712   End If;
713   If (p_rec.attribute21 = hr_api.g_varchar2) then
714     p_rec.attribute21 :=
715     per_eca_shd.g_old_rec.attribute21;
716   End If;
717   If (p_rec.attribute22 = hr_api.g_varchar2) then
718     p_rec.attribute22 :=
719     per_eca_shd.g_old_rec.attribute22;
720   End If;
721   If (p_rec.attribute23 = hr_api.g_varchar2) then
722     p_rec.attribute23 :=
723     per_eca_shd.g_old_rec.attribute23;
724   End If;
725   If (p_rec.attribute24 = hr_api.g_varchar2) then
726     p_rec.attribute24 :=
727     per_eca_shd.g_old_rec.attribute24;
728   End If;
729   If (p_rec.attribute25 = hr_api.g_varchar2) then
730     p_rec.attribute25 :=
731     per_eca_shd.g_old_rec.attribute25;
732   End If;
733   If (p_rec.attribute26 = hr_api.g_varchar2) then
734     p_rec.attribute26 :=
735     per_eca_shd.g_old_rec.attribute26;
736   End If;
737   If (p_rec.attribute27 = hr_api.g_varchar2) then
738     p_rec.attribute27 :=
739     per_eca_shd.g_old_rec.attribute27;
740   End If;
741   If (p_rec.attribute28 = hr_api.g_varchar2) then
742     p_rec.attribute28 :=
743     per_eca_shd.g_old_rec.attribute28;
744   End If;
745   If (p_rec.attribute29 = hr_api.g_varchar2) then
746     p_rec.attribute29 :=
747     per_eca_shd.g_old_rec.attribute29;
748   End If;
749   If (p_rec.attribute30 = hr_api.g_varchar2) then
750     p_rec.attribute30 :=
751     per_eca_shd.g_old_rec.attribute30;
752   End If;
753   If (p_rec.candidate_info_category = hr_api.g_varchar2) then
754     p_rec.candidate_info_category :=
755     per_eca_shd.g_old_rec.candidate_info_category;
756   End If;
757   If (p_rec.candidate_information1 = hr_api.g_varchar2) then
758     p_rec.candidate_information1 :=
759     per_eca_shd.g_old_rec.candidate_information1;
760   End If;
761   If (p_rec.candidate_information2 = hr_api.g_varchar2) then
762     p_rec.candidate_information2 :=
763     per_eca_shd.g_old_rec.candidate_information2;
764   End If;
765   If (p_rec.candidate_information3 = hr_api.g_varchar2) then
766     p_rec.candidate_information3 :=
767     per_eca_shd.g_old_rec.candidate_information3;
768   End If;
769   If (p_rec.candidate_information4 = hr_api.g_varchar2) then
770     p_rec.candidate_information4 :=
771     per_eca_shd.g_old_rec.candidate_information4;
772   End If;
773   If (p_rec.candidate_information5 = hr_api.g_varchar2) then
774     p_rec.candidate_information5 :=
775     per_eca_shd.g_old_rec.candidate_information5;
776   End If;
777   If (p_rec.candidate_information6 = hr_api.g_varchar2) then
778     p_rec.candidate_information6 :=
779     per_eca_shd.g_old_rec.candidate_information6;
780   End If;
781   If (p_rec.candidate_information7 = hr_api.g_varchar2) then
782     p_rec.candidate_information7 :=
783     per_eca_shd.g_old_rec.candidate_information7;
784   End If;
785   If (p_rec.candidate_information8 = hr_api.g_varchar2) then
786     p_rec.candidate_information8 :=
787     per_eca_shd.g_old_rec.candidate_information8;
788   End If;
789   If (p_rec.candidate_information9 = hr_api.g_varchar2) then
790     p_rec.candidate_information9 :=
791     per_eca_shd.g_old_rec.candidate_information9;
792   End If;
793   If (p_rec.candidate_information10 = hr_api.g_varchar2) then
794     p_rec.candidate_information10 :=
795     per_eca_shd.g_old_rec.candidate_information10;
796   End If;
797   If (p_rec.candidate_information11 = hr_api.g_varchar2) then
798     p_rec.candidate_information11 :=
799     per_eca_shd.g_old_rec.candidate_information11;
800   End If;
801   If (p_rec.candidate_information12 = hr_api.g_varchar2) then
802     p_rec.candidate_information12 :=
803     per_eca_shd.g_old_rec.candidate_information12;
804   End If;
805   If (p_rec.candidate_information13 = hr_api.g_varchar2) then
806     p_rec.candidate_information13 :=
807     per_eca_shd.g_old_rec.candidate_information13;
808   End If;
809   If (p_rec.candidate_information14 = hr_api.g_varchar2) then
810     p_rec.candidate_information14 :=
811     per_eca_shd.g_old_rec.candidate_information14;
812   End If;
813   If (p_rec.candidate_information15 = hr_api.g_varchar2) then
814     p_rec.candidate_information15 :=
815     per_eca_shd.g_old_rec.candidate_information15;
816   End If;
817   If (p_rec.candidate_information16 = hr_api.g_varchar2) then
818     p_rec.candidate_information16 :=
819     per_eca_shd.g_old_rec.candidate_information16;
820   End If;
821   If (p_rec.candidate_information17 = hr_api.g_varchar2) then
822     p_rec.candidate_information17 :=
823     per_eca_shd.g_old_rec.candidate_information17;
824   End If;
825   If (p_rec.candidate_information18 = hr_api.g_varchar2) then
826     p_rec.candidate_information18 :=
827     per_eca_shd.g_old_rec.candidate_information18;
828   End If;
829   If (p_rec.candidate_information19 = hr_api.g_varchar2) then
830     p_rec.candidate_information19 :=
831     per_eca_shd.g_old_rec.candidate_information19;
832   End If;
833   If (p_rec.candidate_information20 = hr_api.g_varchar2) then
834     p_rec.candidate_information20 :=
835     per_eca_shd.g_old_rec.candidate_information20;
836   End If;
837   If (p_rec.candidate_information21 = hr_api.g_varchar2) then
838     p_rec.candidate_information21 :=
839     per_eca_shd.g_old_rec.candidate_information21;
840   End If;
841   If (p_rec.candidate_information22 = hr_api.g_varchar2) then
842     p_rec.candidate_information22 :=
843     per_eca_shd.g_old_rec.candidate_information22;
844   End If;
845   If (p_rec.candidate_information23 = hr_api.g_varchar2) then
846     p_rec.candidate_information23 :=
847     per_eca_shd.g_old_rec.candidate_information23;
848   End If;
849   If (p_rec.candidate_information24 = hr_api.g_varchar2) then
850     p_rec.candidate_information24 :=
851     per_eca_shd.g_old_rec.candidate_information24;
852   End If;
853   If (p_rec.candidate_information25 = hr_api.g_varchar2) then
854     p_rec.candidate_information25 :=
855     per_eca_shd.g_old_rec.candidate_information25;
856   End If;
857   If (p_rec.candidate_information26 = hr_api.g_varchar2) then
858     p_rec.candidate_information26 :=
859     per_eca_shd.g_old_rec.candidate_information26;
860   End If;
861   If (p_rec.candidate_information27 = hr_api.g_varchar2) then
862     p_rec.candidate_information27 :=
863     per_eca_shd.g_old_rec.candidate_information27;
864   End If;
865   If (p_rec.candidate_information28 = hr_api.g_varchar2) then
866     p_rec.candidate_information28 :=
867     per_eca_shd.g_old_rec.candidate_information28;
868   End If;
869   If (p_rec.candidate_information29 = hr_api.g_varchar2) then
870     p_rec.candidate_information29 :=
871     per_eca_shd.g_old_rec.candidate_information29;
872   End If;
873   If (p_rec.candidate_information30 = hr_api.g_varchar2) then
874     p_rec.candidate_information30 :=
875     per_eca_shd.g_old_rec.candidate_information30;
876   End If;
877   --
878 End convert_defs;
879 --
880 -- ----------------------------------------------------------------------------
881 -- |---------------------------------< upd >----------------------------------|
882 -- ----------------------------------------------------------------------------
883 Procedure upd
884   (p_rec                          in out nocopy per_eca_shd.g_rec_type
885    ,p_validate           in     boolean default false
886 
887   ) is
888 --
889   l_proc  varchar2(72) := g_package||'upd';
890 --
891 Begin
892   hr_utility.set_location('Entering:'||l_proc, 5);
893   --
894   -- Determine if the business process is to be validated.
895   --
896   If p_validate then
897     --
898     -- Issue the savepoint.
899     --
900     SAVEPOINT upd_per_eca;
901   End If;
902 
903   --
904   -- We must lock the row which we need to update.
905   --
906   per_eca_shd.lck
907     (p_rec.election_candidate_id
908     ,p_rec.object_version_number
909     );
910   --
911   -- 1. During an update system defaults are used to determine if
912   --    arguments have been defaulted or not. We must therefore
913   --    derive the full record structure values to be updated.
914   --
915   -- 2. Call the supporting update validate operations.
916   --
917   convert_defs(p_rec);
918   per_eca_bus.update_validate
919      (p_rec
920      );
921   --
922   -- Call the supporting pre-update operation
923   --
924   per_eca_upd.pre_update(p_rec);
925   --
926   -- Update the row.
927   --
928   per_eca_upd.update_dml(p_rec);
929   --
930   -- Call the supporting post-update operation
931   --
932   per_eca_upd.post_update
933      (p_rec
934      );
935   --
936   -- If we are validating then raise the Validate_Enabled exception
937   --
938   If p_validate then
939     Raise HR_Api.Validate_Enabled;
940   End If;
941   --
942   hr_utility.set_location(' Leaving:'||l_proc, 10);
943 Exception
944   When HR_Api.Validate_Enabled Then
945     --
946     -- As the Validate_Enabled exception has been raised
947     -- we must rollback to the savepoint
948     --
949     ROLLBACK TO upd_per_eca;
950 
951 End upd;
952 --
953 -- ----------------------------------------------------------------------------
954 -- |---------------------------------< upd >----------------------------------|
955 -- ----------------------------------------------------------------------------
956 Procedure upd
957   (p_election_candidate_id        in     number
958   ,p_object_version_number        in out nocopy number
959   ,p_business_group_id            in     number    default hr_api.g_number
960   ,p_election_id                  in     number    default hr_api.g_number
961   ,p_person_id                    in     number    default hr_api.g_number
962   ,p_rank                         in     number    default hr_api.g_number
963   ,p_role_id                      in     number    default hr_api.g_number
964   ,p_attribute_category           in     varchar2  default hr_api.g_varchar2
965   ,p_attribute1                   in     varchar2  default hr_api.g_varchar2
966   ,p_attribute2                   in     varchar2  default hr_api.g_varchar2
967   ,p_attribute3                   in     varchar2  default hr_api.g_varchar2
968   ,p_attribute4                   in     varchar2  default hr_api.g_varchar2
969   ,p_attribute5                   in     varchar2  default hr_api.g_varchar2
970   ,p_attribute6                   in     varchar2  default hr_api.g_varchar2
971   ,p_attribute7                   in     varchar2  default hr_api.g_varchar2
972   ,p_attribute8                   in     varchar2  default hr_api.g_varchar2
973   ,p_attribute9                   in     varchar2  default hr_api.g_varchar2
974   ,p_attribute10                  in     varchar2  default hr_api.g_varchar2
975   ,p_attribute11                  in     varchar2  default hr_api.g_varchar2
976   ,p_attribute12                  in     varchar2  default hr_api.g_varchar2
977   ,p_attribute13                  in     varchar2  default hr_api.g_varchar2
978   ,p_attribute14                  in     varchar2  default hr_api.g_varchar2
979   ,p_attribute15                  in     varchar2  default hr_api.g_varchar2
980   ,p_attribute16                  in     varchar2  default hr_api.g_varchar2
981   ,p_attribute17                  in     varchar2  default hr_api.g_varchar2
982   ,p_attribute18                  in     varchar2  default hr_api.g_varchar2
983   ,p_attribute19                  in     varchar2  default hr_api.g_varchar2
984   ,p_attribute20                  in     varchar2  default hr_api.g_varchar2
985   ,p_attribute21                  in     varchar2  default hr_api.g_varchar2
986   ,p_attribute22                  in     varchar2  default hr_api.g_varchar2
987   ,p_attribute23                  in     varchar2  default hr_api.g_varchar2
988   ,p_attribute24                  in     varchar2  default hr_api.g_varchar2
989   ,p_attribute25                  in     varchar2  default hr_api.g_varchar2
990   ,p_attribute26                  in     varchar2  default hr_api.g_varchar2
991   ,p_attribute27                  in     varchar2  default hr_api.g_varchar2
992   ,p_attribute28                  in     varchar2  default hr_api.g_varchar2
993   ,p_attribute29                  in     varchar2  default hr_api.g_varchar2
994   ,p_attribute30                  in     varchar2  default hr_api.g_varchar2
995   ,p_candidate_info_category in     varchar2  default hr_api.g_varchar2
996   ,p_candidate_information1       in     varchar2  default hr_api.g_varchar2
997   ,p_candidate_information2       in     varchar2  default hr_api.g_varchar2
998   ,p_candidate_information3       in     varchar2  default hr_api.g_varchar2
999   ,p_candidate_information4       in     varchar2  default hr_api.g_varchar2
1000   ,p_candidate_information5       in     varchar2  default hr_api.g_varchar2
1001   ,p_candidate_information6       in     varchar2  default hr_api.g_varchar2
1002   ,p_candidate_information7       in     varchar2  default hr_api.g_varchar2
1003   ,p_candidate_information8       in     varchar2  default hr_api.g_varchar2
1004   ,p_candidate_information9       in     varchar2  default hr_api.g_varchar2
1005   ,p_candidate_information10      in     varchar2  default hr_api.g_varchar2
1006   ,p_candidate_information11      in     varchar2  default hr_api.g_varchar2
1007   ,p_candidate_information12      in     varchar2  default hr_api.g_varchar2
1008   ,p_candidate_information13      in     varchar2  default hr_api.g_varchar2
1009   ,p_candidate_information14      in     varchar2  default hr_api.g_varchar2
1010   ,p_candidate_information15      in     varchar2  default hr_api.g_varchar2
1011   ,p_candidate_information16      in     varchar2  default hr_api.g_varchar2
1012   ,p_candidate_information17      in     varchar2  default hr_api.g_varchar2
1013   ,p_candidate_information18      in     varchar2  default hr_api.g_varchar2
1014   ,p_candidate_information19      in     varchar2  default hr_api.g_varchar2
1015   ,p_candidate_information20      in     varchar2  default hr_api.g_varchar2
1016   ,p_candidate_information21      in     varchar2  default hr_api.g_varchar2
1017   ,p_candidate_information22      in     varchar2  default hr_api.g_varchar2
1018   ,p_candidate_information23      in     varchar2  default hr_api.g_varchar2
1019   ,p_candidate_information24      in     varchar2  default hr_api.g_varchar2
1020   ,p_candidate_information25      in     varchar2  default hr_api.g_varchar2
1021   ,p_candidate_information26      in     varchar2  default hr_api.g_varchar2
1022   ,p_candidate_information27      in     varchar2  default hr_api.g_varchar2
1023   ,p_candidate_information28      in     varchar2  default hr_api.g_varchar2
1024   ,p_candidate_information29      in     varchar2  default hr_api.g_varchar2
1025   ,p_candidate_information30      in     varchar2  default hr_api.g_varchar2
1026   ) is
1027 --
1028   l_rec	  per_eca_shd.g_rec_type;
1029   l_proc  varchar2(72) := g_package||'upd';
1030 --
1031 Begin
1032   hr_utility.set_location('Entering:'||l_proc, 5);
1033   --
1034   -- Call conversion function to turn arguments into the
1035   -- l_rec structure.
1036   --
1037   l_rec :=
1038   per_eca_shd.convert_args
1039   (p_election_candidate_id
1040   ,p_business_group_id
1041   ,p_election_id
1042   ,p_person_id
1043   ,p_rank
1044   ,p_role_id
1045   ,p_attribute_category
1046   ,p_attribute1
1047   ,p_attribute2
1048   ,p_attribute3
1049   ,p_attribute4
1050   ,p_attribute5
1051   ,p_attribute6
1052   ,p_attribute7
1053   ,p_attribute8
1054   ,p_attribute9
1055   ,p_attribute10
1056   ,p_attribute11
1057   ,p_attribute12
1058   ,p_attribute13
1059   ,p_attribute14
1060   ,p_attribute15
1061   ,p_attribute16
1062   ,p_attribute17
1063   ,p_attribute18
1064   ,p_attribute19
1065   ,p_attribute20
1066   ,p_attribute21
1067   ,p_attribute22
1068   ,p_attribute23
1069   ,p_attribute24
1070   ,p_attribute25
1071   ,p_attribute26
1072   ,p_attribute27
1073   ,p_attribute28
1074   ,p_attribute29
1075   ,p_attribute30
1076   ,p_candidate_info_category
1077   ,p_candidate_information1
1078   ,p_candidate_information2
1079   ,p_candidate_information3
1080   ,p_candidate_information4
1081   ,p_candidate_information5
1082   ,p_candidate_information6
1083   ,p_candidate_information7
1084   ,p_candidate_information8
1085   ,p_candidate_information9
1086   ,p_candidate_information10
1087   ,p_candidate_information11
1088   ,p_candidate_information12
1089   ,p_candidate_information13
1090   ,p_candidate_information14
1091   ,p_candidate_information15
1092   ,p_candidate_information16
1093   ,p_candidate_information17
1094   ,p_candidate_information18
1095   ,p_candidate_information19
1096   ,p_candidate_information20
1097   ,p_candidate_information21
1098   ,p_candidate_information22
1099   ,p_candidate_information23
1100   ,p_candidate_information24
1101   ,p_candidate_information25
1102   ,p_candidate_information26
1103   ,p_candidate_information27
1104   ,p_candidate_information28
1105   ,p_candidate_information29
1106   ,p_candidate_information30
1107   ,p_object_version_number
1108   );
1109   --
1110   -- Having converted the arguments into the
1111   -- plsql record structure we call the corresponding record
1112   -- business process.
1113   --
1114   per_eca_upd.upd
1115      (l_rec
1116      );
1117   p_object_version_number := l_rec.object_version_number;
1118   --
1119   hr_utility.set_location(' Leaving:'||l_proc, 10);
1120 End upd;
1121 --
1122 end per_eca_upd;