DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_VAC_UPD

Source


1 Package Body per_vac_upd as
2 /* $Header: pevacrhi.pkb 120.2 2010/12/24 11:51:11 avarri ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  per_vac_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_vac_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   per_vac_shd.g_api_dml := true;  -- Set the dml status
67   --
68   -- Update the per_all_vacancies Row
69   --
70   update per_all_vacancies
71     set
72      vacancy_id                      = p_rec.vacancy_id
73     ,business_group_id               = p_rec.business_group_id
74     ,position_id                     = p_rec.position_id
75     ,job_id                          = p_rec.job_id
76     ,grade_id                        = p_rec.grade_id
77     ,organization_id                 = p_rec.organization_id
78     ,requisition_id                  = p_rec.requisition_id
79     ,people_group_id                 = p_rec.people_group_id
80     ,location_id                     = p_rec.location_id
81     ,recruiter_id                    = p_rec.recruiter_id
82     ,date_from                       = p_rec.date_from
83     ,name                            = p_rec.name
84     ,comments                        = p_rec.comments
85     ,date_to                         = p_rec.date_to
86     ,description                     = p_rec.description
87     ,number_of_openings              = p_rec.number_of_openings
88     ,status                          = p_rec.status
89     ,request_id                      = p_rec.request_id
90     ,program_application_id          = p_rec.program_application_id
91     ,program_id                      = p_rec.program_id
92     ,program_update_date             = p_rec.program_update_date
93     ,attribute_category              = p_rec.attribute_category
94     ,attribute1                      = p_rec.attribute1
95     ,attribute2                      = p_rec.attribute2
96     ,attribute3                      = p_rec.attribute3
97     ,attribute4                      = p_rec.attribute4
98     ,attribute5                      = p_rec.attribute5
99     ,attribute6                      = p_rec.attribute6
100     ,attribute7                      = p_rec.attribute7
101     ,attribute8                      = p_rec.attribute8
102     ,attribute9                      = p_rec.attribute9
103     ,attribute10                     = p_rec.attribute10
104     ,attribute11                     = p_rec.attribute11
105     ,attribute12                     = p_rec.attribute12
106     ,attribute13                     = p_rec.attribute13
107     ,attribute14                     = p_rec.attribute14
108     ,attribute15                     = p_rec.attribute15
109     ,attribute16                     = p_rec.attribute16
110     ,attribute17                     = p_rec.attribute17
111     ,attribute18                     = p_rec.attribute18
112     ,attribute19                     = p_rec.attribute19
113     ,attribute20                     = p_rec.attribute20
114     ,vacancy_category                = p_rec.vacancy_category
115     ,vacancy_region_type             = p_rec.vacancy_region_type
116     ,budget_measurement_type         = p_rec.budget_measurement_type
117     ,budget_measurement_value        = p_rec.budget_measurement_value
118     ,manager_id                      = p_rec.manager_id
119     ,security_method                 = p_rec.security_method
120     ,primary_posting_id              = p_rec.primary_posting_id
121     ,assessment_id                   = p_rec.assessment_id
122     ,object_version_number           = p_rec.object_version_number
123     where vacancy_id = p_rec.vacancy_id;
124   --
125   --
126   --
127   hr_utility.set_location(' Leaving:'||l_proc, 10);
128 --
129 Exception
130   When hr_api.check_integrity_violated then
131     -- A check constraint has been violated
132     per_vac_shd.g_api_dml := false;  -- Unset the dml status
133     per_vac_shd.constraint_error
134       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
135   When hr_api.parent_integrity_violated then
136     -- Parent integrity has been violated
137     per_vac_shd.g_api_dml := false;  -- Unset the dml status
138     per_vac_shd.constraint_error
139       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
140   When hr_api.unique_integrity_violated then
141     -- Unique integrity has been violated
142     per_vac_shd.g_api_dml := false;  -- Unset the dml status
143     per_vac_shd.constraint_error
144       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
145   When Others then
146     per_vac_shd.g_api_dml := false;  -- Unset the dml status
147     Raise;
148 End update_dml;
149 --
150 -- ----------------------------------------------------------------------------
151 -- |------------------------------< pre_update >------------------------------|
152 -- ----------------------------------------------------------------------------
153 -- {Start Of Comments}
154 --
155 -- Description:
156 --   This private procedure contains any processing which is required before
157 --   the update dml.
158 --
159 -- Prerequisites:
160 --   This is an internal procedure which is called from the upd procedure.
161 --
162 -- In Parameters:
163 --   A Pl/Sql record structure.
164 --
165 -- Post Success:
166 --   Processing continues.
167 --
168 -- Post Failure:
169 --   if an error has occurred, an error message and exception wil be raised
170 --   but not handled.
171 --
172 -- Developer Implementation Notes:
173 --   Any pre-processing required before the update dml is issued should be
174 --   coded within this procedure. It is important to note that any 3rd party
175 --   maintenance should be reviewed before placing in this procedure.
176 --
177 -- Access Status:
178 --   Internal Row Handler Use Only.
179 --
180 -- {End Of Comments}
181 -- ----------------------------------------------------------------------------
182 Procedure pre_update
183   (p_rec in per_vac_shd.g_rec_type
184   ) is
185 --
186   l_proc  varchar2(72) := g_package||'pre_update';
187 --
188 Begin
189   hr_utility.set_location('Entering:'||l_proc, 5);
190   --
191   hr_utility.set_location(' Leaving:'||l_proc, 10);
192 End pre_update;
193 --
194 -- ----------------------------------------------------------------------------
195 -- |-----------------------------< post_update >------------------------------|
196 -- ----------------------------------------------------------------------------
197 -- {Start Of Comments}
198 --
199 -- Description:
200 --   This private procedure contains any processing which is required after
201 --   the update dml.
202 --
203 -- Prerequisites:
204 --   This is an internal procedure which is called from the upd procedure.
205 --
206 -- In Parameters:
207 --   A Pl/Sql record structure.
208 --
209 -- Post Success:
210 --   Processing continues.
211 --
212 -- Post Failure:
213 --   if an error has occurred, an error message and exception will be raised
214 --   but not handled.
215 --
216 -- Developer Implementation Notes:
217 --   Any post-processing required after the update dml is issued should be
218 --   coded within this procedure. It is important to note that any 3rd party
219 --   maintenance should be reviewed before placing in this procedure.
220 --
221 -- Access Status:
222 --   Internal Row Handler Use Only.
223 --
224 -- {End Of Comments}
225 -- ----------------------------------------------------------------------------
226 Procedure post_update
227   (p_rec                          in per_vac_shd.g_rec_type
228   ,p_effective_date               in date
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_vac_rku.after_update
238       (p_effective_date
239       => p_effective_date
240       ,p_vacancy_id
241       => p_rec.vacancy_id
242       ,p_business_group_id
243       => p_rec.business_group_id
244       ,p_position_id
245       => p_rec.position_id
246       ,p_job_id
247       => p_rec.job_id
248       ,p_grade_id
249       => p_rec.grade_id
250       ,p_organization_id
251       => p_rec.organization_id
252       ,p_requisition_id
253       => p_rec.requisition_id
254       ,p_people_group_id
255       => p_rec.people_group_id
256       ,p_location_id
257       => p_rec.location_id
258       ,p_recruiter_id
259       => p_rec.recruiter_id
260       ,p_date_from
261       => p_rec.date_from
262       ,p_name
263       => p_rec.name
264       ,p_comments
265       => p_rec.comments
266       ,p_date_to
267       => p_rec.date_to
268       ,p_description
269       => p_rec.description
270       ,p_number_of_openings
271       => p_rec.number_of_openings
272       ,p_status
273       => p_rec.status
274       ,p_request_id
275       => p_rec.request_id
276       ,p_program_application_id
277       => p_rec.program_application_id
278       ,p_program_id
279       => p_rec.program_id
280       ,p_program_update_date
281       => p_rec.program_update_date
282       ,p_attribute_category
283       => p_rec.attribute_category
284       ,p_attribute1
285       => p_rec.attribute1
286       ,p_attribute2
287       => p_rec.attribute2
288       ,p_attribute3
289       => p_rec.attribute3
290       ,p_attribute4
291       => p_rec.attribute4
292       ,p_attribute5
293       => p_rec.attribute5
294       ,p_attribute6
295       => p_rec.attribute6
296       ,p_attribute7
297       => p_rec.attribute7
298       ,p_attribute8
299       => p_rec.attribute8
300       ,p_attribute9
301       => p_rec.attribute9
302       ,p_attribute10
303       => p_rec.attribute10
304       ,p_attribute11
305       => p_rec.attribute11
306       ,p_attribute12
307       => p_rec.attribute12
308       ,p_attribute13
309       => p_rec.attribute13
310       ,p_attribute14
311       => p_rec.attribute14
312       ,p_attribute15
313       => p_rec.attribute15
314       ,p_attribute16
315       => p_rec.attribute16
316       ,p_attribute17
317       => p_rec.attribute17
318       ,p_attribute18
319       => p_rec.attribute18
320       ,p_attribute19
321       => p_rec.attribute19
322       ,p_attribute20
323       => p_rec.attribute20
324       ,p_vacancy_category
325       => p_rec.vacancy_category
326       ,p_vacancy_region_type
327       => p_rec.vacancy_region_type
328       ,p_budget_measurement_type
329       => p_rec.budget_measurement_type
330       ,p_budget_measurement_value
331       => p_rec.budget_measurement_value
332       ,p_manager_id
333       => p_rec.manager_id
334       ,p_security_method
335       => p_rec.security_method
336       ,p_primary_posting_id
337       => p_rec.primary_posting_id
338       ,p_assessment_id
339       => p_rec.assessment_id
340       ,p_object_version_number
341       => p_rec.object_version_number
342       ,p_position_id_o
343       => per_vac_shd.g_old_rec.position_id
344       ,p_job_id_o
345       => per_vac_shd.g_old_rec.job_id
346       ,p_grade_id_o
347       => per_vac_shd.g_old_rec.grade_id
348       ,p_organization_id_o
349       => per_vac_shd.g_old_rec.organization_id
350       ,p_requisition_id_o
351       => per_vac_shd.g_old_rec.requisition_id
352       ,p_people_group_id_o
353       => per_vac_shd.g_old_rec.people_group_id
354       ,p_location_id_o
355       => per_vac_shd.g_old_rec.location_id
356       ,p_recruiter_id_o
357       => per_vac_shd.g_old_rec.recruiter_id
358       ,p_date_from_o
359       => per_vac_shd.g_old_rec.date_from
360       ,p_comments_o
361       => per_vac_shd.g_old_rec.comments
362       ,p_date_to_o
363       => per_vac_shd.g_old_rec.date_to
364       ,p_description_o
365       => per_vac_shd.g_old_rec.description
366       ,p_number_of_openings_o
367       => per_vac_shd.g_old_rec.number_of_openings
368       ,p_status_o
369       => per_vac_shd.g_old_rec.status
370       ,p_request_id_o
371       => per_vac_shd.g_old_rec.request_id
372       ,p_program_application_id_o
373       => per_vac_shd.g_old_rec.program_application_id
374       ,p_program_id_o
375       => per_vac_shd.g_old_rec.program_id
376       ,p_program_update_date_o
377       => per_vac_shd.g_old_rec.program_update_date
378       ,p_attribute_category_o
379       => per_vac_shd.g_old_rec.attribute_category
380       ,p_attribute1_o
381       => per_vac_shd.g_old_rec.attribute1
382       ,p_attribute2_o
383       => per_vac_shd.g_old_rec.attribute2
384       ,p_attribute3_o
385       => per_vac_shd.g_old_rec.attribute3
386       ,p_attribute4_o
387       => per_vac_shd.g_old_rec.attribute4
388       ,p_attribute5_o
389       => per_vac_shd.g_old_rec.attribute5
390       ,p_attribute6_o
391       => per_vac_shd.g_old_rec.attribute6
392       ,p_attribute7_o
393       => per_vac_shd.g_old_rec.attribute7
394       ,p_attribute8_o
395       => per_vac_shd.g_old_rec.attribute8
396       ,p_attribute9_o
397       => per_vac_shd.g_old_rec.attribute9
398       ,p_attribute10_o
399       => per_vac_shd.g_old_rec.attribute10
400       ,p_attribute11_o
401       => per_vac_shd.g_old_rec.attribute11
402       ,p_attribute12_o
403       => per_vac_shd.g_old_rec.attribute12
404       ,p_attribute13_o
405       => per_vac_shd.g_old_rec.attribute13
406       ,p_attribute14_o
407       => per_vac_shd.g_old_rec.attribute14
408       ,p_attribute15_o
409       => per_vac_shd.g_old_rec.attribute15
410       ,p_attribute16_o
411       => per_vac_shd.g_old_rec.attribute16
412       ,p_attribute17_o
413       => per_vac_shd.g_old_rec.attribute17
414       ,p_attribute18_o
415       => per_vac_shd.g_old_rec.attribute18
416       ,p_attribute19_o
417       => per_vac_shd.g_old_rec.attribute19
418       ,p_attribute20_o
419       => per_vac_shd.g_old_rec.attribute20
420       ,p_vacancy_category_o
421       => per_vac_shd.g_old_rec.vacancy_category
422       ,p_vacancy_region_type_o
423       => per_vac_shd.g_old_rec.vacancy_region_type
424       ,p_budget_measurement_type_o
425       => per_vac_shd.g_old_rec.budget_measurement_type
426       ,p_budget_measurement_value_o
427       => per_vac_shd.g_old_rec.budget_measurement_value
428       ,p_manager_id_o
429       => per_vac_shd.g_old_rec.manager_id
430       ,p_security_method_o
431       => per_vac_shd.g_old_rec.security_method
432       ,p_primary_posting_id_o
433       => per_vac_shd.g_old_rec.primary_posting_id
434       ,p_assessment_id_o
435       => per_vac_shd.g_old_rec.assessment_id
436       ,p_object_version_number_o
437       => per_vac_shd.g_old_rec.object_version_number
438       );
439     --
440   exception
441     --
442     when hr_api.cannot_find_prog_unit then
443       --
444       hr_api.cannot_find_prog_unit_error
445         (p_module_name => 'PER_ALL_VACANCIES'
446         ,p_hook_type   => 'AU');
447       --
448   end;
449   --
450   hr_utility.set_location(' Leaving:'||l_proc, 10);
451 End post_update;
452 --
453 -- ----------------------------------------------------------------------------
454 -- |-----------------------------< convert_defs >-----------------------------|
455 -- ----------------------------------------------------------------------------
456 -- {Start Of Comments}
457 --
458 -- Description:
459 --   The Convert_Defs procedure has one very important function:
460 --   It must return the record structure for the row with all system defaulted
461 --   values converted into its corresponding parameter value for update. When
462 --   we attempt to update a row through the Upd process , certain
463 --   parameters can be defaulted which enables flexibility in the calling of
464 --   the upd process (e.g. only attributes which need to be updated need to be
465 --   specified). For the upd process to determine which attributes
466 --   have not been specified we need to check if the parameter has a reserved
467 --   system default value. Therefore, for all parameters which have a
468 --   corresponding reserved system default mechanism specified we need to
469 --   check if a system default is being used. if a system default is being
470 --   used then we convert the defaulted value into its corresponding attribute
471 --   value held in the g_old_rec data structure.
472 --
473 -- Prerequisites:
474 --   This private function can only be called from the upd process.
475 --
476 -- In Parameters:
477 --   A Pl/Sql record structure.
478 --
479 -- Post Success:
480 --   The record structure will be returned with all system defaulted parameter
481 --   values converted into its current row attribute value.
482 --
483 -- Post Failure:
484 --   No direct error handling is required within this function. Any possible
485 --   errors within this procedure will be a PL/SQL value error due to
486 --   conversion of datatypes or data lengths.
487 --
488 -- Developer Implementation Notes:
489 --   None.
490 --
491 -- Access Status:
492 --   Internal Row Handler Use Only.
493 --
494 -- {End Of Comments}
495 -- ----------------------------------------------------------------------------
496 Procedure convert_defs
497   (p_rec in out nocopy per_vac_shd.g_rec_type
498   ) is
499 --
500 Begin
501   --
502   -- We must now examine each argument value in the
503   -- p_rec plsql record structure
504   -- to see if a system default is being used. if a system default
505   -- is being used then we must set to the 'current' argument value.
506   --
507   if (p_rec.business_group_id = hr_api.g_number) then
508     p_rec.business_group_id :=
509     per_vac_shd.g_old_rec.business_group_id;
510   end if;
511   if (p_rec.position_id = hr_api.g_number) then
512     p_rec.position_id :=
513     per_vac_shd.g_old_rec.position_id;
514   end if;
515   if (p_rec.job_id = hr_api.g_number) then
516     p_rec.job_id :=
517     per_vac_shd.g_old_rec.job_id;
518   end if;
519   if (p_rec.grade_id = hr_api.g_number) then
520     p_rec.grade_id :=
521     per_vac_shd.g_old_rec.grade_id;
522   end if;
523   if (p_rec.organization_id = hr_api.g_number) then
524     p_rec.organization_id :=
525     per_vac_shd.g_old_rec.organization_id;
526   end if;
527   if (p_rec.requisition_id = hr_api.g_number) then
528     p_rec.requisition_id :=
529     per_vac_shd.g_old_rec.requisition_id;
530   end if;
531   if (p_rec.people_group_id = hr_api.g_number) then
532     p_rec.people_group_id :=
533     per_vac_shd.g_old_rec.people_group_id;
534   end if;
535   if (p_rec.location_id = hr_api.g_number) then
536     p_rec.location_id :=
537     per_vac_shd.g_old_rec.location_id;
538   end if;
539   if (p_rec.recruiter_id = hr_api.g_number) then
540     p_rec.recruiter_id :=
541     per_vac_shd.g_old_rec.recruiter_id;
542   end if;
543   if (p_rec.date_from = hr_api.g_date) then
544     p_rec.date_from :=
545     per_vac_shd.g_old_rec.date_from;
546   end if;
547   if (p_rec.name = hr_api.g_varchar2) then
548     p_rec.name :=
549     per_vac_shd.g_old_rec.name;
550   end if;
551   if (p_rec.comments = hr_api.g_varchar2) then
552     p_rec.comments :=
553     per_vac_shd.g_old_rec.comments;
554   end if;
555   if (p_rec.date_to = hr_api.g_date) then
556     p_rec.date_to :=
557     per_vac_shd.g_old_rec.date_to;
558   end if;
559   if (p_rec.description = hr_api.g_varchar2) then
560     p_rec.description :=
561     per_vac_shd.g_old_rec.description;
562   end if;
563   if (p_rec.number_of_openings = hr_api.g_number) then
564     p_rec.number_of_openings :=
565     per_vac_shd.g_old_rec.number_of_openings;
566   end if;
567   if (p_rec.status = hr_api.g_varchar2) then
568     p_rec.status :=
569     per_vac_shd.g_old_rec.status;
570   end if;
571   if (p_rec.request_id = hr_api.g_number) then
572     p_rec.request_id :=
573     per_vac_shd.g_old_rec.request_id;
574   end if;
575   if (p_rec.program_application_id = hr_api.g_number) then
576     p_rec.program_application_id :=
577     per_vac_shd.g_old_rec.program_application_id;
578   end if;
579   if (p_rec.program_id = hr_api.g_number) then
580     p_rec.program_id :=
581     per_vac_shd.g_old_rec.program_id;
582   end if;
583   if (p_rec.program_update_date = hr_api.g_date) then
584     p_rec.program_update_date :=
585     per_vac_shd.g_old_rec.program_update_date;
586   end if;
587   if (p_rec.attribute_category = hr_api.g_varchar2) then
588     p_rec.attribute_category :=
589     per_vac_shd.g_old_rec.attribute_category;
590   end if;
591   if (p_rec.attribute1 = hr_api.g_varchar2) then
592     p_rec.attribute1 :=
593     per_vac_shd.g_old_rec.attribute1;
594   end if;
595   if (p_rec.attribute2 = hr_api.g_varchar2) then
596     p_rec.attribute2 :=
597     per_vac_shd.g_old_rec.attribute2;
598   end if;
599   if (p_rec.attribute3 = hr_api.g_varchar2) then
600     p_rec.attribute3 :=
601     per_vac_shd.g_old_rec.attribute3;
602   end if;
603   if (p_rec.attribute4 = hr_api.g_varchar2) then
604     p_rec.attribute4 :=
605     per_vac_shd.g_old_rec.attribute4;
606   end if;
607   if (p_rec.attribute5 = hr_api.g_varchar2) then
608     p_rec.attribute5 :=
609     per_vac_shd.g_old_rec.attribute5;
610   end if;
611   if (p_rec.attribute6 = hr_api.g_varchar2) then
612     p_rec.attribute6 :=
613     per_vac_shd.g_old_rec.attribute6;
614   end if;
615   if (p_rec.attribute7 = hr_api.g_varchar2) then
616     p_rec.attribute7 :=
617     per_vac_shd.g_old_rec.attribute7;
618   end if;
619   if (p_rec.attribute8 = hr_api.g_varchar2) then
620     p_rec.attribute8 :=
621     per_vac_shd.g_old_rec.attribute8;
622   end if;
623   if (p_rec.attribute9 = hr_api.g_varchar2) then
624     p_rec.attribute9 :=
625     per_vac_shd.g_old_rec.attribute9;
626   end if;
627   if (p_rec.attribute10 = hr_api.g_varchar2) then
628     p_rec.attribute10 :=
629     per_vac_shd.g_old_rec.attribute10;
630   end if;
631   if (p_rec.attribute11 = hr_api.g_varchar2) then
632     p_rec.attribute11 :=
633     per_vac_shd.g_old_rec.attribute11;
634   end if;
635   if (p_rec.attribute12 = hr_api.g_varchar2) then
636     p_rec.attribute12 :=
637     per_vac_shd.g_old_rec.attribute12;
638   end if;
639   if (p_rec.attribute13 = hr_api.g_varchar2) then
640     p_rec.attribute13 :=
641     per_vac_shd.g_old_rec.attribute13;
642   end if;
643   if (p_rec.attribute14 = hr_api.g_varchar2) then
644     p_rec.attribute14 :=
645     per_vac_shd.g_old_rec.attribute14;
646   end if;
647   if (p_rec.attribute15 = hr_api.g_varchar2) then
648     p_rec.attribute15 :=
649     per_vac_shd.g_old_rec.attribute15;
650   end if;
651   if (p_rec.attribute16 = hr_api.g_varchar2) then
652     p_rec.attribute16 :=
653     per_vac_shd.g_old_rec.attribute16;
654   end if;
655   if (p_rec.attribute17 = hr_api.g_varchar2) then
656     p_rec.attribute17 :=
657     per_vac_shd.g_old_rec.attribute17;
658   end if;
659   if (p_rec.attribute18 = hr_api.g_varchar2) then
660     p_rec.attribute18 :=
661     per_vac_shd.g_old_rec.attribute18;
662   end if;
663   if (p_rec.attribute19 = hr_api.g_varchar2) then
664     p_rec.attribute19 :=
665     per_vac_shd.g_old_rec.attribute19;
666   end if;
667   if (p_rec.attribute20 = hr_api.g_varchar2) then
668     p_rec.attribute20 :=
669     per_vac_shd.g_old_rec.attribute20;
670   end if;
671   if (p_rec.vacancy_category = hr_api.g_varchar2) then
672     p_rec.vacancy_category :=
673     per_vac_shd.g_old_rec.vacancy_category;
674   end if;
675   if (p_rec.vacancy_region_type = hr_api.g_varchar2) then
676     p_rec.vacancy_region_type :=
677     per_vac_shd.g_old_rec.vacancy_region_type;
678   end if;
679   if (p_rec.budget_measurement_type = hr_api.g_varchar2) then
680     p_rec.budget_measurement_type :=
681     per_vac_shd.g_old_rec.budget_measurement_type;
682   end if;
683   if (p_rec.budget_measurement_value = hr_api.g_number) then
684     p_rec.budget_measurement_value :=
685     per_vac_shd.g_old_rec.budget_measurement_value;
686   end if;
687   if (p_rec.manager_id = hr_api.g_number) then
688     p_rec.manager_id :=
689     per_vac_shd.g_old_rec.manager_id;
690   end if;
691   if (p_rec.security_method = hr_api.g_varchar2) then
692     p_rec.security_method :=
693     per_vac_shd.g_old_rec.security_method;
694   end if;
695   if (p_rec.primary_posting_id = hr_api.g_number) then
696     p_rec.primary_posting_id :=
697     per_vac_shd.g_old_rec.primary_posting_id;
698   end if;
699   if (p_rec.assessment_id = hr_api.g_number) then
700     p_rec.assessment_id :=
701     per_vac_shd.g_old_rec.assessment_id;
702   end if;
703   --
704 End convert_defs;
705 --
706 -- ----------------------------------------------------------------------------
707 -- |---------------------------------< upd >----------------------------------|
708 -- ----------------------------------------------------------------------------
709 Procedure upd
710   (p_rec                          in out nocopy per_vac_shd.g_rec_type
711   ,p_effective_date               in            date
712   ,p_inv_pos_grade_warning           out nocopy boolean
713   ,p_inv_job_grade_warning           out nocopy boolean
714   ) is
715 --
716   l_proc  varchar2(72) := g_package||'upd';
717 --
718 Begin
719   hr_utility.set_location('Entering:'||l_proc, 5);
720   --
721   -- We must lock the row which we need to update.
722   --
723   per_vac_shd.lck
724     (p_rec.vacancy_id
725     ,p_rec.object_version_number
726     );
727   --
728   -- 1. During an update system defaults are used to determine if
729   --    arguments have been defaulted or not. We must therefore
730   --    derive the full record structure values to be updated.
731   --
732   -- 2. Call the supporting update validate operations.
733   --
734   convert_defs(p_rec);
735   per_vac_bus.update_validate
736      (p_rec                   => p_rec
737      ,p_effective_date        => p_effective_date
738      ,p_inv_pos_grade_warning => p_inv_pos_grade_warning
739      ,p_inv_job_grade_warning => p_inv_job_grade_warning
740 
741      );
742   --
743   -- Call the supporting pre-update operation
744   --
745   per_vac_upd.pre_update(p_rec);
746   --
747   -- Update the row.
748   --
749   per_vac_upd.update_dml(p_rec);
750   --
751   -- Call the supporting post-update operation
752   --
753   per_vac_upd.post_update
754      (p_rec
755      ,p_effective_date
756      );
757   hr_multi_message.end_validation_set();
758 End upd;
759 --
760 -- ----------------------------------------------------------------------------
761 -- |---------------------------------< upd >----------------------------------|
762 -- ----------------------------------------------------------------------------
763 Procedure upd
764   (p_effective_date               in     date
765   ,p_vacancy_id                   in     number
766   ,p_object_version_number        in out nocopy number
767   ,p_business_group_id            in     number    default hr_api.g_number
768   ,p_requisition_id               in     number    default hr_api.g_number
769   ,p_date_from                    in     date      default hr_api.g_date
770   ,p_name                         in     varchar2  default hr_api.g_varchar2
771   ,p_position_id                  in     number    default hr_api.g_number
772   ,p_job_id                       in     number    default hr_api.g_number
773   ,p_grade_id                     in     number    default hr_api.g_number
774   ,p_organization_id              in     number    default hr_api.g_number
775   ,p_people_group_id              in     number    default hr_api.g_number
776   ,p_location_id                  in     number    default hr_api.g_number
777   ,p_recruiter_id                 in     number    default hr_api.g_number
778   ,p_comments                     in     varchar2  default hr_api.g_varchar2
779   ,p_date_to                      in     date      default hr_api.g_date
780   ,p_description                  in     varchar2  default hr_api.g_varchar2
781   ,p_number_of_openings           in     number    default hr_api.g_number
782   ,p_status                       in     varchar2  default hr_api.g_varchar2
783   ,p_request_id                   in     number    default hr_api.g_number
784   ,p_program_application_id       in     number    default hr_api.g_number
785   ,p_program_id                   in     number    default hr_api.g_number
786   ,p_program_update_date          in     date      default hr_api.g_date
787   ,p_attribute_category           in     varchar2  default hr_api.g_varchar2
788   ,p_attribute1                   in     varchar2  default hr_api.g_varchar2
789   ,p_attribute2                   in     varchar2  default hr_api.g_varchar2
790   ,p_attribute3                   in     varchar2  default hr_api.g_varchar2
791   ,p_attribute4                   in     varchar2  default hr_api.g_varchar2
792   ,p_attribute5                   in     varchar2  default hr_api.g_varchar2
793   ,p_attribute6                   in     varchar2  default hr_api.g_varchar2
794   ,p_attribute7                   in     varchar2  default hr_api.g_varchar2
795   ,p_attribute8                   in     varchar2  default hr_api.g_varchar2
796   ,p_attribute9                   in     varchar2  default hr_api.g_varchar2
797   ,p_attribute10                  in     varchar2  default hr_api.g_varchar2
798   ,p_attribute11                  in     varchar2  default hr_api.g_varchar2
799   ,p_attribute12                  in     varchar2  default hr_api.g_varchar2
800   ,p_attribute13                  in     varchar2  default hr_api.g_varchar2
801   ,p_attribute14                  in     varchar2  default hr_api.g_varchar2
802   ,p_attribute15                  in     varchar2  default hr_api.g_varchar2
803   ,p_attribute16                  in     varchar2  default hr_api.g_varchar2
804   ,p_attribute17                  in     varchar2  default hr_api.g_varchar2
805   ,p_attribute18                  in     varchar2  default hr_api.g_varchar2
806   ,p_attribute19                  in     varchar2  default hr_api.g_varchar2
807   ,p_attribute20                  in     varchar2  default hr_api.g_varchar2
808   ,p_vacancy_category             in     varchar2  default hr_api.g_varchar2
809   ,p_vacancy_region_type          in     varchar2  default hr_api.g_varchar2
810   ,p_budget_measurement_type      in     varchar2  default hr_api.g_varchar2
811   ,p_budget_measurement_value     in     number    default hr_api.g_number
812   ,p_manager_id                   in     number    default hr_api.g_number
813   ,p_security_method              in     varchar2  default hr_api.g_varchar2
814   ,p_primary_posting_id           in     number    default hr_api.g_number
815   ,p_assessment_id                in     number    default hr_api.g_number
816   ,p_inv_pos_grade_warning           out nocopy boolean
817   ,p_inv_job_grade_warning           out nocopy boolean
818   ) is
819 --
820   l_rec   per_vac_shd.g_rec_type;
821   l_proc  varchar2(72) := g_package||'upd';
822 --
823 Begin
824   hr_utility.set_location('Entering:'||l_proc, 5);
825   --
826   -- Call conversion function to turn arguments into the
827   -- l_rec structure.
828   --
829   l_rec :=
830   per_vac_shd.convert_args
831   (p_vacancy_id
832   ,p_business_group_id
833   ,p_position_id
834   ,p_job_id
835   ,p_grade_id
836   ,p_organization_id
837   ,p_requisition_id
838   ,p_people_group_id
839   ,p_location_id
840   ,p_recruiter_id
841   ,p_date_from
842   ,p_name
843   ,p_comments
844   ,p_date_to
845   ,p_description
846   ,p_number_of_openings
847   ,p_status
848   ,p_request_id
849   ,p_program_application_id
850   ,p_program_id
851   ,p_program_update_date
852   ,p_attribute_category
853   ,p_attribute1
854   ,p_attribute2
855   ,p_attribute3
856   ,p_attribute4
857   ,p_attribute5
858   ,p_attribute6
859   ,p_attribute7
860   ,p_attribute8
861   ,p_attribute9
862   ,p_attribute10
863   ,p_attribute11
864   ,p_attribute12
865   ,p_attribute13
866   ,p_attribute14
867   ,p_attribute15
868   ,p_attribute16
869   ,p_attribute17
870   ,p_attribute18
871   ,p_attribute19
872   ,p_attribute20
873   ,p_vacancy_category
874   ,p_vacancy_region_type
875   ,p_budget_measurement_type
876   ,p_budget_measurement_value
877   ,p_manager_id
878   ,p_security_method
879   ,p_primary_posting_id
880   ,p_assessment_id
881   ,p_object_version_number
882   );
883   --
884   -- Having converted the arguments into the
885   -- plsql record structure we call the corresponding record
886   -- business process.
887   --
888   per_vac_upd.upd
889      (p_rec => l_rec
890      ,p_effective_date        => p_effective_date
891      ,p_inv_pos_grade_warning => p_inv_pos_grade_warning
892      ,p_inv_job_grade_warning => p_inv_job_grade_warning
893      );
894   p_object_version_number := l_rec.object_version_number;
895   --
896   hr_utility.set_location(' Leaving:'||l_proc, 10);
897 End upd;
898 --
899 end per_vac_upd;