DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_PJU_UPD

Source


1 Package Body per_pju_upd as
2 /* $Header: pepjurhi.pkb 115.14 2002/12/04 10:55:38 eumenyio ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  per_pju_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_pju_shd.g_rec_type
56   ) is
57 --
58   l_proc  varchar2(72) := g_package||'update_dml';
59 --
60 Begin
61   hr_utility.set_location('Entering:'||l_proc, 5);
62   --
63   -- Increment the object version
64   p_rec.object_version_number := p_rec.object_version_number + 1;
65   --
66   --
67   --
68   -- Update the per_previous_job_usages Row
69   --
70   update per_previous_job_usages
71     set
72      previous_job_usage_id           = p_rec.previous_job_usage_id
73     ,assignment_id                   = p_rec.assignment_id
74     ,previous_employer_id            = p_rec.previous_employer_id
75     ,previous_job_id                 = p_rec.previous_job_id
76     ,start_date                      = p_rec.start_date
77     ,end_date                        = p_rec.end_date
78     ,period_years                    = p_rec.period_years
79     ,period_months                   = p_rec.period_months
80     ,period_days                     = p_rec.period_days
81     ,pju_attribute_category          = p_rec.pju_attribute_category
82     ,pju_attribute1                  = p_rec.pju_attribute1
83     ,pju_attribute2                  = p_rec.pju_attribute2
84     ,pju_attribute3                  = p_rec.pju_attribute3
85     ,pju_attribute4                  = p_rec.pju_attribute4
86     ,pju_attribute5                  = p_rec.pju_attribute5
87     ,pju_attribute6                  = p_rec.pju_attribute6
88     ,pju_attribute7                  = p_rec.pju_attribute7
89     ,pju_attribute8                  = p_rec.pju_attribute8
90     ,pju_attribute9                  = p_rec.pju_attribute9
91     ,pju_attribute10                 = p_rec.pju_attribute10
92     ,pju_attribute11                 = p_rec.pju_attribute11
93     ,pju_attribute12                 = p_rec.pju_attribute12
94     ,pju_attribute13                 = p_rec.pju_attribute13
95     ,pju_attribute14                 = p_rec.pju_attribute14
96     ,pju_attribute15                 = p_rec.pju_attribute15
97     ,pju_attribute16                 = p_rec.pju_attribute16
98     ,pju_attribute17                 = p_rec.pju_attribute17
99     ,pju_attribute18                 = p_rec.pju_attribute18
100     ,pju_attribute19                 = p_rec.pju_attribute19
101     ,pju_attribute20                 = p_rec.pju_attribute20
102     ,pju_information_category        = p_rec.pju_information_category
103     ,pju_information1                = p_rec.pju_information1
104     ,pju_information2                = p_rec.pju_information2
105     ,pju_information3                = p_rec.pju_information3
106     ,pju_information4                = p_rec.pju_information4
107     ,pju_information5                = p_rec.pju_information5
108     ,pju_information6                = p_rec.pju_information6
109     ,pju_information7                = p_rec.pju_information7
110     ,pju_information8                = p_rec.pju_information8
111     ,pju_information9                = p_rec.pju_information9
112     ,pju_information10               = p_rec.pju_information10
113     ,pju_information11               = p_rec.pju_information11
114     ,pju_information12               = p_rec.pju_information12
115     ,pju_information13               = p_rec.pju_information13
116     ,pju_information14               = p_rec.pju_information14
117     ,pju_information15               = p_rec.pju_information15
118     ,pju_information16               = p_rec.pju_information16
119     ,pju_information17               = p_rec.pju_information17
120     ,pju_information18               = p_rec.pju_information18
121     ,pju_information19               = p_rec.pju_information19
122     ,pju_information20               = p_rec.pju_information20
123     ,object_version_number           = p_rec.object_version_number
124     where previous_job_usage_id = p_rec.previous_job_usage_id;
125   --
126   --
127   --
128   hr_utility.set_location(' Leaving:'||l_proc, 10);
129 --
130 Exception
131   When hr_api.check_integrity_violated Then
132     -- A check constraint has been violated
133     --
134     per_pju_shd.constraint_error
135       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
136   When hr_api.parent_integrity_violated Then
137     -- Parent integrity has been violated
138     --
139     per_pju_shd.constraint_error
140       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
141   When hr_api.unique_integrity_violated Then
142     -- Unique integrity has been violated
143     --
144     per_pju_shd.constraint_error
145       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
146   When Others Then
147     --
148     Raise;
149 End update_dml;
150 --
151 -- ----------------------------------------------------------------------------
152 -- |------------------------------< pre_update >------------------------------|
153 -- ----------------------------------------------------------------------------
154 -- {Start Of Comments}
155 --
156 -- Description:
157 --   This private procedure contains any processing which is required before
158 --   the update dml.
159 --
160 -- Prerequisites:
161 --   This is an internal procedure which is called from the upd procedure.
162 --
163 -- In Parameters:
164 --   A Pl/Sql record structure.
165 --
166 -- Post Success:
167 --   Processing continues.
168 --
169 -- Post Failure:
170 --   If an error has occurred, an error message and exception wil be raised
171 --   but not handled.
172 --
173 -- Developer Implementation Notes:
174 --   Any pre-processing required before the update dml is issued should be
175 --   coded within this procedure. It is important to note that any 3rd party
176 --   maintenance should be reviewed before placing in this procedure.
177 --
178 -- Access Status:
179 --   Internal Row Handler Use Only.
180 --
181 -- {End Of Comments}
182 -- ----------------------------------------------------------------------------
183 Procedure pre_update
184   (p_rec in per_pju_shd.g_rec_type
185   ) is
186 --
187   l_proc  varchar2(72) := g_package||'pre_update';
188 --
189 Begin
190   hr_utility.set_location('Entering:'||l_proc, 5);
191   --
192   hr_utility.set_location(' Leaving:'||l_proc, 10);
193 End pre_update;
194 --
195 -- ----------------------------------------------------------------------------
196 -- |-----------------------------< post_update >------------------------------|
197 -- ----------------------------------------------------------------------------
198 -- {Start Of Comments}
199 --
200 -- Description:
201 --   This private procedure contains any processing which is required after
202 --   the update dml.
203 --
204 -- Prerequisites:
205 --   This is an internal procedure which is called from the upd procedure.
206 --
207 -- In Parameters:
208 --   A Pl/Sql record structure.
209 --
210 -- Post Success:
211 --   Processing continues.
212 --
213 -- Post Failure:
214 --   If an error has occurred, an error message and exception will be raised
215 --   but not handled.
216 --
217 -- Developer Implementation Notes:
218 --   Any post-processing required after the update dml is issued should be
219 --   coded within this procedure. It is important to note that any 3rd party
220 --   maintenance should be reviewed before placing in this procedure.
221 --
222 -- Access Status:
223 --   Internal Row Handler Use Only.
224 --
225 -- {End Of Comments}
226 -- ----------------------------------------------------------------------------
227 Procedure post_update
228   (p_rec                          in per_pju_shd.g_rec_type
229   ) is
230 --
231   l_proc  varchar2(72) := g_package||'post_update';
232 --
233 Begin
234   hr_utility.set_location('Entering:'||l_proc, 5);
235   begin
236     --
237     per_pju_rku.after_update
238       (p_previous_job_usage_id
239       => p_rec.previous_job_usage_id
240       ,p_assignment_id
241       => p_rec.assignment_id
242       ,p_previous_employer_id
243       => p_rec.previous_employer_id
244       ,p_previous_job_id
245       => p_rec.previous_job_id
246       ,p_start_date
247       => p_rec.start_date
248       ,p_end_date
249       => p_rec.end_date
250       ,p_period_years
251       => p_rec.period_years
252       ,p_period_months
253       => p_rec.period_months
254       ,p_period_days
255       => p_rec.period_days
256       ,p_pju_attribute_category
257       => p_rec.pju_attribute_category
258       ,p_pju_attribute1
259       => p_rec.pju_attribute1
260       ,p_pju_attribute2
261       => p_rec.pju_attribute2
262       ,p_pju_attribute3
263       => p_rec.pju_attribute3
264       ,p_pju_attribute4
265       => p_rec.pju_attribute4
266       ,p_pju_attribute5
267       => p_rec.pju_attribute5
268       ,p_pju_attribute6
269       => p_rec.pju_attribute6
270       ,p_pju_attribute7
271       => p_rec.pju_attribute7
272       ,p_pju_attribute8
273       => p_rec.pju_attribute8
274       ,p_pju_attribute9
275       => p_rec.pju_attribute9
276       ,p_pju_attribute10
277       => p_rec.pju_attribute10
278       ,p_pju_attribute11
279       => p_rec.pju_attribute11
280       ,p_pju_attribute12
281       => p_rec.pju_attribute12
282       ,p_pju_attribute13
283       => p_rec.pju_attribute13
284       ,p_pju_attribute14
285       => p_rec.pju_attribute14
286       ,p_pju_attribute15
287       => p_rec.pju_attribute15
288       ,p_pju_attribute16
289       => p_rec.pju_attribute16
290       ,p_pju_attribute17
291       => p_rec.pju_attribute17
292       ,p_pju_attribute18
293       => p_rec.pju_attribute18
294       ,p_pju_attribute19
295       => p_rec.pju_attribute19
296       ,p_pju_attribute20
297       => p_rec.pju_attribute20
298       ,p_pju_information_category
299       => p_rec.pju_information_category
300       ,p_pju_information1
301       => p_rec.pju_information1
302       ,p_pju_information2
303       => p_rec.pju_information2
304       ,p_pju_information3
305       => p_rec.pju_information3
306       ,p_pju_information4
307       => p_rec.pju_information4
308       ,p_pju_information5
309       => p_rec.pju_information5
310       ,p_pju_information6
311       => p_rec.pju_information6
312       ,p_pju_information7
313       => p_rec.pju_information7
314       ,p_pju_information8
315       => p_rec.pju_information8
316       ,p_pju_information9
317       => p_rec.pju_information9
318       ,p_pju_information10
319       => p_rec.pju_information10
320       ,p_pju_information11
321       => p_rec.pju_information11
322       ,p_pju_information12
323       => p_rec.pju_information12
324       ,p_pju_information13
325       => p_rec.pju_information13
326       ,p_pju_information14
327       => p_rec.pju_information14
328       ,p_pju_information15
329       => p_rec.pju_information15
330       ,p_pju_information16
331       => p_rec.pju_information16
332       ,p_pju_information17
333       => p_rec.pju_information17
334       ,p_pju_information18
335       => p_rec.pju_information18
336       ,p_pju_information19
337       => p_rec.pju_information19
338       ,p_pju_information20
339       => p_rec.pju_information20
340       ,p_object_version_number
341       => p_rec.object_version_number
342       );
343     --
344   exception
345     --
346     when hr_api.cannot_find_prog_unit then
347       --
348       hr_api.cannot_find_prog_unit_error
349         (p_module_name => 'PER_PREVIOUS_JOB_USAGES'
350         ,p_hook_type   => 'AU');
351       --
352   end;
353   --
354   hr_utility.set_location(' Leaving:'||l_proc, 10);
355 End post_update;
356 --
357 -- ----------------------------------------------------------------------------
358 -- |-----------------------------< convert_defs >-----------------------------|
359 -- ----------------------------------------------------------------------------
360 -- {Start Of Comments}
361 --
362 -- Description:
363 --   The Convert_Defs procedure has one very important function:
364 --   It must return the record structure for the row with all system defaulted
365 --   values converted into its corresponding parameter value for update. When
366 --   we attempt to update a row through the Upd process , certain
367 --   parameters can be defaulted which enables flexibility in the calling of
368 --   the upd process (e.g. only attributes which need to be updated need to be
369 --   specified). For the upd process to determine which attributes
370 --   have NOT been specified we need to check if the parameter has a reserved
371 --   system default value. Therefore, for all parameters which have a
372 --   corresponding reserved system default mechanism specified we need to
373 --   check if a system default is being used. If a system default is being
374 --   used then we convert the defaulted value into its corresponding attribute
375 --   value held in the g_old_rec data structure.
376 --
377 -- Prerequisites:
378 --   This private function can only be called from the upd process.
379 --
380 -- In Parameters:
381 --   A Pl/Sql record structure.
382 --
383 -- Post Success:
384 --   The record structure will be returned with all system defaulted parameter
385 --   values converted into its current row attribute value.
386 --
387 -- Post Failure:
388 --   No direct error handling is required within this function. Any possible
389 --   errors within this procedure will be a PL/SQL value error due to
390 --   conversion of datatypes or data lengths.
391 --
392 -- Developer Implementation Notes:
393 --   None.
394 --
395 -- Access Status:
396 --   Internal Row Handler Use Only.
397 --
398 -- {End Of Comments}
399 -- ----------------------------------------------------------------------------
400 Procedure convert_defs
401   (p_rec in out nocopy per_pju_shd.g_rec_type
402   ) is
403 --
404 Begin
405   --
406   -- We must now examine each argument value in the
407   -- p_rec plsql record structure
408   -- to see if a system default is being used. If a system default
409   -- is being used then we must set to the 'current' argument value.
410   --
411   If (p_rec.assignment_id = hr_api.g_number) then
412     p_rec.assignment_id :=
413     per_pju_shd.g_old_rec.assignment_id;
414   End If;
415   If (p_rec.previous_employer_id = hr_api.g_number) then
416     p_rec.previous_employer_id :=
417     per_pju_shd.g_old_rec.previous_employer_id;
418   End If;
419   If (p_rec.previous_job_id = hr_api.g_number) then
420     p_rec.previous_job_id :=
421     per_pju_shd.g_old_rec.previous_job_id;
422   End If;
423   If (p_rec.start_date = hr_api.g_date) then
424     p_rec.start_date :=
425     per_pju_shd.g_old_rec.start_date;
426   End If;
427   If (p_rec.end_date = hr_api.g_date) then
428     p_rec.end_date :=
429     per_pju_shd.g_old_rec.end_date;
430   End If;
431   If (p_rec.period_years = hr_api.g_number) then
432     p_rec.period_years :=
433     per_pju_shd.g_old_rec.period_years;
434   End If;
435   If (p_rec.period_months = hr_api.g_number) then
436     p_rec.period_months :=
437     per_pju_shd.g_old_rec.period_months;
438   End If;
439   If (p_rec.period_days = hr_api.g_number) then
440     p_rec.period_days :=
441     per_pju_shd.g_old_rec.period_days;
442   End If;
443   If (p_rec.pju_attribute_category = hr_api.g_varchar2) then
444     p_rec.pju_attribute_category :=
445     per_pju_shd.g_old_rec.pju_attribute_category;
446   End If;
447   If (p_rec.pju_attribute1 = hr_api.g_varchar2) then
448     p_rec.pju_attribute1 :=
449     per_pju_shd.g_old_rec.pju_attribute1;
450   End If;
451   If (p_rec.pju_attribute2 = hr_api.g_varchar2) then
452     p_rec.pju_attribute2 :=
453     per_pju_shd.g_old_rec.pju_attribute2;
454   End If;
455   If (p_rec.pju_attribute3 = hr_api.g_varchar2) then
456     p_rec.pju_attribute3 :=
457     per_pju_shd.g_old_rec.pju_attribute3;
458   End If;
459   If (p_rec.pju_attribute4 = hr_api.g_varchar2) then
460     p_rec.pju_attribute4 :=
461     per_pju_shd.g_old_rec.pju_attribute4;
462   End If;
463   If (p_rec.pju_attribute5 = hr_api.g_varchar2) then
464     p_rec.pju_attribute5 :=
465     per_pju_shd.g_old_rec.pju_attribute5;
466   End If;
467   If (p_rec.pju_attribute6 = hr_api.g_varchar2) then
468     p_rec.pju_attribute6 :=
469     per_pju_shd.g_old_rec.pju_attribute6;
470   End If;
471   If (p_rec.pju_attribute7 = hr_api.g_varchar2) then
472     p_rec.pju_attribute7 :=
473     per_pju_shd.g_old_rec.pju_attribute7;
474   End If;
475   If (p_rec.pju_attribute8 = hr_api.g_varchar2) then
476     p_rec.pju_attribute8 :=
477     per_pju_shd.g_old_rec.pju_attribute8;
478   End If;
479   If (p_rec.pju_attribute9 = hr_api.g_varchar2) then
480     p_rec.pju_attribute9 :=
481     per_pju_shd.g_old_rec.pju_attribute9;
482   End If;
483   If (p_rec.pju_attribute10 = hr_api.g_varchar2) then
484     p_rec.pju_attribute10 :=
485     per_pju_shd.g_old_rec.pju_attribute10;
486   End If;
487   If (p_rec.pju_attribute11 = hr_api.g_varchar2) then
488     p_rec.pju_attribute11 :=
489     per_pju_shd.g_old_rec.pju_attribute11;
490   End If;
491   If (p_rec.pju_attribute12 = hr_api.g_varchar2) then
492     p_rec.pju_attribute12 :=
493     per_pju_shd.g_old_rec.pju_attribute12;
494   End If;
495   If (p_rec.pju_attribute13 = hr_api.g_varchar2) then
496     p_rec.pju_attribute13 :=
497     per_pju_shd.g_old_rec.pju_attribute13;
498   End If;
499   If (p_rec.pju_attribute14 = hr_api.g_varchar2) then
500     p_rec.pju_attribute14 :=
501     per_pju_shd.g_old_rec.pju_attribute14;
502   End If;
503   If (p_rec.pju_attribute15 = hr_api.g_varchar2) then
504     p_rec.pju_attribute15 :=
505     per_pju_shd.g_old_rec.pju_attribute15;
506   End If;
507   If (p_rec.pju_attribute16 = hr_api.g_varchar2) then
508     p_rec.pju_attribute16 :=
509     per_pju_shd.g_old_rec.pju_attribute16;
510   End If;
511   If (p_rec.pju_attribute17 = hr_api.g_varchar2) then
512     p_rec.pju_attribute17 :=
513     per_pju_shd.g_old_rec.pju_attribute17;
514   End If;
515   If (p_rec.pju_attribute18 = hr_api.g_varchar2) then
516     p_rec.pju_attribute18 :=
517     per_pju_shd.g_old_rec.pju_attribute18;
518   End If;
519   If (p_rec.pju_attribute19 = hr_api.g_varchar2) then
520     p_rec.pju_attribute19 :=
521     per_pju_shd.g_old_rec.pju_attribute19;
522   End If;
523   If (p_rec.pju_attribute20 = hr_api.g_varchar2) then
524     p_rec.pju_attribute20 :=
525     per_pju_shd.g_old_rec.pju_attribute20;
526   End If;
527   If (p_rec.pju_information_category = hr_api.g_varchar2) then
528     p_rec.pju_information_category :=
529     per_pju_shd.g_old_rec.pju_information_category;
530   End If;
531   If (p_rec.pju_information1 = hr_api.g_varchar2) then
532     p_rec.pju_information1 :=
533     per_pju_shd.g_old_rec.pju_information1;
534   End If;
535   If (p_rec.pju_information2 = hr_api.g_varchar2) then
536     p_rec.pju_information2 :=
537     per_pju_shd.g_old_rec.pju_information2;
538   End If;
539   If (p_rec.pju_information3 = hr_api.g_varchar2) then
540     p_rec.pju_information3 :=
541     per_pju_shd.g_old_rec.pju_information3;
542   End If;
543   If (p_rec.pju_information4 = hr_api.g_varchar2) then
544     p_rec.pju_information4 :=
545     per_pju_shd.g_old_rec.pju_information4;
546   End If;
547   If (p_rec.pju_information5 = hr_api.g_varchar2) then
548     p_rec.pju_information5 :=
549     per_pju_shd.g_old_rec.pju_information5;
550   End If;
551   If (p_rec.pju_information6 = hr_api.g_varchar2) then
552     p_rec.pju_information6 :=
553     per_pju_shd.g_old_rec.pju_information6;
554   End If;
555   If (p_rec.pju_information7 = hr_api.g_varchar2) then
556     p_rec.pju_information7 :=
557     per_pju_shd.g_old_rec.pju_information7;
558   End If;
559   If (p_rec.pju_information8 = hr_api.g_varchar2) then
560     p_rec.pju_information8 :=
561     per_pju_shd.g_old_rec.pju_information8;
562   End If;
563   If (p_rec.pju_information9 = hr_api.g_varchar2) then
564     p_rec.pju_information9 :=
565     per_pju_shd.g_old_rec.pju_information9;
566   End If;
567   If (p_rec.pju_information10 = hr_api.g_varchar2) then
568     p_rec.pju_information10 :=
569     per_pju_shd.g_old_rec.pju_information10;
570   End If;
571   If (p_rec.pju_information11 = hr_api.g_varchar2) then
572     p_rec.pju_information11 :=
573     per_pju_shd.g_old_rec.pju_information11;
574   End If;
575   If (p_rec.pju_information12 = hr_api.g_varchar2) then
576     p_rec.pju_information12 :=
577     per_pju_shd.g_old_rec.pju_information12;
578   End If;
579   If (p_rec.pju_information13 = hr_api.g_varchar2) then
580     p_rec.pju_information13 :=
581     per_pju_shd.g_old_rec.pju_information13;
582   End If;
583   If (p_rec.pju_information14 = hr_api.g_varchar2) then
584     p_rec.pju_information14 :=
585     per_pju_shd.g_old_rec.pju_information14;
586   End If;
587   If (p_rec.pju_information15 = hr_api.g_varchar2) then
588     p_rec.pju_information15 :=
589     per_pju_shd.g_old_rec.pju_information15;
590   End If;
591   If (p_rec.pju_information16 = hr_api.g_varchar2) then
592     p_rec.pju_information16 :=
593     per_pju_shd.g_old_rec.pju_information16;
594   End If;
595   If (p_rec.pju_information17 = hr_api.g_varchar2) then
596     p_rec.pju_information17 :=
597     per_pju_shd.g_old_rec.pju_information17;
598   End If;
599   If (p_rec.pju_information18 = hr_api.g_varchar2) then
600     p_rec.pju_information18 :=
601     per_pju_shd.g_old_rec.pju_information18;
602   End If;
603   If (p_rec.pju_information19 = hr_api.g_varchar2) then
604     p_rec.pju_information19 :=
605     per_pju_shd.g_old_rec.pju_information19;
606   End If;
607   If (p_rec.pju_information20 = hr_api.g_varchar2) then
608     p_rec.pju_information20 :=
609     per_pju_shd.g_old_rec.pju_information20;
610   End If;
611   --
612 End convert_defs;
613 --
614 -- ----------------------------------------------------------------------------
615 -- |---------------------------------< upd >----------------------------------|
616 -- ----------------------------------------------------------------------------
617 Procedure upd
618   (p_rec                          in out nocopy per_pju_shd.g_rec_type
619   ) is
620 --
621   l_proc  varchar2(72) := g_package||'upd';
622 --
623 Begin
624   hr_utility.set_location('Entering:'||l_proc, 5);
625   --
626   -- We must lock the row which we need to update.
627   --
628   per_pju_shd.lck
629     (p_rec.previous_job_usage_id
630     ,p_rec.object_version_number
631     );
632   --
633   -- 1. During an update system defaults are used to determine if
634   --    arguments have been defaulted or not. We must therefore
635   --    derive the full record structure values to be updated.
636   --
637   -- 2. Call the supporting update validate operations.
638   --
639   convert_defs(p_rec);
640   per_pju_bus.update_validate
641      (p_rec
642      );
643   --
644   -- Call the supporting pre-update operation
645   --
646   per_pju_upd.pre_update(p_rec);
647   --
648   -- Update the row.
649   --
650   per_pju_upd.update_dml(p_rec);
651   --
652   -- Call the supporting post-update operation
653   --
654   per_pju_upd.post_update
655      (p_rec
656      );
657 End upd;
658 --
659 -- ----------------------------------------------------------------------------
660 -- |---------------------------------< upd >----------------------------------|
661 -- ----------------------------------------------------------------------------
662 Procedure upd
663   (p_previous_job_usage_id        in     number
664   ,p_object_version_number        in out nocopy number
665   ,p_assignment_id                in     number    default hr_api.g_number
666   ,p_previous_employer_id         in     number    default hr_api.g_number
667   ,p_previous_job_id              in     number    default hr_api.g_number
668   ,p_start_date                   in     date      default hr_api.g_date
669   ,p_end_date                     in     date      default hr_api.g_date
670   ,p_period_years                 in     number    default hr_api.g_number
671   ,p_period_months                in     number    default hr_api.g_number
672   ,p_period_days                  in     number    default hr_api.g_number
673   ,p_pju_attribute_category       in     varchar2  default hr_api.g_varchar2
674   ,p_pju_attribute1               in     varchar2  default hr_api.g_varchar2
675   ,p_pju_attribute2               in     varchar2  default hr_api.g_varchar2
676   ,p_pju_attribute3               in     varchar2  default hr_api.g_varchar2
677   ,p_pju_attribute4               in     varchar2  default hr_api.g_varchar2
678   ,p_pju_attribute5               in     varchar2  default hr_api.g_varchar2
679   ,p_pju_attribute6               in     varchar2  default hr_api.g_varchar2
680   ,p_pju_attribute7               in     varchar2  default hr_api.g_varchar2
681   ,p_pju_attribute8               in     varchar2  default hr_api.g_varchar2
682   ,p_pju_attribute9               in     varchar2  default hr_api.g_varchar2
683   ,p_pju_attribute10              in     varchar2  default hr_api.g_varchar2
684   ,p_pju_attribute11              in     varchar2  default hr_api.g_varchar2
685   ,p_pju_attribute12              in     varchar2  default hr_api.g_varchar2
686   ,p_pju_attribute13              in     varchar2  default hr_api.g_varchar2
687   ,p_pju_attribute14              in     varchar2  default hr_api.g_varchar2
688   ,p_pju_attribute15              in     varchar2  default hr_api.g_varchar2
689   ,p_pju_attribute16              in     varchar2  default hr_api.g_varchar2
690   ,p_pju_attribute17              in     varchar2  default hr_api.g_varchar2
691   ,p_pju_attribute18              in     varchar2  default hr_api.g_varchar2
692   ,p_pju_attribute19              in     varchar2  default hr_api.g_varchar2
693   ,p_pju_attribute20              in     varchar2  default hr_api.g_varchar2
694   ,p_pju_information_category     in     varchar2  default hr_api.g_varchar2
695   ,p_pju_information1             in     varchar2  default hr_api.g_varchar2
696   ,p_pju_information2             in     varchar2  default hr_api.g_varchar2
697   ,p_pju_information3             in     varchar2  default hr_api.g_varchar2
698   ,p_pju_information4             in     varchar2  default hr_api.g_varchar2
699   ,p_pju_information5             in     varchar2  default hr_api.g_varchar2
700   ,p_pju_information6             in     varchar2  default hr_api.g_varchar2
701   ,p_pju_information7             in     varchar2  default hr_api.g_varchar2
702   ,p_pju_information8             in     varchar2  default hr_api.g_varchar2
703   ,p_pju_information9             in     varchar2  default hr_api.g_varchar2
704   ,p_pju_information10            in     varchar2  default hr_api.g_varchar2
705   ,p_pju_information11            in     varchar2  default hr_api.g_varchar2
706   ,p_pju_information12            in     varchar2  default hr_api.g_varchar2
707   ,p_pju_information13            in     varchar2  default hr_api.g_varchar2
708   ,p_pju_information14            in     varchar2  default hr_api.g_varchar2
709   ,p_pju_information15            in     varchar2  default hr_api.g_varchar2
710   ,p_pju_information16            in     varchar2  default hr_api.g_varchar2
711   ,p_pju_information17            in     varchar2  default hr_api.g_varchar2
712   ,p_pju_information18            in     varchar2  default hr_api.g_varchar2
713   ,p_pju_information19            in     varchar2  default hr_api.g_varchar2
714   ,p_pju_information20            in     varchar2  default hr_api.g_varchar2
715   ) is
716 --
717   l_rec   per_pju_shd.g_rec_type;
718   l_proc  varchar2(72) := g_package||'upd';
719 --
720 Begin
721   hr_utility.set_location('Entering:'||l_proc, 5);
722   --
723   -- Call conversion function to turn arguments into the
724   -- l_rec structure.
725   --
726   l_rec :=
727   per_pju_shd.convert_args
728   (p_previous_job_usage_id
729   ,p_assignment_id
730   ,p_previous_employer_id
731   ,p_previous_job_id
732   ,p_start_date
733   ,p_end_date
734   ,p_period_years
735   ,p_period_months
736   ,p_period_days
737   ,p_pju_attribute_category
738   ,p_pju_attribute1
739   ,p_pju_attribute2
740   ,p_pju_attribute3
741   ,p_pju_attribute4
742   ,p_pju_attribute5
743   ,p_pju_attribute6
744   ,p_pju_attribute7
745   ,p_pju_attribute8
746   ,p_pju_attribute9
747   ,p_pju_attribute10
748   ,p_pju_attribute11
749   ,p_pju_attribute12
750   ,p_pju_attribute13
751   ,p_pju_attribute14
752   ,p_pju_attribute15
753   ,p_pju_attribute16
754   ,p_pju_attribute17
755   ,p_pju_attribute18
756   ,p_pju_attribute19
757   ,p_pju_attribute20
758   ,p_pju_information_category
759   ,p_pju_information1
760   ,p_pju_information2
761   ,p_pju_information3
762   ,p_pju_information4
763   ,p_pju_information5
764   ,p_pju_information6
765   ,p_pju_information7
766   ,p_pju_information8
767   ,p_pju_information9
768   ,p_pju_information10
769   ,p_pju_information11
770   ,p_pju_information12
771   ,p_pju_information13
772   ,p_pju_information14
773   ,p_pju_information15
774   ,p_pju_information16
775   ,p_pju_information17
776   ,p_pju_information18
777   ,p_pju_information19
778   ,p_pju_information20
779   ,p_object_version_number
780   );
781   --
782   -- Having converted the arguments into the
783   -- plsql record structure we call the corresponding record
784   -- business process.
785   --
786   per_pju_upd.upd
787      (l_rec
788      );
789   p_object_version_number := l_rec.object_version_number;
790   --
791   hr_utility.set_location(' Leaving:'||l_proc, 10);
792 End upd;
793 --
794 end per_pju_upd;