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