1 Package Body per_dpf_upd as
2 /* $Header: pedpfrhi.pkb 115.13 2002/12/05 10:20:52 pkakar ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' per_dpf_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(p_rec in out nocopy per_dpf_shd.g_rec_type) is
55 --
56 l_proc varchar2(72) := g_package||'update_dml';
57 --
58 Begin
59 hr_utility.set_location('Entering:'||l_proc, 5);
60 --
61 -- Increment the object version
62 --
63 p_rec.object_version_number := p_rec.object_version_number + 1;
64 --
65 per_dpf_shd.g_api_dml := true; -- Set the api dml status
66 --
67 -- Update the per_deployment_factors Row
68 --
69 update per_deployment_factors
70 set
71 deployment_factor_id = p_rec.deployment_factor_id,
72 position_id = p_rec.position_id,
73 person_id = p_rec.person_id,
74 job_id = p_rec.job_id,
75 business_group_id = p_rec.business_group_id,
76 work_any_country = p_rec.work_any_country,
77 work_any_location = p_rec.work_any_location,
78 relocate_domestically = p_rec.relocate_domestically,
79 relocate_internationally = p_rec.relocate_internationally,
80 travel_required = p_rec.travel_required,
81 country1 = p_rec.country1,
82 country2 = p_rec.country2,
83 country3 = p_rec.country3,
84 work_duration = p_rec.work_duration,
85 work_schedule = p_rec.work_schedule,
86 work_hours = p_rec.work_hours,
87 fte_capacity = p_rec.fte_capacity,
88 visit_internationally = p_rec.visit_internationally,
89 only_current_location = p_rec.only_current_location,
90 no_country1 = p_rec.no_country1,
91 no_country2 = p_rec.no_country2,
92 no_country3 = p_rec.no_country3,
93 comments = p_rec.comments,
94 earliest_available_date = p_rec.earliest_available_date,
95 available_for_transfer = p_rec.available_for_transfer,
96 relocation_preference = p_rec.relocation_preference,
97 relocation_required = p_rec.relocation_required,
98 passport_required = p_rec.passport_required,
99 location1 = p_rec.location1,
100 location2 = p_rec.location2,
101 location3 = p_rec.location3,
102 other_requirements = p_rec.other_requirements,
103 service_minimum = p_rec.service_minimum,
104 object_version_number = p_rec.object_version_number,
105 attribute_category = p_rec.attribute_category,
106 attribute1 = p_rec.attribute1,
107 attribute2 = p_rec.attribute2,
108 attribute3 = p_rec.attribute3,
109 attribute4 = p_rec.attribute4,
110 attribute5 = p_rec.attribute5,
111 attribute6 = p_rec.attribute6,
112 attribute7 = p_rec.attribute7,
113 attribute8 = p_rec.attribute8,
114 attribute9 = p_rec.attribute9,
115 attribute10 = p_rec.attribute10,
116 attribute11 = p_rec.attribute11,
117 attribute12 = p_rec.attribute12,
118 attribute13 = p_rec.attribute13,
119 attribute14 = p_rec.attribute14,
120 attribute15 = p_rec.attribute15,
121 attribute16 = p_rec.attribute16,
122 attribute17 = p_rec.attribute17,
123 attribute18 = p_rec.attribute18,
124 attribute19 = p_rec.attribute19,
125 attribute20 = p_rec.attribute20
126 where deployment_factor_id = p_rec.deployment_factor_id;
127 --
128 per_dpf_shd.g_api_dml := false; -- Unset the api dml status
129 --
130 hr_utility.set_location(' Leaving:'||l_proc, 10);
131 --
132 Exception
133 When hr_api.check_integrity_violated Then
134 -- A check constraint has been violated
135 per_dpf_shd.g_api_dml := false; -- Unset the api dml status
136 per_dpf_shd.constraint_error
137 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
138 When hr_api.parent_integrity_violated Then
139 -- Parent integrity has been violated
140 per_dpf_shd.g_api_dml := false; -- Unset the api dml status
141 per_dpf_shd.constraint_error
142 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
143 When hr_api.unique_integrity_violated Then
144 -- Unique integrity has been violated
145 per_dpf_shd.g_api_dml := false; -- Unset the api dml status
146 per_dpf_shd.constraint_error
147 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
148 When Others Then
149 per_dpf_shd.g_api_dml := false; -- Unset the api dml status
150 Raise;
151 End update_dml;
152 --
153 -- ----------------------------------------------------------------------------
154 -- |------------------------------< pre_update >------------------------------|
155 -- ----------------------------------------------------------------------------
156 -- {Start Of Comments}
157 --
158 -- Description:
159 -- This private procedure contains any processing which is required before
160 -- the update dml.
161 --
162 -- Prerequisites:
163 -- This is an internal procedure which is called from the upd procedure.
164 --
165 -- In Parameters:
166 -- A Pl/Sql record structre.
167 --
168 -- Post Success:
169 -- Processing continues.
170 --
171 -- Post Failure:
172 -- If an error has occurred, an error message and exception will be raised
173 -- but not handled.
174 --
175 -- Developer Implementation Notes:
176 -- Any pre-processing required before the update dml is issued should be
177 -- coded within this procedure. It is important to note that any 3rd party
178 -- maintenance should be reviewed before placing in this procedure.
179 --
180 -- Access Status:
181 -- Internal Row Handler Use Only.
182 --
183 -- {End Of Comments}
184 -- ----------------------------------------------------------------------------
185 Procedure pre_update(p_rec in per_dpf_shd.g_rec_type) 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 the
202 -- 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 structre.
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(p_rec in per_dpf_shd.g_rec_type,p_effective_date in date) is
228 --
229 l_proc varchar2(72) := g_package||'post_update';
230 --
231 Begin
232 hr_utility.set_location('Entering:'||l_proc, 5);
233 --
234 -- Start of API User Hook for post_update.
235 begin
236 per_dpf_rku.after_update
237 (
238 p_deployment_factor_id =>p_rec.deployment_factor_id,
239 p_business_group_id =>p_rec.business_group_id,
240 p_work_any_country =>p_rec.work_any_country,
241 p_work_any_location =>p_rec.work_any_location,
242 p_relocate_domestically =>p_rec.relocate_domestically,
243 p_relocate_internationally =>p_rec.relocate_internationally,
244 p_travel_required =>p_rec.travel_required,
245 p_country1 =>p_rec.country1,
246 p_country2 =>p_rec.country2,
247 p_country3 =>p_rec.country3,
248 p_work_duration =>p_rec.work_duration,
249 p_work_schedule =>p_rec.work_schedule,
250 p_work_hours =>p_rec.work_hours,
251 p_fte_capacity =>p_rec.fte_capacity,
252 p_visit_internationally =>p_rec.visit_internationally,
253 p_only_current_location =>p_rec.only_current_location,
254 p_no_country1 =>p_rec.no_country1,
255 p_no_country2 =>p_rec.no_country2,
256 p_no_country3 =>p_rec.no_country3,
257 p_comments =>p_rec.comments,
258 p_earliest_available_date =>p_rec.earliest_available_date,
259 p_available_for_transfer =>p_rec.available_for_transfer,
260 p_relocation_preference =>p_rec.relocation_preference,
261 p_relocation_required =>p_rec.relocation_required,
262 p_passport_required =>p_rec.passport_required,
263 p_location1 =>p_rec.location1,
264 p_location2 =>p_rec.location2,
265 p_location3 =>p_rec.location3,
266 p_other_requirements =>p_rec.other_requirements,
267 p_service_minimum =>p_rec.service_minimum,
268 p_object_version_number =>p_rec.object_version_number,
269 p_effective_date =>p_effective_date,
270 p_attribute_category =>p_rec.attribute_category,
271 p_attribute1 =>p_rec.attribute1,
272 p_attribute2 =>p_rec.attribute2,
273 p_attribute3 =>p_rec.attribute3,
274 p_attribute4 =>p_rec.attribute4,
275 p_attribute5 =>p_rec.attribute5,
276 p_attribute6 =>p_rec.attribute6,
277 p_attribute7 =>p_rec.attribute7,
278 p_attribute8 =>p_rec.attribute8,
279 p_attribute9 =>p_rec.attribute9,
280 p_attribute10 =>p_rec.attribute10,
281 p_attribute11 =>p_rec.attribute11,
282 p_attribute12 =>p_rec.attribute12,
283 p_attribute13 =>p_rec.attribute13,
284 p_attribute14 =>p_rec.attribute14,
285 p_attribute15 =>p_rec.attribute15,
286 p_attribute16 =>p_rec.attribute16,
287 p_attribute17 =>p_rec.attribute17,
288 p_attribute18 =>p_rec.attribute18,
289 p_attribute19 =>p_rec.attribute19,
290 p_attribute20 =>p_rec.attribute20,
291 p_position_id_o =>per_dpf_shd.g_old_rec.position_id,
292 p_person_id_o =>per_dpf_shd.g_old_rec.person_id,
293 p_job_id_o =>per_dpf_shd.g_old_rec.job_id,
294 p_business_group_id_o =>per_dpf_shd.g_old_rec.business_group_id,
295 p_work_any_country_o =>per_dpf_shd.g_old_rec.work_any_country,
296 p_work_any_location_o =>per_dpf_shd.g_old_rec.work_any_location,
297 p_relocate_domestically_o =>per_dpf_shd.g_old_rec.relocate_domestically,
298 p_relocate_internationally_o =>per_dpf_shd.g_old_rec.relocate_internationally,
299 p_travel_required_o =>per_dpf_shd.g_old_rec.travel_required,
300 p_country1_o =>per_dpf_shd.g_old_rec.country1,
301 p_country2_o =>per_dpf_shd.g_old_rec.country2,
302 p_country3_o =>per_dpf_shd.g_old_rec.country3,
303 p_work_duration_o =>per_dpf_shd.g_old_rec.work_duration,
304 p_work_schedule_o =>per_dpf_shd.g_old_rec.work_schedule,
305 p_work_hours_o =>per_dpf_shd.g_old_rec.work_hours,
306 p_fte_capacity_o =>per_dpf_shd.g_old_rec.fte_capacity,
307 p_visit_internationally_o =>per_dpf_shd.g_old_rec.visit_internationally,
308 p_only_current_location_o =>per_dpf_shd.g_old_rec.only_current_location,
309 p_no_country1_o =>per_dpf_shd.g_old_rec.no_country1,
310 p_no_country2_o =>per_dpf_shd.g_old_rec.no_country2,
311 p_no_country3_o =>per_dpf_shd.g_old_rec.no_country3,
312 p_comments_o =>per_dpf_shd.g_old_rec.comments,
313 p_earliest_available_date_o =>per_dpf_shd.g_old_rec.earliest_available_date,
314 p_available_for_transfer_o =>per_dpf_shd.g_old_rec.available_for_transfer,
315 p_relocation_preference_o =>per_dpf_shd.g_old_rec.relocation_preference,
316 p_relocation_required_o =>per_dpf_shd.g_old_rec.relocation_required,
317 p_passport_required_o =>per_dpf_shd.g_old_rec.passport_required,
318 p_location1_o =>per_dpf_shd.g_old_rec.location1,
319 p_location2_o =>per_dpf_shd.g_old_rec.location2,
320 p_location3_o =>per_dpf_shd.g_old_rec.location3,
321 p_other_requirements_o =>per_dpf_shd.g_old_rec.other_requirements,
322 p_service_minimum_o =>per_dpf_shd.g_old_rec.service_minimum,
323 p_object_version_number_o =>per_dpf_shd.g_old_rec.object_version_number,
324 p_attribute_category_o =>per_dpf_shd.g_old_rec.attribute_category,
325 p_attribute1_o =>per_dpf_shd.g_old_rec.attribute1,
326 p_attribute2_o =>per_dpf_shd.g_old_rec.attribute2,
327 p_attribute3_o =>per_dpf_shd.g_old_rec.attribute3,
328 p_attribute4_o =>per_dpf_shd.g_old_rec.attribute4,
329 p_attribute5_o =>per_dpf_shd.g_old_rec.attribute5,
330 p_attribute6_o =>per_dpf_shd.g_old_rec.attribute6,
331 p_attribute7_o =>per_dpf_shd.g_old_rec.attribute7,
332 p_attribute8_o =>per_dpf_shd.g_old_rec.attribute8,
333 p_attribute9_o =>per_dpf_shd.g_old_rec.attribute9,
334 p_attribute10_o =>per_dpf_shd.g_old_rec.attribute10,
335 p_attribute11_o =>per_dpf_shd.g_old_rec.attribute11,
336 p_attribute12_o =>per_dpf_shd.g_old_rec.attribute12,
337 p_attribute13_o =>per_dpf_shd.g_old_rec.attribute13,
338 p_attribute14_o =>per_dpf_shd.g_old_rec.attribute14,
339 p_attribute15_o =>per_dpf_shd.g_old_rec.attribute15,
340 p_attribute16_o =>per_dpf_shd.g_old_rec.attribute16,
341 p_attribute17_o =>per_dpf_shd.g_old_rec.attribute17,
342 p_attribute18_o =>per_dpf_shd.g_old_rec.attribute18,
343 p_attribute19_o =>per_dpf_shd.g_old_rec.attribute19,
344 p_attribute20_o =>per_dpf_shd.g_old_rec.attribute20
345 );
346 exception
347 when hr_api.cannot_find_prog_unit then
348 hr_api.cannot_find_prog_unit_error
349 (
350 p_module_name => 'PER_DEPLOYMENT_FACTORS',
351 p_hook_type => 'AU'
352 );
353 end;
354 -- End of API User Hook for post_update.
355 hr_utility.set_location(' Leaving:'||l_proc, 10);
356 End post_update;
357 --
358 -- ----------------------------------------------------------------------------
359 -- |-----------------------------< convert_defs >-----------------------------|
360 -- ----------------------------------------------------------------------------
361 -- {Start Of Comments}
362 --
363 -- Description:
364 -- The Convert_Defs procedure has one very important function:
365 -- It must return the record structure for the row with all system defaulted
366 -- values converted into its corresponding parameter value for update. When
367 -- we attempt to update a row through the Upd process , certain
368 -- parameters can be defaulted which enables flexibility in the calling of
369 -- the upd process (e.g. only attributes which need to be updated need to be
370 -- specified). For the upd process to determine which attributes
371 -- have NOT been specified we need to check if the parameter has a reserved
372 -- system default value. Therefore, for all parameters which have a
373 -- corresponding reserved system default mechanism specified we need to
374 -- check if a system default is being used. If a system default is being
375 -- used then we convert the defaulted value into its corresponding attribute
376 -- value held in the g_old_rec data structure.
377 --
378 -- Prerequisites:
379 -- This private function can only be called from the upd process.
380 --
381 -- In Parameters:
382 -- A Pl/Sql record structre.
383 --
384 -- Post Success:
385 -- The record structure will be returned with all system defaulted parameter
386 -- values converted into its current row attribute value.
387 --
388 -- Post Failure:
389 -- No direct error handling is required within this function. Any possible
390 -- errors within this procedure will be a PL/SQL value error due to conversion
391
392 -- of datatypes or data lengths.
393 --
394 -- Developer Implementation Notes:
395 -- None.
396 --
397 -- Access Status:
398 -- Internal Row Handler Use Only.
399 --
400 -- {End Of Comments}
401 -- ----------------------------------------------------------------------------
402 Procedure convert_defs(p_rec in out nocopy per_dpf_shd.g_rec_type) is
403 --
404 l_proc varchar2(72) := g_package||'convert_defs';
405 --
406 Begin
407 --
408 hr_utility.set_location('Entering:'||l_proc, 5);
409 --
410 -- We must now examine each argument value in the
411 -- p_rec plsql record structure
412 -- to see if a system default is being used. If a system default
413 -- is being used then we must set to the 'current' argument value.
414 --
415 If (p_rec.position_id = hr_api.g_number) then
416 p_rec.position_id :=
417 per_dpf_shd.g_old_rec.position_id;
418 End If;
419 If (p_rec.person_id = hr_api.g_number) then
420 p_rec.person_id :=
421 per_dpf_shd.g_old_rec.person_id;
422 End If;
423 If (p_rec.job_id = hr_api.g_number) then
424 p_rec.job_id :=
425 per_dpf_shd.g_old_rec.job_id;
426 End If;
427 If (p_rec.business_group_id = hr_api.g_number) then
428 p_rec.business_group_id :=
429 per_dpf_shd.g_old_rec.business_group_id;
430 End If;
431 If (p_rec.work_any_country = hr_api.g_varchar2) then
432 p_rec.work_any_country :=
433 per_dpf_shd.g_old_rec.work_any_country;
434 End If;
435 If (p_rec.work_any_location = hr_api.g_varchar2) then
436 p_rec.work_any_location :=
437 per_dpf_shd.g_old_rec.work_any_location;
438 End If;
439 If (p_rec.relocate_domestically = hr_api.g_varchar2) then
440 p_rec.relocate_domestically :=
441 per_dpf_shd.g_old_rec.relocate_domestically;
442 End If;
443 If (p_rec.relocate_internationally = hr_api.g_varchar2) then
444 p_rec.relocate_internationally :=
445 per_dpf_shd.g_old_rec.relocate_internationally;
446 End If;
447 If (p_rec.travel_required = hr_api.g_varchar2) then
448 p_rec.travel_required :=
449 per_dpf_shd.g_old_rec.travel_required;
450 End If;
451 If (p_rec.country1 = hr_api.g_varchar2) then
452 p_rec.country1 :=
453 per_dpf_shd.g_old_rec.country1;
454 End If;
455 If (p_rec.country2 = hr_api.g_varchar2) then
456 p_rec.country2 :=
457 per_dpf_shd.g_old_rec.country2;
458 End If;
459 If (p_rec.country3 = hr_api.g_varchar2) then
460 p_rec.country3 :=
461 per_dpf_shd.g_old_rec.country3;
462 End If;
463 If (p_rec.work_duration = hr_api.g_varchar2) then
464 p_rec.work_duration :=
465 per_dpf_shd.g_old_rec.work_duration;
466 End If;
467 If (p_rec.work_schedule = hr_api.g_varchar2) then
468 p_rec.work_schedule :=
469 per_dpf_shd.g_old_rec.work_schedule;
470 End If;
471 If (p_rec.work_hours = hr_api.g_varchar2) then
472 p_rec.work_hours :=
473 per_dpf_shd.g_old_rec.work_hours;
474 End If;
475 If (p_rec.fte_capacity = hr_api.g_varchar2) then
476 p_rec.fte_capacity :=
477 per_dpf_shd.g_old_rec.fte_capacity;
478 End If;
479 If (p_rec.visit_internationally = hr_api.g_varchar2) then
480 p_rec.visit_internationally :=
481 per_dpf_shd.g_old_rec.visit_internationally;
482 End If;
483 If (p_rec.only_current_location = hr_api.g_varchar2) then
484 p_rec.only_current_location :=
485 per_dpf_shd.g_old_rec.only_current_location;
486 End If;
487 If (p_rec.no_country1 = hr_api.g_varchar2) then
488 p_rec.no_country1 :=
489 per_dpf_shd.g_old_rec.no_country1;
490 End If;
491 If (p_rec.no_country2 = hr_api.g_varchar2) then
492 p_rec.no_country2 :=
493 per_dpf_shd.g_old_rec.no_country2;
494 End If;
495 If (p_rec.no_country3 = hr_api.g_varchar2) then
496 p_rec.no_country3 :=
497 per_dpf_shd.g_old_rec.no_country3;
498 End If;
499 If (p_rec.comments = hr_api.g_varchar2) then
500 p_rec.comments :=
501 per_dpf_shd.g_old_rec.comments;
502 End If;
503 If (p_rec.earliest_available_date = hr_api.g_date) then
504 p_rec.earliest_available_date :=
505 per_dpf_shd.g_old_rec.earliest_available_date;
506 End If;
507 If (p_rec.available_for_transfer = hr_api.g_varchar2) then
508 p_rec.available_for_transfer :=
509 per_dpf_shd.g_old_rec.available_for_transfer;
510 End If;
511 If (p_rec.relocation_preference = hr_api.g_varchar2) then
512 p_rec.relocation_preference :=
513 per_dpf_shd.g_old_rec.relocation_preference;
514 End If;
515 If (p_rec.relocation_required = hr_api.g_varchar2) then
516 p_rec.relocation_required :=
517 per_dpf_shd.g_old_rec.relocation_required;
518 End If;
519 If (p_rec.passport_required = hr_api.g_varchar2) then
520 p_rec.passport_required :=
521 per_dpf_shd.g_old_rec.passport_required;
522 End If;
523 If (p_rec.location1 = hr_api.g_varchar2) then
524 p_rec.location1 :=
525 per_dpf_shd.g_old_rec.location1;
526 End If;
527 If (p_rec.location2 = hr_api.g_varchar2) then
528 p_rec.location2 :=
529 per_dpf_shd.g_old_rec.location2;
530 End If;
531 If (p_rec.location3 = hr_api.g_varchar2) then
532 p_rec.location3 :=
533 per_dpf_shd.g_old_rec.location3;
534 End If;
535 If (p_rec.other_requirements = hr_api.g_varchar2) then
536 p_rec.other_requirements :=
537 per_dpf_shd.g_old_rec.other_requirements;
538 End If;
539 If (p_rec.service_minimum = hr_api.g_varchar2) then
540 p_rec.service_minimum :=
541 per_dpf_shd.g_old_rec.service_minimum;
542 End If;
543 If (p_rec.attribute_category = hr_api.g_varchar2) then
544 p_rec.attribute_category :=
545 per_dpf_shd.g_old_rec.attribute_category;
546 End If;
547 If (p_rec.attribute1 = hr_api.g_varchar2) then
548 p_rec.attribute1 :=
549 per_dpf_shd.g_old_rec.attribute1;
550 End If;
551 If (p_rec.attribute2 = hr_api.g_varchar2) then
552 p_rec.attribute2 :=
553 per_dpf_shd.g_old_rec.attribute2;
554 End If;
555 If (p_rec.attribute3 = hr_api.g_varchar2) then
556 p_rec.attribute3 :=
557 per_dpf_shd.g_old_rec.attribute3;
558 End If;
559 If (p_rec.attribute4 = hr_api.g_varchar2) then
560 p_rec.attribute4 :=
561 per_dpf_shd.g_old_rec.attribute4;
562 End If;
563 If (p_rec.attribute5 = hr_api.g_varchar2) then
564 p_rec.attribute5 :=
565 per_dpf_shd.g_old_rec.attribute5;
566 End If;
567 If (p_rec.attribute6 = hr_api.g_varchar2) then
568 p_rec.attribute6 :=
569 per_dpf_shd.g_old_rec.attribute6;
570 End If;
571 If (p_rec.attribute7 = hr_api.g_varchar2) then
572 p_rec.attribute7 :=
573 per_dpf_shd.g_old_rec.attribute7;
574 End If;
575 If (p_rec.attribute8 = hr_api.g_varchar2) then
576 p_rec.attribute8 :=
577 per_dpf_shd.g_old_rec.attribute8;
578 End If;
579 If (p_rec.attribute9 = hr_api.g_varchar2) then
580 p_rec.attribute9 :=
581 per_dpf_shd.g_old_rec.attribute9;
582 End If;
583 If (p_rec.attribute10 = hr_api.g_varchar2) then
584 p_rec.attribute10 :=
585 per_dpf_shd.g_old_rec.attribute10;
586 End If;
587 If (p_rec.attribute11 = hr_api.g_varchar2) then
588 p_rec.attribute11 :=
589 per_dpf_shd.g_old_rec.attribute11;
590 End If;
591 If (p_rec.attribute12 = hr_api.g_varchar2) then
592 p_rec.attribute12 :=
593 per_dpf_shd.g_old_rec.attribute12;
594 End If;
595 If (p_rec.attribute13 = hr_api.g_varchar2) then
596 p_rec.attribute13 :=
597 per_dpf_shd.g_old_rec.attribute13;
598 End If;
599 If (p_rec.attribute14 = hr_api.g_varchar2) then
600 p_rec.attribute14 :=
601 per_dpf_shd.g_old_rec.attribute14;
602 End If;
603 If (p_rec.attribute15 = hr_api.g_varchar2) then
604 p_rec.attribute15 :=
605 per_dpf_shd.g_old_rec.attribute15;
606 End If;
607 If (p_rec.attribute16 = hr_api.g_varchar2) then
608 p_rec.attribute16 :=
609 per_dpf_shd.g_old_rec.attribute16;
610 End If;
611 If (p_rec.attribute17 = hr_api.g_varchar2) then
612 p_rec.attribute17 :=
613 per_dpf_shd.g_old_rec.attribute17;
614 End If;
615 If (p_rec.attribute18 = hr_api.g_varchar2) then
616 p_rec.attribute18 :=
617 per_dpf_shd.g_old_rec.attribute18;
618 End If;
619 If (p_rec.attribute19 = hr_api.g_varchar2) then
620 p_rec.attribute19 :=
621 per_dpf_shd.g_old_rec.attribute19;
622 End If;
623 If (p_rec.attribute20 = hr_api.g_varchar2) then
624 p_rec.attribute20 :=
625 per_dpf_shd.g_old_rec.attribute20;
626 End If;
627 --
628 hr_utility.set_location(' Leaving:'||l_proc, 10);
629 --
630 End convert_defs;
631 --
632 -- ----------------------------------------------------------------------------
633 -- |---------------------------------< upd >----------------------------------|
634 -- ----------------------------------------------------------------------------
635 Procedure upd
636 (
637 p_rec in out nocopy per_dpf_shd.g_rec_type,
638 p_effective_date in date
639 ) is
640 --
641 l_proc varchar2(72) := g_package||'upd';
642 --
643 Begin
644 hr_utility.set_location('Entering:'||l_proc, 5);
645 --
646 -- We must lock the row which we need to update.
647 --
648 per_dpf_shd.lck
649 (
650 p_rec.deployment_factor_id,
651 p_rec.object_version_number
652 );
653 --
654 -- 1. During an update system defaults are used to determine if
655 -- arguments have been defaulted or not. We must therefore
656 -- derive the full record structure values to be updated.
657 --
658 -- 2. Call the supporting update validate operations.
659 --
660 convert_defs(p_rec);
661 per_dpf_bus.update_validate(p_rec,p_effective_date);
662 --
663 -- Call the supporting pre-update operation
664 --
665 pre_update(p_rec);
666 --
667 -- Update the row.
668 --
669 update_dml(p_rec);
670 --
671 -- Call the supporting post-update operation
672 --
673 post_update(p_rec, p_effective_date);
674 End upd;
675 --
676 -- ----------------------------------------------------------------------------
677 -- |---------------------------------< upd >----------------------------------|
678 -- ----------------------------------------------------------------------------
679 Procedure upd
680 (
681 p_deployment_factor_id in number,
682 p_position_id in number ,
683 p_person_id in number ,
684 p_job_id in number ,
685 p_business_group_id in number ,
686 p_work_any_country in varchar2 ,
687 p_work_any_location in varchar2 ,
688 p_relocate_domestically in varchar2 ,
689 p_relocate_internationally in varchar2 ,
690 p_travel_required in varchar2 ,
691 p_country1 in varchar2 ,
692 p_country2 in varchar2 ,
693 p_country3 in varchar2 ,
694 p_work_duration in varchar2 ,
695 p_work_schedule in varchar2 ,
696 p_work_hours in varchar2 ,
697 p_fte_capacity in varchar2 ,
698 p_visit_internationally in varchar2 ,
699 p_only_current_location in varchar2 ,
700 p_no_country1 in varchar2 ,
701 p_no_country2 in varchar2 ,
702 p_no_country3 in varchar2 ,
703 p_comments in varchar2 ,
704 p_earliest_available_date in date ,
705 p_available_for_transfer in varchar2 ,
706 p_relocation_preference in varchar2 ,
707 p_relocation_required in varchar2 ,
708 p_passport_required in varchar2 ,
709 p_location1 in varchar2 ,
710 p_location2 in varchar2 ,
711 p_location3 in varchar2 ,
712 p_other_requirements in varchar2 ,
713 p_service_minimum in varchar2 ,
714 p_object_version_number in out nocopy number,
715 p_effective_date in date,
716 p_attribute_category in varchar2 ,
717 p_attribute1 in varchar2 ,
718 p_attribute2 in varchar2 ,
719 p_attribute3 in varchar2 ,
720 p_attribute4 in varchar2 ,
721 p_attribute5 in varchar2 ,
722 p_attribute6 in varchar2 ,
723 p_attribute7 in varchar2 ,
724 p_attribute8 in varchar2 ,
725 p_attribute9 in varchar2 ,
726 p_attribute10 in varchar2 ,
727 p_attribute11 in varchar2 ,
728 p_attribute12 in varchar2 ,
729 p_attribute13 in varchar2 ,
730 p_attribute14 in varchar2 ,
731 p_attribute15 in varchar2 ,
732 p_attribute16 in varchar2 ,
733 p_attribute17 in varchar2 ,
734 p_attribute18 in varchar2 ,
735 p_attribute19 in varchar2 ,
736 p_attribute20 in varchar2 ) is
737 --
738 l_rec per_dpf_shd.g_rec_type;
739 l_proc varchar2(72) := g_package||'upd';
740 --
741 Begin
742 hr_utility.set_location('Entering:'||l_proc, 5);
743 --
744 -- Call conversion function to turn arguments into the
745 -- l_rec structure.
746 --
747 l_rec :=
748 per_dpf_shd.convert_args
749 (
750 p_deployment_factor_id,
751 p_position_id,
752 p_person_id,
753 p_job_id,
754 p_business_group_id,
755 p_work_any_country,
756 p_work_any_location,
757 p_relocate_domestically,
758 p_relocate_internationally,
759 p_travel_required,
760 p_country1,
761 p_country2,
762 p_country3,
763 p_work_duration,
764 p_work_schedule,
765 p_work_hours,
766 p_fte_capacity,
767 p_visit_internationally,
768 p_only_current_location,
769 p_no_country1,
770 p_no_country2,
771 p_no_country3,
772 p_comments,
773 p_earliest_available_date,
774 p_available_for_transfer,
775 p_relocation_preference,
776 p_relocation_required,
777 p_passport_required,
778 p_location1,
779 p_location2,
780 p_location3,
781 p_other_requirements,
782 p_service_minimum,
783 p_object_version_number,
784 p_attribute_category,
785 p_attribute1,
786 p_attribute2,
787 p_attribute3,
788 p_attribute4,
789 p_attribute5,
790 p_attribute6,
791 p_attribute7,
792 p_attribute8,
793 p_attribute9,
794 p_attribute10,
795 p_attribute11,
796 p_attribute12,
797 p_attribute13,
798 p_attribute14,
799 p_attribute15,
800 p_attribute16,
801 p_attribute17,
802 p_attribute18,
803 p_attribute19,
804 p_attribute20
805 );
806 --
807 -- Having converted the arguments into the
808 -- plsql record structure we call the corresponding record
809 -- business process.
810 --
811 upd(l_rec,p_effective_date);
812 p_object_version_number := l_rec.object_version_number;
813 --
814 hr_utility.set_location(' Leaving:'||l_proc, 10);
815 End upd;
816 --
817 end per_dpf_upd;