DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_SUC_UPD

Source


1 PACKAGE BODY per_suc_upd
2 AS
3 /* $Header: pesucrhi.pkb 120.1.12010000.9 2010/02/22 20:28:53 schowdhu ship $ */
4 --
5 -- ----------------------------------------------------------------------------
6 -- |                     Private Global Definitions                           |
7 -- ----------------------------------------------------------------------------
8 --
9    g_package   VARCHAR2 (33) := '  per_suc_upd.';                            -- Global package name
10 
11 --
12 -- ----------------------------------------------------------------------------
13 -- |------------------------------< update_dml >------------------------------|
14 -- ----------------------------------------------------------------------------
15 -- {Start Of Comments}
16 --
17 -- Description:
18 --   This procedure controls the actual dml update logic. The processing of
19 --   this procedure is:
20 --   1) Increment the object_version_number by 1 if the object_version_number
21 --      is defined as an attribute for this entity.
22 --   2) To set and unset the g_api_dml status as required (as we are about to
23 --      perform dml).
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_suc_shd.g_rec_type)
57    IS
58 --
59       l_proc   VARCHAR2 (72) := g_package || 'update_dml';
60 --
61    BEGIN
62       hr_utility.set_location ('Entering:' || l_proc, 5);
63       --
64       -- Increment the object version
65       --
66       p_rec.object_version_number := p_rec.object_version_number + 1;
67       --
68       per_suc_shd.g_api_dml      := TRUE;                                 -- Set the api dml status
69 
70       --
71       -- Update the per_succession_planning Row
72       --
73       UPDATE per_succession_planning
74          SET succession_plan_id = p_rec.succession_plan_id,
75              person_id = p_rec.person_id,
76              position_id = p_rec.position_id,
77              business_group_id = p_rec.business_group_id,
78              start_date = p_rec.start_date,
79              time_scale = p_rec.time_scale,
80              end_date = p_rec.end_date,
81              available_for_promotion = p_rec.available_for_promotion,
82              manager_comments = p_rec.manager_comments,
83              object_version_number = p_rec.object_version_number,
84              attribute_category = p_rec.attribute_category,
85              attribute1 = p_rec.attribute1,
86              attribute2 = p_rec.attribute2,
87              attribute3 = p_rec.attribute3,
88              attribute4 = p_rec.attribute4,
89              attribute5 = p_rec.attribute5,
90              attribute6 = p_rec.attribute6,
91              attribute7 = p_rec.attribute7,
92              attribute8 = p_rec.attribute8,
93              attribute9 = p_rec.attribute9,
94              attribute10 = p_rec.attribute10,
95              attribute11 = p_rec.attribute11,
96              attribute12 = p_rec.attribute12,
97              attribute13 = p_rec.attribute13,
98              attribute14 = p_rec.attribute14,
99              attribute15 = p_rec.attribute15,
100              attribute16 = p_rec.attribute16,
101              attribute17 = p_rec.attribute17,
102              attribute18 = p_rec.attribute18,
103              attribute19 = p_rec.attribute19,
104              attribute20 = p_rec.attribute20,
105              job_id = p_rec.job_id,
106              successee_person_id = p_rec.successee_person_id,
107              person_rank = p_rec.person_rank,
108              PERFORMANCE = p_rec.PERFORMANCE,
109              plan_status = p_rec.plan_status,
110              readiness_percentage = p_rec.readiness_percentage
111        WHERE succession_plan_id = p_rec.succession_plan_id;
112 
113       --
114       per_suc_shd.g_api_dml      := FALSE;                               -- Unset the api dml status
115       --
116       hr_utility.set_location (' Leaving:' || l_proc, 10);
117 --
118    EXCEPTION
119       WHEN hr_api.check_integrity_violated
120       THEN
121          -- A check constraint has been violated
122          per_suc_shd.g_api_dml      := FALSE;                           -- Unset the api dml status
123          per_suc_shd.constraint_error (p_constraint_name      => hr_api.strip_constraint_name
124                                                                                            (SQLERRM));
125       WHEN hr_api.parent_integrity_violated
126       THEN
127          -- Parent integrity has been violated
128          per_suc_shd.g_api_dml      := FALSE;                           -- Unset the api dml status
129          per_suc_shd.constraint_error (p_constraint_name      => hr_api.strip_constraint_name
130                                                                                            (SQLERRM));
131       WHEN hr_api.unique_integrity_violated
132       THEN
133          -- Unique integrity has been violated
134          per_suc_shd.g_api_dml      := FALSE;                           -- Unset the api dml status
135          per_suc_shd.constraint_error (p_constraint_name      => hr_api.strip_constraint_name
136                                                                                            (SQLERRM));
137       WHEN OTHERS
138       THEN
139          per_suc_shd.g_api_dml      := FALSE;                           -- Unset the api dml status
140          RAISE;
141    END update_dml;
142 
143 --
144 -- ----------------------------------------------------------------------------
145 -- |------------------------------< pre_update >------------------------------|
146 -- ----------------------------------------------------------------------------
147 -- {Start Of Comments}
148 --
149 -- Description:
150 --   This private procedure contains any processing which is required before
151 --   the update dml.
152 --
153 -- Prerequisites:
154 --   This is an internal procedure which is called from the upd procedure.
155 --
156 -- In Parameters:
157 --   A Pl/Sql record structre.
158 --
159 -- Post Success:
160 --   Processing continues.
161 --
162 -- Post Failure:
163 --   If an error has occurred, an error message and exception will be raised
164 --   but not handled.
165 --
166 -- Developer Implementation Notes:
167 --   Any pre-processing required before the update dml is issued should be
168 --   coded within this procedure. It is important to note that any 3rd party
169 --   maintenance should be reviewed before placing in this procedure.
170 --
171 -- Access Status:
172 --   Internal Row Handler Use Only.
173 --
174 -- {End Of Comments}
175 -- ----------------------------------------------------------------------------
176    PROCEDURE pre_update (p_rec IN per_suc_shd.g_rec_type)
177    IS
178 --
179       l_proc   VARCHAR2 (72) := g_package || 'pre_update';
180 --
181    BEGIN
182       hr_utility.set_location ('Entering:' || l_proc, 5);
183       --
184       hr_utility.set_location (' Leaving:' || l_proc, 10);
185    END pre_update;
186 
187 --
188 -- ----------------------------------------------------------------------------
189 -- |-----------------------------< post_update >------------------------------|
190 -- ----------------------------------------------------------------------------
191 -- {Start Of Comments}
192 --
193 -- Description:
194 --   This private procedure contains any processing which is required after the
195 --   update dml.
196 --
197 -- Prerequisites:
198 --   This is an internal procedure which is called from the upd procedure.
199 --
200 -- In Parameters:
201 --   A Pl/Sql record structre.
202 --
203 -- Post Success:
204 --   Processing continues.
205 --
206 -- Post Failure:
207 --   If an error has occurred, an error message and exception will be raised
208 --   but not handled.
209 --
210 -- Developer Implementation Notes:
211 --   Any post-processing required after the update dml is issued should be
212 --   coded within this procedure. It is important to note that any 3rd party
213 --   maintenance should be reviewed before placing in this procedure.
214 --
215 -- Access Status:
216 --   Internal Row Handler Use Only.
217 --
218 -- {End Of Comments}
219 -- ----------------------------------------------------------------------------
220    PROCEDURE post_update (p_rec IN per_suc_shd.g_rec_type, p_effective_date IN DATE)
221    IS
222 --
223       l_proc   VARCHAR2 (72) := g_package || 'post_update';
224 --
225    BEGIN
226       hr_utility.set_location ('Entering:' || l_proc, 5);
227 
228       --
229       -- Start of Row Handler User Hook for post_update.
230       --
231       BEGIN
232          per_suc_rku.after_update
233                      (p_succession_plan_id             => p_rec.succession_plan_id,
234                       p_person_id                      => p_rec.person_id,
235                       p_position_id                    => p_rec.position_id,
236                       p_business_group_id              => p_rec.business_group_id,
237                       p_start_date                     => p_rec.start_date,
238                       p_time_scale                     => p_rec.time_scale,
239                       p_end_date                       => p_rec.end_date,
240                       p_available_for_promotion        => p_rec.available_for_promotion,
241                       p_manager_comments               => p_rec.manager_comments,
242                       p_object_version_number          => p_rec.object_version_number,
243                       p_attribute_category             => p_rec.attribute_category,
244                       p_attribute1                     => p_rec.attribute1,
245                       p_attribute2                     => p_rec.attribute2,
246                       p_attribute3                     => p_rec.attribute3,
247                       p_attribute4                     => p_rec.attribute4,
248                       p_attribute5                     => p_rec.attribute5,
249                       p_attribute6                     => p_rec.attribute6,
250                       p_attribute7                     => p_rec.attribute7,
251                       p_attribute8                     => p_rec.attribute8,
252                       p_attribute9                     => p_rec.attribute9,
253                       p_attribute10                    => p_rec.attribute10,
254                       p_attribute11                    => p_rec.attribute11,
255                       p_attribute12                    => p_rec.attribute12,
256                       p_attribute13                    => p_rec.attribute13,
257                       p_attribute14                    => p_rec.attribute14,
258                       p_attribute15                    => p_rec.attribute15,
259                       p_attribute16                    => p_rec.attribute16,
260                       p_attribute17                    => p_rec.attribute17,
261                       p_attribute18                    => p_rec.attribute18,
262                       p_attribute19                    => p_rec.attribute19,
263                       p_attribute20                    => p_rec.attribute20,
264                       p_effective_date                 => p_effective_date,
265                       p_job_id                         => p_rec.job_id,
266                       p_successee_person_id            => p_rec.successee_person_id,
267                       p_person_rank                    => p_rec.person_rank,
268                       p_performance                    => p_rec.PERFORMANCE,
269                       p_plan_status                    => p_rec.plan_status,
270                       p_readiness_percentage           => p_rec.readiness_percentage,
271                       p_person_id_o                    => per_suc_shd.g_old_rec.person_id,
272                       p_position_id_o                  => per_suc_shd.g_old_rec.position_id,
273                       p_business_group_id_o            => per_suc_shd.g_old_rec.business_group_id,
274                       p_start_date_o                   => per_suc_shd.g_old_rec.start_date,
275                       p_time_scale_o                   => per_suc_shd.g_old_rec.time_scale,
276                       p_end_date_o                     => per_suc_shd.g_old_rec.end_date,
277                       p_available_for_promotion_o      => per_suc_shd.g_old_rec.available_for_promotion,
278                       p_manager_comments_o             => per_suc_shd.g_old_rec.manager_comments,
279                       p_object_version_number_o        => per_suc_shd.g_old_rec.object_version_number,
280                       p_attribute_category_o           => per_suc_shd.g_old_rec.attribute_category,
281                       p_attribute1_o                   => per_suc_shd.g_old_rec.attribute1,
282                       p_attribute2_o                   => per_suc_shd.g_old_rec.attribute2,
283                       p_attribute3_o                   => per_suc_shd.g_old_rec.attribute3,
284                       p_attribute4_o                   => per_suc_shd.g_old_rec.attribute4,
285                       p_attribute5_o                   => per_suc_shd.g_old_rec.attribute5,
286                       p_attribute6_o                   => per_suc_shd.g_old_rec.attribute6,
287                       p_attribute7_o                   => per_suc_shd.g_old_rec.attribute7,
288                       p_attribute8_o                   => per_suc_shd.g_old_rec.attribute8,
289                       p_attribute9_o                   => per_suc_shd.g_old_rec.attribute9,
290                       p_attribute10_o                  => per_suc_shd.g_old_rec.attribute10,
291                       p_attribute11_o                  => per_suc_shd.g_old_rec.attribute11,
292                       p_attribute12_o                  => per_suc_shd.g_old_rec.attribute12,
293                       p_attribute13_o                  => per_suc_shd.g_old_rec.attribute13,
294                       p_attribute14_o                  => per_suc_shd.g_old_rec.attribute14,
295                       p_attribute15_o                  => per_suc_shd.g_old_rec.attribute15,
296                       p_attribute16_o                  => per_suc_shd.g_old_rec.attribute16,
297                       p_attribute17_o                  => per_suc_shd.g_old_rec.attribute17,
298                       p_attribute18_o                  => per_suc_shd.g_old_rec.attribute18,
299                       p_attribute19_o                  => per_suc_shd.g_old_rec.attribute19,
300                       p_attribute20_o                  => per_suc_shd.g_old_rec.attribute20,
301                       p_job_id_o                       => per_suc_shd.g_old_rec.job_id,
302                       p_successee_person_id_o          => per_suc_shd.g_old_rec.successee_person_id,
303                       p_person_rank_o                  => per_suc_shd.g_old_rec.person_rank,
304                       p_performance_o                  => per_suc_shd.g_old_rec.PERFORMANCE,
305                       p_plan_status_o                  => per_suc_shd.g_old_rec.plan_status,
306                       p_readiness_percentage_o         => per_suc_shd.g_old_rec.readiness_percentage
307                      );
308       EXCEPTION
309          WHEN hr_api.cannot_find_prog_unit
310          THEN
311             hr_api.cannot_find_prog_unit_error (p_module_name      => 'PER_SUCCESSION_PLANNING',
312                                                 p_hook_type        => 'AU'
313                                                );
314       END;
315 
316       --
317       -- End of Row Handler User Hook for post_update.
318       --
319       hr_utility.set_location (' Leaving:' || l_proc, 10);
320    END post_update;
321 
322 --
323 -- ----------------------------------------------------------------------------
324 -- |-----------------------------< convert_defs >-----------------------------|
325 -- ----------------------------------------------------------------------------
326 -- {Start Of Comments}
327 --
328 -- Description:
329 --   The Convert_Defs procedure has one very important function:
330 --   It must return the record structure for the row with all system defaulted
331 --   values converted into its corresponding parameter value for update. When
332 --   we attempt to update a row through the Upd process , certain
333 --   parameters can be defaulted which enables flexibility in the calling of
334 --   the upd process (e.g. only attributes which need to be updated need to be
335 --   specified). For the upd process to determine which attributes
336 --   have NOT been specified we need to check if the parameter has a reserved
337 --   system default value. Therefore, for all parameters which have a
338 --   corresponding reserved system default mechanism specified we need to
339 --   check if a system default is being used. If a system default is being
340 --   used then we convert the defaulted value into its corresponding attribute
341 --   value held in the g_old_rec data structure.
342 --
343 -- Prerequisites:
344 --   This private function can only be called from the upd process.
345 --
346 -- In Parameters:
347 --   A Pl/Sql record structre.
348 --
349 -- Post Success:
350 --   The record structure will be returned with all system defaulted parameter
351 --   values converted into its current row attribute value.
352 --
353 -- Post Failure:
354 --   No direct error handling is required within this function. Any possible
355 --   errors within this procedure will be a PL/SQL value error due to conversion
356 
357    --   of datatypes or data lengths.
358 --
359 -- Developer Implementation Notes:
360 --   None.
361 --
362 -- Access Status:
363 --   Internal Row Handler Use Only.
364 --
365 -- {End Of Comments}
366 -- ----------------------------------------------------------------------------
367    PROCEDURE convert_defs (p_rec IN OUT NOCOPY per_suc_shd.g_rec_type)
368    IS
369 --
370       l_proc   VARCHAR2 (72) := g_package || 'convert_defs';
371 --
372    BEGIN
373       --
374       hr_utility.set_location ('Entering:' || l_proc, 5);
375 
376       --
377       -- We must now examine each argument value in the
378       -- p_rec plsql record structure
379       -- to see if a system default is being used. If a system default
380       -- is being used then we must set to the 'current' argument value.
381       --
382       IF (p_rec.person_id = hr_api.g_number)
383       THEN
384          p_rec.person_id            := per_suc_shd.g_old_rec.person_id;
385       END IF;
386 
387       IF (p_rec.position_id = hr_api.g_number)
388       THEN
389          p_rec.position_id          := per_suc_shd.g_old_rec.position_id;
390       END IF;
391 
392       IF (p_rec.business_group_id = hr_api.g_number)
393       THEN
394          p_rec.business_group_id    := per_suc_shd.g_old_rec.business_group_id;
395       END IF;
396 
397       IF (p_rec.start_date = hr_api.g_date)
398       THEN
399          p_rec.start_date           := per_suc_shd.g_old_rec.start_date;
400       END IF;
401 
402       IF (p_rec.time_scale = hr_api.g_varchar2)
403       THEN
404          p_rec.time_scale           := per_suc_shd.g_old_rec.time_scale;
405       END IF;
406 
407       IF (p_rec.end_date = hr_api.g_date)
408       THEN
409          p_rec.end_date             := per_suc_shd.g_old_rec.end_date;
410       END IF;
411 
412       IF (p_rec.available_for_promotion = hr_api.g_varchar2)
413       THEN
414          p_rec.available_for_promotion := per_suc_shd.g_old_rec.available_for_promotion;
415       END IF;
416 
417       IF (p_rec.manager_comments = hr_api.g_varchar2)
418       THEN
419          p_rec.manager_comments     := per_suc_shd.g_old_rec.manager_comments;
420       END IF;
421 
422       IF (p_rec.attribute_category = hr_api.g_varchar2)
423       THEN
424          p_rec.attribute_category   := per_suc_shd.g_old_rec.attribute_category;
425       END IF;
426 
427       IF (p_rec.attribute1 = hr_api.g_varchar2)
428       THEN
429          p_rec.attribute1           := per_suc_shd.g_old_rec.attribute1;
430       END IF;
431 
432       IF (p_rec.attribute2 = hr_api.g_varchar2)
433       THEN
434          p_rec.attribute2           := per_suc_shd.g_old_rec.attribute2;
435       END IF;
436 
437       IF (p_rec.attribute3 = hr_api.g_varchar2)
438       THEN
439          p_rec.attribute3           := per_suc_shd.g_old_rec.attribute3;
440       END IF;
441 
442       IF (p_rec.attribute4 = hr_api.g_varchar2)
443       THEN
444          p_rec.attribute4           := per_suc_shd.g_old_rec.attribute4;
445       END IF;
446 
447       IF (p_rec.attribute5 = hr_api.g_varchar2)
448       THEN
449          p_rec.attribute5           := per_suc_shd.g_old_rec.attribute5;
450       END IF;
451 
452       IF (p_rec.attribute6 = hr_api.g_varchar2)
453       THEN
454          p_rec.attribute6           := per_suc_shd.g_old_rec.attribute6;
455       END IF;
456 
457       IF (p_rec.attribute7 = hr_api.g_varchar2)
458       THEN
459          p_rec.attribute7           := per_suc_shd.g_old_rec.attribute7;
460       END IF;
461 
462       IF (p_rec.attribute8 = hr_api.g_varchar2)
463       THEN
464          p_rec.attribute8           := per_suc_shd.g_old_rec.attribute8;
465       END IF;
466 
467       IF (p_rec.attribute9 = hr_api.g_varchar2)
468       THEN
469          p_rec.attribute9           := per_suc_shd.g_old_rec.attribute9;
470       END IF;
471 
472       IF (p_rec.attribute10 = hr_api.g_varchar2)
473       THEN
474          p_rec.attribute10          := per_suc_shd.g_old_rec.attribute10;
475       END IF;
476 
477       IF (p_rec.attribute11 = hr_api.g_varchar2)
478       THEN
479          p_rec.attribute11          := per_suc_shd.g_old_rec.attribute11;
480       END IF;
481 
482       IF (p_rec.attribute12 = hr_api.g_varchar2)
483       THEN
484          p_rec.attribute12          := per_suc_shd.g_old_rec.attribute12;
485       END IF;
486 
487       IF (p_rec.attribute13 = hr_api.g_varchar2)
488       THEN
489          p_rec.attribute13          := per_suc_shd.g_old_rec.attribute13;
490       END IF;
491 
492       IF (p_rec.attribute14 = hr_api.g_varchar2)
493       THEN
494          p_rec.attribute14          := per_suc_shd.g_old_rec.attribute14;
495       END IF;
496 
497       IF (p_rec.attribute15 = hr_api.g_varchar2)
498       THEN
499          p_rec.attribute15          := per_suc_shd.g_old_rec.attribute15;
500       END IF;
501 
502       IF (p_rec.attribute16 = hr_api.g_varchar2)
503       THEN
504          p_rec.attribute16          := per_suc_shd.g_old_rec.attribute16;
505       END IF;
506 
507       IF (p_rec.attribute17 = hr_api.g_varchar2)
508       THEN
509          p_rec.attribute17          := per_suc_shd.g_old_rec.attribute17;
510       END IF;
511 
512       IF (p_rec.attribute18 = hr_api.g_varchar2)
513       THEN
514          p_rec.attribute18          := per_suc_shd.g_old_rec.attribute18;
515       END IF;
516 
517       IF (p_rec.attribute19 = hr_api.g_varchar2)
518       THEN
519          p_rec.attribute19          := per_suc_shd.g_old_rec.attribute19;
520       END IF;
521 
522       IF (p_rec.attribute20 = hr_api.g_varchar2)
523       THEN
524          p_rec.attribute20          := per_suc_shd.g_old_rec.attribute20;
525       END IF;
526 
527       IF (p_rec.job_id = hr_api.g_number)
528       THEN
529          p_rec.job_id               := per_suc_shd.g_old_rec.job_id;
530       END IF;
531 
532       IF (p_rec.successee_person_id = hr_api.g_number)
533       THEN
534          p_rec.successee_person_id  := per_suc_shd.g_old_rec.successee_person_id;
535       END IF;
536 
537       IF (p_rec.person_rank = hr_api.g_number)
538       THEN
539          p_rec.person_rank          := per_suc_shd.g_old_rec.person_rank;
540       END IF;
541 
542       IF (p_rec.PERFORMANCE = hr_api.g_varchar2)
543       THEN
544          p_rec.PERFORMANCE          := per_suc_shd.g_old_rec.PERFORMANCE;
545       END IF;
546 
547       IF (p_rec.plan_status = hr_api.g_varchar2)
548       THEN
549          p_rec.plan_status          := per_suc_shd.g_old_rec.plan_status;
550       END IF;
551 
552       IF (p_rec.readiness_percentage = hr_api.g_number)
553       THEN
554          p_rec.readiness_percentage := per_suc_shd.g_old_rec.readiness_percentage;
555       END IF;
556 
557       hr_utility.set_location (' Leaving:' || l_proc, 10);
558 --
559    END convert_defs;
560 
561 --
562 -- ----------------------------------------------------------------------------
563 -- |---------------------------------< upd >----------------------------------|
564 -- ----------------------------------------------------------------------------
565    PROCEDURE upd (p_rec IN OUT NOCOPY per_suc_shd.g_rec_type, p_effective_date IN DATE)
566    IS
567 --
568       l_proc   VARCHAR2 (72) := g_package || 'upd';
569 --
570    BEGIN
571       hr_utility.set_location ('Entering:' || l_proc, 5);
572       --
573       -- We must lock the row which we need to update.
574       --
575       per_suc_shd.lck (p_rec.succession_plan_id, p_rec.object_version_number);
576       --
577       -- 1. During an update system defaults are used to determine if
578       --    arguments have been defaulted or not. We must therefore
579       --    derive the full record structure values to be updated.
580       --
581       -- 2. Call the supporting update validate operations.
582       --
583       convert_defs (p_rec);
584       per_suc_bus.update_validate (p_rec, p_effective_date);
585       --
586       -- Call the supporting pre-update operation
587       --
588       pre_update (p_rec);
589       --
590       -- Update the row.
591       --
592       update_dml (p_rec);
593       --
594       -- Call the supporting post-update operation
595       --
596       post_update (p_rec, p_effective_date);
597    END upd;
598 
599 --
600 -- ----------------------------------------------------------------------------
601 -- |---------------------------------< upd >----------------------------------|
602 -- ----------------------------------------------------------------------------
603    PROCEDURE upd (
604       p_succession_plan_id        IN              NUMBER,
605       p_person_id                 IN              NUMBER DEFAULT hr_api.g_number,
606       p_position_id               IN              NUMBER DEFAULT hr_api.g_number,
607       p_business_group_id         IN              NUMBER DEFAULT hr_api.g_number,
608       p_start_date                IN              DATE DEFAULT hr_api.g_date,
609       p_time_scale                IN              VARCHAR2 DEFAULT hr_api.g_varchar2,
610       p_end_date                  IN              DATE DEFAULT hr_api.g_date,
611       p_available_for_promotion   IN              VARCHAR2 DEFAULT hr_api.g_varchar2,
612       p_manager_comments          IN              VARCHAR2 DEFAULT hr_api.g_varchar2,
613       p_object_version_number     IN OUT NOCOPY   NUMBER,
614       p_attribute_category        IN              VARCHAR2 DEFAULT hr_api.g_varchar2,
615       p_attribute1                IN              VARCHAR2 DEFAULT hr_api.g_varchar2,
616       p_attribute2                IN              VARCHAR2 DEFAULT hr_api.g_varchar2,
617       p_attribute3                IN              VARCHAR2 DEFAULT hr_api.g_varchar2,
618       p_attribute4                IN              VARCHAR2 DEFAULT hr_api.g_varchar2,
619       p_attribute5                IN              VARCHAR2 DEFAULT hr_api.g_varchar2,
620       p_attribute6                IN              VARCHAR2 DEFAULT hr_api.g_varchar2,
621       p_attribute7                IN              VARCHAR2 DEFAULT hr_api.g_varchar2,
622       p_attribute8                IN              VARCHAR2 DEFAULT hr_api.g_varchar2,
623       p_attribute9                IN              VARCHAR2 DEFAULT hr_api.g_varchar2,
624       p_attribute10               IN              VARCHAR2 DEFAULT hr_api.g_varchar2,
625       p_attribute11               IN              VARCHAR2 DEFAULT hr_api.g_varchar2,
626       p_attribute12               IN              VARCHAR2 DEFAULT hr_api.g_varchar2,
627       p_attribute13               IN              VARCHAR2 DEFAULT hr_api.g_varchar2,
628       p_attribute14               IN              VARCHAR2 DEFAULT hr_api.g_varchar2,
629       p_attribute15               IN              VARCHAR2 DEFAULT hr_api.g_varchar2,
630       p_attribute16               IN              VARCHAR2 DEFAULT hr_api.g_varchar2,
631       p_attribute17               IN              VARCHAR2 DEFAULT hr_api.g_varchar2,
632       p_attribute18               IN              VARCHAR2 DEFAULT hr_api.g_varchar2,
633       p_attribute19               IN              VARCHAR2 DEFAULT hr_api.g_varchar2,
634       p_attribute20               IN              VARCHAR2 DEFAULT hr_api.g_varchar2,
635       p_effective_date            IN              DATE DEFAULT hr_api.g_date,
636       p_job_id                    IN              NUMBER DEFAULT hr_api.g_number,
637       p_successee_person_id       IN              NUMBER DEFAULT hr_api.g_number,
638       p_person_rank               IN              NUMBER DEFAULT hr_api.g_number,
639       p_performance               IN              VARCHAR2 DEFAULT hr_api.g_varchar2,
640       p_plan_status               IN              VARCHAR2 DEFAULT hr_api.g_varchar2,
641       p_readiness_percentage      IN              NUMBER DEFAULT hr_api.g_number
642    )
643    IS
644 --
645       l_rec    per_suc_shd.g_rec_type;
646       l_proc   VARCHAR2 (72)          := g_package || 'upd';
647 --
648    BEGIN
649       hr_utility.set_location ('Entering:' || l_proc, 5);
650       --
651       -- Call conversion function to turn arguments into the
652       -- l_rec structure.
653       --
654       l_rec                      :=
655          per_suc_shd.convert_args (p_succession_plan_id,
656                                    p_person_id,
657                                    p_position_id,
658                                    p_business_group_id,
659                                    p_start_date,
660                                    p_time_scale,
661                                    p_end_date,
662                                    p_available_for_promotion,
663                                    p_manager_comments,
664                                    p_object_version_number,
665                                    p_attribute_category,
666                                    p_attribute1,
667                                    p_attribute2,
668                                    p_attribute3,
669                                    p_attribute4,
670                                    p_attribute5,
671                                    p_attribute6,
672                                    p_attribute7,
673                                    p_attribute8,
674                                    p_attribute9,
675                                    p_attribute10,
676                                    p_attribute11,
677                                    p_attribute12,
678                                    p_attribute13,
679                                    p_attribute14,
680                                    p_attribute15,
681                                    p_attribute16,
682                                    p_attribute17,
683                                    p_attribute18,
684                                    p_attribute19,
685                                    p_attribute20,
686                                    p_job_id,
687                                    p_successee_person_id,
688                                    p_person_rank,
689                                    p_performance,
690                                    p_plan_status,
691                                    p_readiness_percentage
692                                   );
693       --
694       -- Having converted the arguments into the
695       -- plsql record structure we call the corresponding record
696       -- business process.
697       --
698       upd (l_rec, p_effective_date);
699       p_object_version_number    := l_rec.object_version_number;
700       --
701       hr_utility.set_location (' Leaving:' || l_proc, 10);
702    END upd;
703 --
704 END per_suc_upd;