[Home] [Help]
PACKAGE BODY: APPS.PER_JOB_UPD
Source
1 Package Body per_job_upd as
2 /* $Header: pejobrhi.pkb 120.0 2005/05/31 10:47:52 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := 'per_job_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 functions of this
17 -- procedure are as follows:
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 -- Pre Conditions:
28 -- This is an internal private procedure which must be called from the upd
29 -- procedure.
30 --
31 -- In Arguments:
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' arguments list should be modified if any of your
47 -- attributes are not updateable.
48 --
49 -- Access Status:
50 -- Internal Table Handler Use Only.
51 --
52 -- {End Of Comments}
53 -- ----------------------------------------------------------------------------
54 Procedure update_dml(p_rec in out nocopy per_job_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_job_shd.g_api_dml := true; -- Set the api dml status
66
67 -- Bug 3213714
68 -- Restricting size of the name column
69 p_rec.name := substr(p_rec.name,1,700);
70
71 hr_utility.set_location('Entering:'||l_proc, 6);
72 --
73 -- Update the per_jobs Row
74 --
75 update per_jobs
76 set
77 job_id = p_rec.job_id,
78 job_definition_id = p_rec.job_definition_id,
79 date_from = p_rec.date_from,
80 comments = p_rec.comments,
81 date_to = p_rec.date_to,
82 approval_authority = p_rec.approval_authority,
83 name = p_rec.name,
84 request_id = p_rec.request_id,
85 program_application_id = p_rec.program_application_id,
86 program_id = p_rec.program_id,
87 program_update_date = p_rec.program_update_date,
88 attribute_category = p_rec.attribute_category,
89 attribute1 = p_rec.attribute1,
90 attribute2 = p_rec.attribute2,
91 attribute3 = p_rec.attribute3,
92 attribute4 = p_rec.attribute4,
93 attribute5 = p_rec.attribute5,
94 attribute6 = p_rec.attribute6,
95 attribute7 = p_rec.attribute7,
96 attribute8 = p_rec.attribute8,
97 attribute9 = p_rec.attribute9,
98 attribute10 = p_rec.attribute10,
99 attribute11 = p_rec.attribute11,
100 attribute12 = p_rec.attribute12,
101 attribute13 = p_rec.attribute13,
102 attribute14 = p_rec.attribute14,
103 attribute15 = p_rec.attribute15,
104 attribute16 = p_rec.attribute16,
105 attribute17 = p_rec.attribute17,
106 attribute18 = p_rec.attribute18,
107 attribute19 = p_rec.attribute19,
108 attribute20 = p_rec.attribute20,
109 job_information_category = p_rec.job_information_category,
110 job_information1 = p_rec.job_information1,
111 job_information2 = p_rec.job_information2,
112 job_information3 = p_rec.job_information3,
113 job_information4 = p_rec.job_information4,
114 job_information5 = p_rec.job_information5,
115 job_information6 = p_rec.job_information6,
116 job_information7 = p_rec.job_information7,
117 job_information8 = p_rec.job_information8,
118 job_information9 = p_rec.job_information9,
119 job_information10 = p_rec.job_information10,
120 job_information11 = p_rec.job_information11,
121 job_information12 = p_rec.job_information12,
122 job_information13 = p_rec.job_information13,
123 job_information14 = p_rec.job_information14,
124 job_information15 = p_rec.job_information15,
125 job_information16 = p_rec.job_information16,
126 job_information17 = p_rec.job_information17,
127 job_information18 = p_rec.job_information18,
128 job_information19 = p_rec.job_information19,
129 job_information20 = p_rec.job_information20,
130 benchmark_job_flag = p_rec.benchmark_job_flag,
131 benchmark_job_id = p_rec.benchmark_job_id,
132 emp_rights_flag = p_rec.emp_rights_flag,
133 --job_group_id = p_rec.job_group_id,
134 object_version_number = p_rec.object_version_number
135 where job_id = p_rec.job_id;
136
137 --
138 hr_utility.set_location('Entering:'||l_proc, 7);
139 --
140 per_job_shd.g_api_dml := false; -- Unset the api dml status
141 --
142 hr_utility.set_location(' Leaving:'||l_proc, 10);
143 --
144 Exception
145 When hr_api.check_integrity_violated Then
146 -- A check constraint has been violated
147 hr_utility.set_location('Entering:'||l_proc, 20);
148 per_job_shd.g_api_dml := false; -- Unset the api dml status
149 per_job_shd.constraint_error
150 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
151 When hr_api.parent_integrity_violated Then
152 hr_utility.set_location('Entering:'||l_proc, 21);
153 -- Parent integrity has been violated
154 per_job_shd.g_api_dml := false; -- Unset the api dml status
155 per_job_shd.constraint_error
156 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
157 When hr_api.unique_integrity_violated Then
158 hr_utility.set_location('Entering:'||l_proc, 22);
159 -- Unique integrity has been violated
160 per_job_shd.g_api_dml := false; -- Unset the api dml status
161 per_job_shd.constraint_error
162 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
163 When Others Then
164 hr_utility.set_location('Entering:'||l_proc, 23);
165 per_job_shd.g_api_dml := false; -- Unset the api dml status
166 Raise;
167 End update_dml;
168 --
169 -- ----------------------------------------------------------------------------
170 -- |------------------------------< pre_update >------------------------------|
171 -- ----------------------------------------------------------------------------
172 -- {Start Of Comments}
173 --
174 -- Description:
175 -- This private procedure contains any processing which is required before
176 -- the update dml.
177 --
178 -- Pre Conditions:
179 -- This is an internal procedure which is called from the upd procedure.
180 --
181 -- In Arguments:
182 -- A Pl/Sql record structre.
183 --
184 -- Post Success:
185 -- Processing continues.
186 --
187 -- Post Failure:
188 -- If an error has occurred, an error message and exception will be raised
189 -- but not handled.
190 --
191 -- Developer Implementation Notes:
192 -- Any pre-processing required before the update dml is issued should be
193 -- coded within this procedure. It is important to note that any 3rd party
194 -- maintenance should be reviewed before placing in this procedure.
195 --
196 -- Access Status:
197 -- Internal Table Handler Use Only.
198 --
199 -- {End Of Comments}
200 -- ----------------------------------------------------------------------------
201 Procedure pre_update(p_rec in per_job_shd.g_rec_type) is
202 --
203 l_proc varchar2(72) := g_package||'pre_update';
204 --
205 Begin
206 hr_utility.set_location('Entering:'||l_proc, 5);
207 --
208 hr_utility.set_location(' Leaving:'||l_proc, 10);
209 End pre_update;
210 --
211 -- ----------------------------------------------------------------------------
212 -- |-----------------------------< post_update >------------------------------|
213 -- ----------------------------------------------------------------------------
214 -- {Start Of Comments}
215 --
216 -- Description:
217 -- This private procedure contains any processing which is required after the
218 -- update dml.
219 --
220 -- Pre Conditions:
221 -- This is an internal procedure which is called from the upd procedure.
222 --
223 -- In Arguments:
224 -- A Pl/Sql record structre.
225 --
226 -- Post Success:
227 -- Processing continues.
228 --
229 -- Post Failure:
230 -- If an error has occurred, an error message and exception will be raised
231 -- but not handled.
232 --
233 -- Developer Implementation Notes:
234 -- Any post-processing required after the update dml is issued should be
235 -- coded within this procedure. It is important to note that any 3rd party
236 -- maintenance should be reviewed before placing in this procedure.
237 --
238 -- Access Status:
239 -- Internal Table Handler Use Only.
240 --
241 -- {End Of Comments}
242 -- ----------------------------------------------------------------------------
243 Procedure post_update(p_rec in per_job_shd.g_rec_type) is
244 --
245 l_proc varchar2(72) := g_package||'post_update';
246 --
247 Begin
248 hr_utility.set_location('Entering:'||l_proc, 5);
249 --
250 -- Start of API User Hook for post_update.
251 begin
252 per_job_rku.after_update
253 (p_job_id => p_rec.job_id,
254 p_job_definition_id => p_rec.job_definition_id,
255 p_date_from => p_rec.date_from,
256 p_comments => p_rec.comments,
257 p_date_to => p_rec.date_to,
258 p_approval_authority => p_rec.approval_authority,
259 p_name => p_rec.name,
260 p_request_id => p_rec.request_id,
261 p_program_application_id => p_rec.program_application_id,
262 p_program_id => p_rec.program_id,
263 p_program_update_date => p_rec.program_update_date,
264 p_attribute_category => p_rec.attribute_category,
265 p_attribute1 => p_rec.attribute1,
266 p_attribute2 => p_rec.attribute2,
267 p_attribute3 => p_rec.attribute3,
268 p_attribute4 => p_rec.attribute4,
269 p_attribute5 => p_rec.attribute5,
270 p_attribute6 => p_rec.attribute6,
271 p_attribute7 => p_rec.attribute7,
272 p_attribute8 => p_rec.attribute8,
273 p_attribute9 => p_rec.attribute9,
274 p_attribute10 => p_rec.attribute10,
275 p_attribute11 => p_rec.attribute11,
276 p_attribute12 => p_rec.attribute12,
277 p_attribute13 => p_rec.attribute13,
278 p_attribute14 => p_rec.attribute14,
279 p_attribute15 => p_rec.attribute15,
280 p_attribute16 => p_rec.attribute16,
281 p_attribute17 => p_rec.attribute17,
282 p_attribute18 => p_rec.attribute18,
283 p_attribute19 => p_rec.attribute19,
284 p_attribute20 => p_rec.attribute20,
285 p_job_information_category => p_rec.job_information_category,
286 p_job_information1 => p_rec.job_information1,
287 p_job_information2 => p_rec.job_information2,
288 p_job_information3 => p_rec.job_information3,
289 p_job_information4 => p_rec.job_information4,
290 p_job_information5 => p_rec.job_information5,
291 p_job_information6 => p_rec.job_information6,
292 p_job_information7 => p_rec.job_information7,
293 p_job_information8 => p_rec.job_information8,
294 p_job_information9 => p_rec.job_information9,
295 p_job_information10 => p_rec.job_information10,
296 p_job_information11 => p_rec.job_information11,
297 p_job_information12 => p_rec.job_information12,
298 p_job_information13 => p_rec.job_information13,
299 p_job_information14 => p_rec.job_information14,
300 p_job_information15 => p_rec.job_information15,
301 p_job_information16 => p_rec.job_information16,
302 p_job_information17 => p_rec.job_information17,
303 p_job_information18 => p_rec.job_information18,
304 p_job_information19 => p_rec.job_information19,
305 p_job_information20 => p_rec.job_information20,
306 p_benchmark_job_flag => p_rec.benchmark_job_flag,
307 p_benchmark_job_id => p_rec.benchmark_job_id,
308 p_emp_rights_flag => p_rec.emp_rights_flag,
309 p_job_group_id => p_rec.job_group_id,
310 p_object_version_number => p_rec.object_version_number,
311 p_business_group_id_o => per_job_shd.g_old_rec.business_group_id,
312 p_job_definition_id_o => per_job_shd.g_old_rec.job_definition_id,
313 p_date_from_o => per_job_shd.g_old_rec.date_from,
314 p_comments_o => per_job_shd.g_old_rec.comments,
315 p_date_to_o => per_job_shd.g_old_rec.date_to,
316 p_approval_authority_o => per_job_shd.g_old_rec.approval_authority,
317 p_name_o => per_job_shd.g_old_rec.name,
318 p_request_id_o => per_job_shd.g_old_rec.request_id,
319 p_program_application_id_o => per_job_shd.g_old_rec.program_application_id,
320 p_program_id_o => per_job_shd.g_old_rec.program_id,
321 p_program_update_date_o => per_job_shd.g_old_rec.program_update_date,
322 p_attribute_category_o => per_job_shd.g_old_rec.attribute_category,
323 p_attribute1_o => per_job_shd.g_old_rec.attribute1,
324 p_attribute2_o => per_job_shd.g_old_rec.attribute2,
325 p_attribute3_o => per_job_shd.g_old_rec.attribute3,
326 p_attribute4_o => per_job_shd.g_old_rec.attribute4,
327 p_attribute5_o => per_job_shd.g_old_rec.attribute5,
328 p_attribute6_o => per_job_shd.g_old_rec.attribute6,
329 p_attribute7_o => per_job_shd.g_old_rec.attribute7,
330 p_attribute8_o => per_job_shd.g_old_rec.attribute8,
331 p_attribute9_o => per_job_shd.g_old_rec.attribute9,
332 p_attribute10_o => per_job_shd.g_old_rec.attribute10,
333 p_attribute11_o => per_job_shd.g_old_rec.attribute11,
334 p_attribute12_o => per_job_shd.g_old_rec.attribute12,
335 p_attribute13_o => per_job_shd.g_old_rec.attribute13,
336 p_attribute14_o => per_job_shd.g_old_rec.attribute14,
337 p_attribute15_o => per_job_shd.g_old_rec.attribute15,
338 p_attribute16_o => per_job_shd.g_old_rec.attribute16,
339 p_attribute17_o => per_job_shd.g_old_rec.attribute17,
340 p_attribute18_o => per_job_shd.g_old_rec.attribute18,
341 p_attribute19_o => per_job_shd.g_old_rec.attribute19,
342 p_attribute20_o => per_job_shd.g_old_rec.attribute20,
343 p_job_information_category_o=> per_job_shd.g_old_rec.job_information_category,
344 p_job_information1_o => per_job_shd.g_old_rec.job_information1,
345 p_job_information2_o => per_job_shd.g_old_rec.job_information2,
346 p_job_information3_o => per_job_shd.g_old_rec.job_information3,
347 p_job_information4_o => per_job_shd.g_old_rec.job_information4,
348 p_job_information5_o => per_job_shd.g_old_rec.job_information5,
349 p_job_information6_o => per_job_shd.g_old_rec.job_information6,
350 p_job_information7_o => per_job_shd.g_old_rec.job_information7,
351 p_job_information8_o => per_job_shd.g_old_rec.job_information8,
352 p_job_information9_o => per_job_shd.g_old_rec.job_information9,
353 p_job_information10_o => per_job_shd.g_old_rec.job_information10,
354 p_job_information11_o => per_job_shd.g_old_rec.job_information11,
355 p_job_information12_o => per_job_shd.g_old_rec.job_information12,
356 p_job_information13_o => per_job_shd.g_old_rec.job_information13,
357 p_job_information14_o => per_job_shd.g_old_rec.job_information14,
358 p_job_information15_o => per_job_shd.g_old_rec.job_information15,
359 p_job_information16_o => per_job_shd.g_old_rec.job_information16,
360 p_job_information17_o => per_job_shd.g_old_rec.job_information17,
361 p_job_information18_o => per_job_shd.g_old_rec.job_information18,
362 p_job_information19_o => per_job_shd.g_old_rec.job_information19,
363 p_job_information20_o => per_job_shd.g_old_rec.job_information20,
364 p_benchmark_job_flag_o => per_job_shd.g_old_rec.benchmark_job_flag,
365 p_benchmark_job_id_o => per_job_shd.g_old_rec.benchmark_job_id,
366 p_emp_rights_flag_o => per_job_shd.g_old_rec.emp_rights_flag,
367 p_job_group_id_o => per_job_shd.g_old_rec.job_group_id,
368 p_object_version_number_o => per_job_shd.g_old_rec.object_version_number
369 );
370 exception
371 when hr_api.cannot_find_prog_unit then
372 hr_api.cannot_find_prog_unit_error
373 (p_module_name => 'PER_JOBS'
374 ,p_hook_type => 'AU'
375 );
376 end;
377 -- End of API User Hook for post_update.
378 --
379 hr_utility.set_location(' Leaving:'||l_proc, 10);
380 End post_update;
381 --
382 -- ----------------------------------------------------------------------------
383 -- |-----------------------------< convert_defs >-----------------------------|
384 -- ----------------------------------------------------------------------------
385 -- {Start Of Comments}
386 --
387 -- Description:
388 -- The Convert_Defs procedure has one very important function:
389 -- It must return the record structure for the row with all system defaulted
390 -- values converted into its corresponding argument value for update. When
391 -- we attempt to update a row through the Upd business process , certain
392 -- arguments can be defaulted which enables flexibility in the calling of
393 -- the upd process (e.g. only attributes which need to be updated need to be
394 -- specified). For the upd business process to determine which attributes
395 -- have NOT been specified we need to check if the argument has a reserved
396 -- system default value. Therefore, for all attributes which have a
397 -- corresponding reserved system default mechanism specified we need to
398 -- check if a system default is being used. If a system default is being
399 -- used then we convert the defaulted value into its corresponding attribute
400 -- value held in the g_old_rec data structure.
401 --
402 -- Pre Conditions:
403 -- This private function can only be called from the upd process.
404 --
405 -- In Arguments:
406 -- A Pl/Sql record structre.
407 --
408 -- Post Success:
409 -- The record structure will be returned with all system defaulted argument
410 -- values converted into its current row attribute value.
411 --
412 -- Post Failure:
413 -- No direct error handling is required within this function. Any possible
414 -- errors within this procedure will be a PL/SQL value error due to conversion
415
416 -- of datatypes or data lengths.
417 --
418 -- Developer Implementation Notes:
419 -- None.
420 --
421 -- Access Status:
422 -- Internal Table Handler Use Only.
423 --
424 -- {End Of Comments}
425 -- ----------------------------------------------------------------------------
426 Procedure convert_defs(p_rec in out nocopy per_job_shd.g_rec_type) is
427 --
428 l_proc varchar2(72) := g_package||'convert_defs';
429 --
430 Begin
431 --
432 hr_utility.set_location('Entering:'||l_proc, 5);
433 --
434 -- We must now examine each argument value in the
435 -- p_rec plsql record structure
436 -- to see if a system default is being used. If a system default
437 -- is being used then we must set to the 'current' argument value.
438 --
439 If (p_rec.business_group_id = hr_api.g_number) then
440 p_rec.business_group_id :=
441 per_job_shd.g_old_rec.business_group_id;
442 End If;
443 hr_utility.set_location('Entering:'||p_rec.job_definition_id, 6);
444 If (p_rec.job_definition_id = hr_api.g_number) then
445 p_rec.job_definition_id :=
446 per_job_shd.g_old_rec.job_definition_id;
447 End If;
448 hr_utility.set_location('Entering:'||l_proc, 7);
449 If (p_rec.date_from = hr_api.g_date) then
450 p_rec.date_from :=
451 per_job_shd.g_old_rec.date_from;
452 End If;
453 hr_utility.set_location('Entering:'||l_proc, 8);
454 If (p_rec.comments = hr_api.g_varchar2) then
455 p_rec.comments :=
456 per_job_shd.g_old_rec.comments;
457 End If;
458 hr_utility.set_location('Entering:'||l_proc, 9);
459 If (p_rec.date_to = hr_api.g_date) then
460 p_rec.date_to :=
461 per_job_shd.g_old_rec.date_to;
462 End If;
463 hr_utility.set_location('Entering:'||p_rec.approval_authority, 10);
464 If (p_rec.approval_authority = hr_api.g_number) then
465 p_rec.approval_authority :=
466 per_job_shd.g_old_rec.approval_authority;
467 End If;
468 hr_utility.set_location('Entering:'||l_proc, 11);
469 If (p_rec.name = hr_api.g_varchar2) then
470 p_rec.name :=
471 per_job_shd.g_old_rec.name;
472 End If;
473 hr_utility.set_location('Entering:'||p_rec.request_id , 12);
474 If (p_rec.request_id = hr_api.g_number) then
475 p_rec.request_id :=
476 per_job_shd.g_old_rec.request_id;
477 End If;
478 hr_utility.set_location('Entering:'||l_proc, 14);
479 If (p_rec.program_application_id = hr_api.g_number) then
480 p_rec.program_application_id :=
481 per_job_shd.g_old_rec.program_application_id;
482 End If;
483 hr_utility.set_location('Entering:'||l_proc, 15);
484 If (p_rec.program_id = hr_api.g_number) then
485 p_rec.program_id :=
486 per_job_shd.g_old_rec.program_id;
487 End If;
488 hr_utility.set_location('Entering:'||l_proc, 16);
489 If (p_rec.program_update_date = hr_api.g_date) then
490 p_rec.program_update_date :=
491 per_job_shd.g_old_rec.program_update_date;
492 End If;
493 hr_utility.set_location('Entering:'||l_proc, 17);
494 If (p_rec.attribute_category = hr_api.g_varchar2) then
495 p_rec.attribute_category :=
496 per_job_shd.g_old_rec.attribute_category;
497 End If;
498 hr_utility.set_location('Entering:'||l_proc, 18);
499 If (p_rec.attribute1 = hr_api.g_varchar2) then
500 p_rec.attribute1 :=
501 per_job_shd.g_old_rec.attribute1;
502 End If;
503 hr_utility.set_location('Entering:'||l_proc, 19);
504 If (p_rec.attribute2 = hr_api.g_varchar2) then
505 p_rec.attribute2 :=
506 per_job_shd.g_old_rec.attribute2;
507 End If;
508 hr_utility.set_location('Entering:'||l_proc, 20);
509 If (p_rec.attribute3 = hr_api.g_varchar2) then
510 p_rec.attribute3 :=
511 per_job_shd.g_old_rec.attribute3;
512 End If;
513 hr_utility.set_location('Entering:'||l_proc, 21);
514 If (p_rec.attribute4 = hr_api.g_varchar2) then
515 p_rec.attribute4 :=
516 per_job_shd.g_old_rec.attribute4;
517 End If;
518 hr_utility.set_location('Entering:'||l_proc, 22);
519 If (p_rec.attribute5 = hr_api.g_varchar2) then
520 p_rec.attribute5 :=
521 per_job_shd.g_old_rec.attribute5;
522 End If;
523 hr_utility.set_location('Entering:'||l_proc, 23);
524 If (p_rec.attribute6 = hr_api.g_varchar2) then
525 p_rec.attribute6 :=
526 per_job_shd.g_old_rec.attribute6;
527 End If;
528 hr_utility.set_location('Entering:'||l_proc, 24);
529 If (p_rec.attribute7 = hr_api.g_varchar2) then
530 p_rec.attribute7 :=
531 per_job_shd.g_old_rec.attribute7;
532 End If;
533 hr_utility.set_location('Entering:'||l_proc, 25);
534 If (p_rec.attribute8 = hr_api.g_varchar2) then
535 p_rec.attribute8 :=
536 per_job_shd.g_old_rec.attribute8;
537 End If;
538 hr_utility.set_location('Entering:'||l_proc, 26);
539 If (p_rec.attribute9 = hr_api.g_varchar2) then
540 p_rec.attribute9 :=
541 per_job_shd.g_old_rec.attribute9;
542 End If;
543 hr_utility.set_location('Entering:'||l_proc, 27);
544 If (p_rec.attribute10 = hr_api.g_varchar2) then
545 p_rec.attribute10 :=
546 per_job_shd.g_old_rec.attribute10;
547 End If;
548 hr_utility.set_location('Entering:'||l_proc, 28);
549 If (p_rec.attribute11 = hr_api.g_varchar2) then
550 p_rec.attribute11 :=
551 per_job_shd.g_old_rec.attribute11;
552 End If;
553 hr_utility.set_location('Entering:'||l_proc, 29);
554 If (p_rec.attribute12 = hr_api.g_varchar2) then
555 p_rec.attribute12 :=
556 per_job_shd.g_old_rec.attribute12;
557 End If;
558 hr_utility.set_location('Entering:'||l_proc, 30);
559 If (p_rec.attribute13 = hr_api.g_varchar2) then
560 p_rec.attribute13 :=
561 per_job_shd.g_old_rec.attribute13;
562 End If;
563 hr_utility.set_location('Entering:'||l_proc, 31);
564 If (p_rec.attribute14 = hr_api.g_varchar2) then
565 p_rec.attribute14 :=
566 per_job_shd.g_old_rec.attribute14;
567 End If;
568 hr_utility.set_location('Entering:'||l_proc, 32);
569 If (p_rec.attribute15 = hr_api.g_varchar2) then
570 p_rec.attribute15 :=
571 per_job_shd.g_old_rec.attribute15;
572 End If;
573 hr_utility.set_location('Entering:'||l_proc, 33);
574 If (p_rec.attribute16 = hr_api.g_varchar2) then
575 p_rec.attribute16 :=
576 per_job_shd.g_old_rec.attribute16;
577 End If;
578 hr_utility.set_location('Entering:'||l_proc, 34);
579 If (p_rec.attribute17 = hr_api.g_varchar2) then
580 p_rec.attribute17 :=
581 per_job_shd.g_old_rec.attribute17;
582 End If;
583 hr_utility.set_location('Entering:'||l_proc, 35);
584 If (p_rec.attribute18 = hr_api.g_varchar2) then
585 p_rec.attribute18 :=
586 per_job_shd.g_old_rec.attribute18;
587 End If;
588 hr_utility.set_location('Entering:'||l_proc, 36);
589 If (p_rec.attribute19 = hr_api.g_varchar2) then
590 p_rec.attribute19 :=
591 per_job_shd.g_old_rec.attribute19;
592 End If;
593 hr_utility.set_location('Entering:'||l_proc, 37);
594 If (p_rec.attribute20 = hr_api.g_varchar2) then
595 p_rec.attribute20 :=
596 per_job_shd.g_old_rec.attribute20;
597 End If;
598 hr_utility.set_location('Entering:'||l_proc, 38);
599 If (p_rec.job_information_category = hr_api.g_varchar2) then
600 p_rec.job_information_category :=
601 per_job_shd.g_old_rec.job_information_category;
602 End If;
603 hr_utility.set_location('Entering:'||l_proc, 39);
604 If (p_rec.job_information1= hr_api.g_varchar2) then
605 p_rec.job_information1 :=
606 per_job_shd.g_old_rec.job_information1;
607 End If;
608 hr_utility.set_location('Entering:'||l_proc, 40);
609 If (p_rec.job_information2= hr_api.g_varchar2) then
610 p_rec.job_information2 :=
611 per_job_shd.g_old_rec.job_information2;
612 End If;
613 hr_utility.set_location('Entering:'||l_proc, 41);
614 If (p_rec.job_information3= hr_api.g_varchar2) then
615 p_rec.job_information3 :=
616 per_job_shd.g_old_rec.job_information3;
617 End If;
618 hr_utility.set_location('Entering:'||l_proc, 42);
619 If (p_rec.job_information4= hr_api.g_varchar2) then
620 p_rec.job_information4 :=
621 per_job_shd.g_old_rec.job_information4;
622 End If;
623 hr_utility.set_location('Entering:'||l_proc, 43);
624 If (p_rec.job_information5= hr_api.g_varchar2) then
625 p_rec.job_information5 :=
626 per_job_shd.g_old_rec.job_information5;
627 End If;
628 hr_utility.set_location('Entering:'||l_proc, 44);
629 If (p_rec.job_information6= hr_api.g_varchar2) then
630 p_rec.job_information6 :=
631 per_job_shd.g_old_rec.job_information6;
632 End If;
633 hr_utility.set_location('Entering:'||l_proc, 45);
634 If (p_rec.job_information7= hr_api.g_varchar2) then
635 p_rec.job_information7 :=
636 per_job_shd.g_old_rec.job_information7;
637 End If;
638 hr_utility.set_location('Entering:'||l_proc, 46);
639 If (p_rec.job_information8= hr_api.g_varchar2) then
640 p_rec.job_information8 :=
641 per_job_shd.g_old_rec.job_information8;
642 End If;
643 hr_utility.set_location('Entering:'||l_proc, 47);
644 If (p_rec.job_information9= hr_api.g_varchar2) then
645 p_rec.job_information9 :=
646 per_job_shd.g_old_rec.job_information9;
647 End If;
648 hr_utility.set_location('Entering:'||l_proc, 48);
649 If (p_rec.job_information10= hr_api.g_varchar2) then
650 p_rec.job_information10 :=
651 per_job_shd.g_old_rec.job_information10;
652 End If;
653 hr_utility.set_location('Entering:'||l_proc, 49);
654 If (p_rec.job_information11= hr_api.g_varchar2) then
655 p_rec.job_information11:=
656 per_job_shd.g_old_rec.job_information11;
657 End If;
658 hr_utility.set_location('Entering:'||l_proc, 50);
659 If (p_rec.job_information12= hr_api.g_varchar2) then
660 p_rec.job_information12 :=
661 per_job_shd.g_old_rec.job_information12;
662 End If;
663 hr_utility.set_location('Entering:'||l_proc, 51);
664 If (p_rec.job_information13= hr_api.g_varchar2) then
665 p_rec.job_information13 :=
666 per_job_shd.g_old_rec.job_information13;
667 End If;
668 hr_utility.set_location('Entering:'||l_proc, 52);
669 If (p_rec.job_information14= hr_api.g_varchar2) then
670 p_rec.job_information14 :=
671 per_job_shd.g_old_rec.job_information14;
672 End If;
673 hr_utility.set_location('Entering:'||l_proc, 53);
674 If (p_rec.job_information15= hr_api.g_varchar2) then
675 p_rec.job_information15 :=
676 per_job_shd.g_old_rec.job_information15;
677 End If;
678 hr_utility.set_location('Entering:'||l_proc, 54);
679 If (p_rec.job_information16= hr_api.g_varchar2) then
680 p_rec.job_information16 :=
681 per_job_shd.g_old_rec.job_information16;
682 End If;
683 hr_utility.set_location('Entering:'||l_proc, 55);
684 If (p_rec.job_information17= hr_api.g_varchar2) then
685 p_rec.job_information17 :=
686 per_job_shd.g_old_rec.job_information17;
687 End If;
688 hr_utility.set_location('Entering:'||l_proc, 56);
689 If (p_rec.job_information18= hr_api.g_varchar2) then
690 p_rec.job_information18 :=
691 per_job_shd.g_old_rec.job_information18;
692 End If;
693 hr_utility.set_location('Entering:'||l_proc, 57);
694 If (p_rec.job_information19= hr_api.g_varchar2) then
695 p_rec.job_information19 :=
696 per_job_shd.g_old_rec.job_information19;
697 End If;
698 hr_utility.set_location('Entering:'||l_proc, 58);
699 If (p_rec.job_information20= hr_api.g_varchar2) then
700 p_rec.job_information20 :=
701 per_job_shd.g_old_rec.job_information20;
702 End If;
703 hr_utility.set_location('Entering:'||l_proc, 59);
704 If (p_rec.benchmark_job_flag = hr_api.g_varchar2) then
705 p_rec.benchmark_job_flag :=
706 per_job_shd.g_old_rec.benchmark_job_flag;
707 End If;
708 hr_utility.set_location('Entering:'||p_rec.benchmark_job_id, 60);
709 If (p_rec.benchmark_job_id = hr_api.g_number) then
710 p_rec.benchmark_job_id :=
711 per_job_shd.g_old_rec.benchmark_job_id;
712 End If;
713 hr_utility.set_location('Entering:'||l_proc, 61);
714 If (p_rec.emp_rights_flag = hr_api.g_varchar2) then
715 p_rec.emp_rights_flag :=
716 per_job_shd.g_old_rec.emp_rights_flag;
717 End If;
718 hr_utility.set_location('Entering:'||l_proc, 62);
719 If (p_rec.job_group_id = hr_api.g_number) then
720 p_rec.job_group_id :=
721 per_job_shd.g_old_rec.job_group_id;
722 End IF;
723 --
724 hr_utility.set_location(' Leaving:'||l_proc, 10);
725 --
726 End convert_defs;
727 --
728 -- ----------------------------------------------------------------------------
729 -- |---------------------------------< upd >----------------------------------|
730 -- ----------------------------------------------------------------------------
731 Procedure upd
732 (
733 p_rec in out nocopy per_job_shd.g_rec_type,
734 p_validate in boolean default false
735 ) is
736 --
737 l_proc varchar2(72) := g_package||'upd';
738 --
739 Begin
740 hr_utility.set_location('Entering:'||l_proc, 5);
741 --
742 -- Determine if the business process is to be validated.
743 --
744 If p_validate then
745 --
746 -- Issue the savepoint.
747 --
748 SAVEPOINT upd_per_job;
749 End If;
750 --
751 -- We must lock the row which we need to update.
752 --
753 per_job_shd.lck
754 (
755 p_job_id => p_rec.job_id,
756 p_object_version_number => p_rec.object_version_number
757 );
758 --
759 -- 1. During an update system defaults are used to determine if
760 -- arguments have been defaulted or not. We must therefore
761 -- derive the full record structure values to be updated.
762 --
763 -- 2. Call the supporting update validate operations.
764 --
765 convert_defs(p_rec);
766 per_job_bus.update_validate(p_rec => p_rec);
767 --
768 -- Call the supporting pre-update operation
769 --
770 pre_update(p_rec => p_rec);
771 --
772 -- Update the row.
773 --
774 update_dml(p_rec => p_rec);
775 --
776 -- Call the supporting post-update operation
777 --
778 /*
779 post_update(p_rec => p_rec);
780 */
781
782 --
783 -- If we are validating then raise the Validate_Enabled exception
784 --
785 If p_validate then
786 hr_utility.set_location(' Leaving:'||l_proc, 9);
787 Raise HR_Api.Validate_Enabled;
788 End If;
789 --
790 hr_utility.set_location(' Leaving:'||l_proc, 10);
791 Exception
792 When HR_Api.Validate_Enabled Then
793 hr_utility.set_location(' Leaving:'||l_proc, 20);
794 --
795 -- As the Validate_Enabled exception has been raised
796 -- we must rollback to the savepoint
797 --
798 ROLLBACK TO upd_per_job;
799 End upd;
800 --
801 -- ----------------------------------------------------------------------------
802 -- |---------------------------------< upd >----------------------------------|
803 -- ----------------------------------------------------------------------------
804 Procedure upd
805 (
806 p_job_id in number,
807 p_job_definition_id in number default hr_api.g_number,
808 p_date_from in date default hr_api.g_date,
809 p_comments in varchar2 default hr_api.g_varchar2,
810 p_date_to in date default hr_api.g_date,
811 p_approval_authority in number default hr_api.g_number,
812 p_name in varchar2 default hr_api.g_varchar2,
813 p_request_id in number default hr_api.g_number,
814 p_program_application_id in number default hr_api.g_number,
815 p_program_id in number default hr_api.g_number,
816 p_program_update_date in date default hr_api.g_date,
817 p_attribute_category in varchar2 default hr_api.g_varchar2,
818 p_attribute1 in varchar2 default hr_api.g_varchar2,
819 p_attribute2 in varchar2 default hr_api.g_varchar2,
820 p_attribute3 in varchar2 default hr_api.g_varchar2,
821 p_attribute4 in varchar2 default hr_api.g_varchar2,
822 p_attribute5 in varchar2 default hr_api.g_varchar2,
823 p_attribute6 in varchar2 default hr_api.g_varchar2,
824 p_attribute7 in varchar2 default hr_api.g_varchar2,
825 p_attribute8 in varchar2 default hr_api.g_varchar2,
826 p_attribute9 in varchar2 default hr_api.g_varchar2,
827 p_attribute10 in varchar2 default hr_api.g_varchar2,
828 p_attribute11 in varchar2 default hr_api.g_varchar2,
829 p_attribute12 in varchar2 default hr_api.g_varchar2,
830 p_attribute13 in varchar2 default hr_api.g_varchar2,
831 p_attribute14 in varchar2 default hr_api.g_varchar2,
832 p_attribute15 in varchar2 default hr_api.g_varchar2,
833 p_attribute16 in varchar2 default hr_api.g_varchar2,
834 p_attribute17 in varchar2 default hr_api.g_varchar2,
835 p_attribute18 in varchar2 default hr_api.g_varchar2,
836 p_attribute19 in varchar2 default hr_api.g_varchar2,
837 p_attribute20 in varchar2 default hr_api.g_varchar2,
838 p_job_information_category in varchar2 default hr_api.g_varchar2,
839 p_job_information1 in varchar2 default hr_api.g_varchar2,
840 p_job_information2 in varchar2 default hr_api.g_varchar2,
841 p_job_information3 in varchar2 default hr_api.g_varchar2,
842 p_job_information4 in varchar2 default hr_api.g_varchar2,
843 p_job_information5 in varchar2 default hr_api.g_varchar2,
844 p_job_information6 in varchar2 default hr_api.g_varchar2,
845 p_job_information7 in varchar2 default hr_api.g_varchar2,
846 p_job_information8 in varchar2 default hr_api.g_varchar2,
847 p_job_information9 in varchar2 default hr_api.g_varchar2,
848 p_job_information10 in varchar2 default hr_api.g_varchar2,
849 p_job_information11 in varchar2 default hr_api.g_varchar2,
850 p_job_information12 in varchar2 default hr_api.g_varchar2,
851 p_job_information13 in varchar2 default hr_api.g_varchar2,
852 p_job_information14 in varchar2 default hr_api.g_varchar2,
853 p_job_information15 in varchar2 default hr_api.g_varchar2,
854 p_job_information16 in varchar2 default hr_api.g_varchar2,
855 p_job_information17 in varchar2 default hr_api.g_varchar2,
856 p_job_information18 in varchar2 default hr_api.g_varchar2,
857 p_job_information19 in varchar2 default hr_api.g_varchar2,
858 p_job_information20 in varchar2 default hr_api.g_varchar2,
859 p_benchmark_job_flag in varchar2 default hr_api.g_varchar2,
860 p_benchmark_job_id in number default hr_api.g_number,
861 p_emp_rights_flag in varchar2 default hr_api.g_varchar2,
862 --p_job_group_id in number default hr_api.g_number,
863 p_object_version_number in out nocopy number,
864 p_validate in boolean default false
865 ) is
866 --
867 l_rec per_job_shd.g_rec_type;
868 l_proc varchar2(72) := g_package||'upd';
869 --
870 Begin
871 hr_utility.set_location('Entering:'||l_proc, 5);
872 --
873 -- Call conversion function to turn arguments into the
874 -- l_rec structure.
875 --
876 l_rec :=
877 per_job_shd.convert_args
878 (
879 p_job_id,
880 hr_api.g_number, -- p_business_group_id
881 p_job_definition_id,
882 p_date_from,
883 p_comments,
884 p_date_to,
885 p_approval_authority,
886 p_name,
887 p_request_id,
888 p_program_application_id,
889 p_program_id,
890 p_program_update_date,
891 p_attribute_category,
892 p_attribute1,
893 p_attribute2,
894 p_attribute3,
895 p_attribute4,
896 p_attribute5,
897 p_attribute6,
898 p_attribute7,
899 p_attribute8,
900 p_attribute9,
901 p_attribute10,
902 p_attribute11,
903 p_attribute12,
904 p_attribute13,
905 p_attribute14,
906 p_attribute15,
907 p_attribute16,
908 p_attribute17,
909 p_attribute18,
910 p_attribute19,
911 p_attribute20,
912 p_job_information_category,
913 p_job_information1,
914 p_job_information2,
915 p_job_information3,
916 p_job_information4,
917 p_job_information5,
918 p_job_information6,
919 p_job_information7,
920 p_job_information8,
921 p_job_information9,
922 p_job_information10,
923 p_job_information11,
924 p_job_information12,
925 p_job_information13,
926 p_job_information14,
927 p_job_information15,
928 p_job_information16,
929 p_job_information17,
930 p_job_information18,
931 p_job_information19,
932 p_job_information20,
933 p_benchmark_job_flag,
934 p_benchmark_job_id,
935 p_emp_rights_flag,
936 hr_api.g_number, -- p_job_group_id
937 p_object_version_number
938 );
939 --
940 -- Having converted the arguments into the
941 -- plsql record structure we call the corresponding record
942 -- business process.
943 --
944 upd(l_rec,p_validate);
945 p_object_version_number := l_rec.object_version_number;
946 --
947 hr_utility.set_location(' Leaving:' ||l_proc, 10);
948 End upd;
949 --
950 end per_job_upd;