1 Package Body per_sub_upd as
2 /* $Header: pesubrhi.pkb 115.14 2004/02/23 01:47:08 smparame ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' per_sub_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 -- Pre Conditions:
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 Table Handler Use Only.
51 --
52 -- {End Of Comments}
53 -- ----------------------------------------------------------------------------
54 Procedure update_dml(p_rec in out nocopy per_sub_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_sub_shd.g_api_dml := true; -- Set the api dml status
66 --
67 -- Update the per_subjects_taken Row
68 --
69 update per_subjects_taken
70 set
71 subjects_taken_id = p_rec.subjects_taken_id,
72 start_date = p_rec.start_date,
73 major = p_rec.major,
74 subject_status = p_rec.subject_status,
75 subject = p_rec.subject,
76 grade_attained = p_rec.grade_attained,
77 end_date = p_rec.end_date,
78 qualification_id = p_rec.qualification_id,
79 object_version_number = p_rec.object_version_number,
80 attribute_category = p_rec.attribute_category,
81 attribute1 = p_rec.attribute1,
82 attribute2 = p_rec.attribute2,
83 attribute3 = p_rec.attribute3,
84 attribute4 = p_rec.attribute4,
85 attribute5 = p_rec.attribute5,
86 attribute6 = p_rec.attribute6,
87 attribute7 = p_rec.attribute7,
88 attribute8 = p_rec.attribute8,
89 attribute9 = p_rec.attribute9,
90 attribute10 = p_rec.attribute10,
91 attribute11 = p_rec.attribute11,
92 attribute12 = p_rec.attribute12,
93 attribute13 = p_rec.attribute13,
94 attribute14 = p_rec.attribute14,
95 attribute15 = p_rec.attribute15,
96 attribute16 = p_rec.attribute16,
97 attribute17 = p_rec.attribute17,
98 attribute18 = p_rec.attribute18,
99 attribute19 = p_rec.attribute19,
100 attribute20 = p_rec.attribute20,
101 sub_information_category = p_rec.sub_information_category,
102 sub_information1 = p_rec.sub_information1,
103 sub_information2 = p_rec.sub_information2,
104 sub_information3 = p_rec.sub_information3,
105 sub_information4 = p_rec.sub_information4,
106 sub_information5 = p_rec.sub_information5,
107 sub_information6 = p_rec.sub_information6,
108 sub_information7 = p_rec.sub_information7,
109 sub_information8 = p_rec.sub_information8,
110 sub_information9 = p_rec.sub_information9,
111 sub_information10 = p_rec.sub_information10,
112 sub_information11 = p_rec.sub_information11,
113 sub_information12 = p_rec.sub_information12,
114 sub_information13 = p_rec.sub_information13,
115 sub_information14 = p_rec.sub_information14,
116 sub_information15 = p_rec.sub_information15,
117 sub_information16 = p_rec.sub_information16,
118 sub_information17 = p_rec.sub_information17,
119 sub_information18 = p_rec.sub_information18,
120 sub_information19 = p_rec.sub_information19,
121 sub_information20 = p_rec.sub_information20
122 where subjects_taken_id = p_rec.subjects_taken_id;
123 --
124 per_sub_shd.g_api_dml := false; -- Unset the api dml status
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_sub_shd.g_api_dml := false; -- Unset the api dml status
132 per_sub_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_sub_shd.g_api_dml := false; -- Unset the api dml status
137 per_sub_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_sub_shd.g_api_dml := false; -- Unset the api dml status
142 per_sub_shd.constraint_error
143 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
144 When Others Then
145 per_sub_shd.g_api_dml := false; -- Unset the api 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 -- Pre Conditions:
159 -- This is an internal procedure which is called from the upd procedure.
160 --
161 -- In Parameters:
162 -- A Pl/Sql record structre.
163 --
164 -- Post Success:
165 -- Processing continues.
166 --
167 -- Post Failure:
168 -- If an error has occurred, an error message and exception will 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 Table Handler Use Only.
178 --
179 -- {End Of Comments}
180 -- ----------------------------------------------------------------------------
181 Procedure pre_update(p_rec in per_sub_shd.g_rec_type) is
182 --
183 l_proc varchar2(72) := g_package||'pre_update';
184 --
185 Begin
186 hr_utility.set_location('Entering:'||l_proc, 5);
187 --
188 hr_utility.set_location(' Leaving:'||l_proc, 10);
189 End pre_update;
190 --
191 -- ----------------------------------------------------------------------------
192 -- |-----------------------------< post_update >------------------------------|
193 -- ----------------------------------------------------------------------------
194 -- {Start Of Comments}
195 --
196 -- Description:
197 -- This private procedure contains any processing which is required after the
198 -- update dml.
199 --
200 -- Pre Conditions:
201 -- This is an internal procedure which is called from the upd procedure.
202 --
203 -- In Parameters:
204 -- A Pl/Sql record structre.
205 --
206 -- Post Success:
207 -- Processing continues.
208 --
209 -- Post Failure:
210 -- If an error has occurred, an error message and exception will be raised
211 -- but not handled.
212 --
213 -- Developer Implementation Notes:
214 -- Any post-processing required after the update dml is issued should be
215 -- coded within this procedure. It is important to note that any 3rd party
216 -- maintenance should be reviewed before placing in this procedure.
217 --
218 -- Access Status:
219 -- Internal Table Handler Use Only.
220 --
221 -- {End Of Comments}
222 -- ----------------------------------------------------------------------------
223 Procedure post_update(p_rec in per_sub_shd.g_rec_type,
224 p_effective_date in date) is
225 --
226 l_proc varchar2(72) := g_package||'post_update';
227 --
228 Begin
229 hr_utility.set_location('Entering:'||l_proc, 5);
230 --
231 -- Start of Row Handler User Hook for post_update.
232 --
233 Begin
234 per_sub_rku.after_update
235 (
236 p_subjects_taken_id => p_rec.subjects_taken_id,
237 p_start_date => p_rec.start_date,
238 p_major => p_rec.major,
239 p_subject_status => p_rec.subject_status,
240 p_subject => p_rec.subject,
241 p_grade_attained => p_rec.grade_attained,
242 p_end_date => p_rec.end_date,
243 p_qualification_id => p_rec.qualification_id,
244 p_object_version_number => p_rec.object_version_number,
245 p_attribute_category => p_rec.attribute_category,
246 p_attribute1 => p_rec.attribute1,
247 p_attribute2 => p_rec.attribute2,
248 p_attribute3 => p_rec.attribute3,
249 p_attribute4 => p_rec.attribute4,
250 p_attribute5 => p_rec.attribute5,
251 p_attribute6 => p_rec.attribute6,
252 p_attribute7 => p_rec.attribute7,
253 p_attribute8 => p_rec.attribute8,
254 p_attribute9 => p_rec.attribute9,
255 p_attribute10 => p_rec.attribute10,
256 p_attribute11 => p_rec.attribute11,
257 p_attribute12 => p_rec.attribute12,
258 p_attribute13 => p_rec.attribute13,
259 p_attribute14 => p_rec.attribute14,
260 p_attribute15 => p_rec.attribute15,
261 p_attribute16 => p_rec.attribute16,
262 p_attribute17 => p_rec.attribute17,
263 p_attribute18 => p_rec.attribute18,
264 p_attribute19 => p_rec.attribute19,
265 p_attribute20 => p_rec.attribute20,
266 p_sub_information_category => p_rec.sub_information_category,
267 p_sub_information1 => p_rec.sub_information1,
268 p_sub_information2 => p_rec.sub_information2,
269 p_sub_information3 => p_rec.sub_information3,
270 p_sub_information4 => p_rec.sub_information4,
271 p_sub_information5 => p_rec.sub_information5,
272 p_sub_information6 => p_rec.sub_information6,
273 p_sub_information7 => p_rec.sub_information7,
274 p_sub_information8 => p_rec.sub_information8,
275 p_sub_information9 => p_rec.sub_information9,
276 p_sub_information10 => p_rec.sub_information10,
277 p_sub_information11 => p_rec.sub_information11,
278 p_sub_information12 => p_rec.sub_information12,
279 p_sub_information13 => p_rec.sub_information13,
280 p_sub_information14 => p_rec.sub_information14,
281 p_sub_information15 => p_rec.sub_information15,
282 p_sub_information16 => p_rec.sub_information16,
283 p_sub_information17 => p_rec.sub_information17,
284 p_sub_information18 => p_rec.sub_information18,
285 p_sub_information19 => p_rec.sub_information19,
286 p_sub_information20 => p_rec.sub_information20,
287 p_effective_date => p_effective_date,
288 p_start_date_o => per_sub_shd.g_old_rec.start_date,
289 p_major_o => per_sub_shd.g_old_rec.major,
290 p_subject_status_o => per_sub_shd.g_old_rec.subject_status,
291 p_subject_o => per_sub_shd.g_old_rec.subject,
292 p_grade_attained_o => per_sub_shd.g_old_rec.grade_attained,
293 p_end_date_o => per_sub_shd.g_old_rec.end_date,
294 p_qualification_id_o => per_sub_shd.g_old_rec.qualification_id,
295 p_object_version_number_o => per_sub_shd.g_old_rec.object_version_number,
296 p_attribute_category_o => per_sub_shd.g_old_rec.attribute_category,
297 p_attribute1_o => per_sub_shd.g_old_rec.attribute1,
298 p_attribute2_o => per_sub_shd.g_old_rec.attribute2,
299 p_attribute3_o => per_sub_shd.g_old_rec.attribute3,
300 p_attribute4_o => per_sub_shd.g_old_rec.attribute4,
301 p_attribute5_o => per_sub_shd.g_old_rec.attribute5,
302 p_attribute6_o => per_sub_shd.g_old_rec.attribute6,
303 p_attribute7_o => per_sub_shd.g_old_rec.attribute7,
304 p_attribute8_o => per_sub_shd.g_old_rec.attribute8,
305 p_attribute9_o => per_sub_shd.g_old_rec.attribute9,
306 p_attribute10_o => per_sub_shd.g_old_rec.attribute10,
307 p_attribute11_o => per_sub_shd.g_old_rec.attribute11,
308 p_attribute12_o => per_sub_shd.g_old_rec.attribute12,
309 p_attribute13_o => per_sub_shd.g_old_rec.attribute13,
310 p_attribute14_o => per_sub_shd.g_old_rec.attribute14,
311 p_attribute15_o => per_sub_shd.g_old_rec.attribute15,
312 p_attribute16_o => per_sub_shd.g_old_rec.attribute16,
313 p_attribute17_o => per_sub_shd.g_old_rec.attribute17,
314 p_attribute18_o => per_sub_shd.g_old_rec.attribute18,
315 p_attribute19_o => per_sub_shd.g_old_rec.attribute19,
316 p_attribute20_o => per_sub_shd.g_old_rec.attribute20,
317 p_sub_information_category_o => per_sub_shd.g_old_rec.sub_information_category,
318 p_sub_information1_o => per_sub_shd.g_old_rec.sub_information1,
319 p_sub_information2_o => per_sub_shd.g_old_rec.sub_information2,
320 p_sub_information3_o => per_sub_shd.g_old_rec.sub_information3,
321 p_sub_information4_o => per_sub_shd.g_old_rec.sub_information4,
322 p_sub_information5_o => per_sub_shd.g_old_rec.sub_information5,
323 p_sub_information6_o => per_sub_shd.g_old_rec.sub_information6,
324 p_sub_information7_o => per_sub_shd.g_old_rec.sub_information7,
325 p_sub_information8_o => per_sub_shd.g_old_rec.sub_information8,
326 p_sub_information9_o => per_sub_shd.g_old_rec.sub_information9,
327 p_sub_information10_o => per_sub_shd.g_old_rec.sub_information10,
328 p_sub_information11_o => per_sub_shd.g_old_rec.sub_information11,
329 p_sub_information12_o => per_sub_shd.g_old_rec.sub_information12,
330 p_sub_information13_o => per_sub_shd.g_old_rec.sub_information13,
331 p_sub_information14_o => per_sub_shd.g_old_rec.sub_information14,
332 p_sub_information15_o => per_sub_shd.g_old_rec.sub_information15,
333 p_sub_information16_o => per_sub_shd.g_old_rec.sub_information16,
334 p_sub_information17_o => per_sub_shd.g_old_rec.sub_information17,
335 p_sub_information18_o => per_sub_shd.g_old_rec.sub_information18,
336 p_sub_information19_o => per_sub_shd.g_old_rec.sub_information19,
337 p_sub_information20_o => per_sub_shd.g_old_rec.sub_information20
338 );
339 exception
340 when hr_api.cannot_find_prog_unit then
341 hr_api.cannot_find_prog_unit_error
342 (p_module_name => 'PER_SUBJECTS_TAKEN'
343 ,p_hook_type => 'AU'
344 );
345 end;
346 --
347 -- End of Row Handler User Hook for post_update.
348 --
349 hr_utility.set_location(' Leaving:'||l_proc, 10);
350 End post_update;
351 --
352 -- ----------------------------------------------------------------------------
353 -- |-----------------------------< convert_defs >-----------------------------|
354 -- ----------------------------------------------------------------------------
355 -- {Start Of Comments}
356 --
357 -- Description:
358 -- The Convert_Defs procedure has one very important function:
359 -- It must return the record structure for the row with all system defaulted
360 -- values converted into its corresponding parameter value for update. When
361 -- we attempt to update a row through the Upd process , certain
362 -- parameters can be defaulted which enables flexibility in the calling of
363 -- the upd process (e.g. only attributes which need to be updated need to be
364 -- specified). For the upd process to determine which attributes
365 -- have NOT been specified we need to check if the parameter has a reserved
366 -- system default value. Therefore, for all parameters which have a
367 -- corresponding reserved system default mechanism specified we need to
368 -- check if a system default is being used. If a system default is being
369 -- used then we convert the defaulted value into its corresponding attribute
370 -- value held in the g_old_rec data structure.
371 --
372 -- Pre Conditions:
373 -- This private function can only be called from the upd process.
374 --
375 -- In Parameters:
376 -- A Pl/Sql record structre.
377 --
378 -- Post Success:
379 -- The record structure will be returned with all system defaulted parameter
380 -- values converted into its current row attribute value.
381 --
382 -- Post Failure:
383 -- No direct error handling is required within this function. Any possible
384 -- errors within this procedure will be a PL/SQL value error due to conversion
385
386 -- of datatypes or data lengths.
387 --
388 -- Developer Implementation Notes:
389 -- None.
390 --
391 -- Access Status:
392 -- Internal Table Handler Use Only.
393 --
394 -- {End Of Comments}
395 -- ----------------------------------------------------------------------------
396 Procedure convert_defs(p_rec in out nocopy per_sub_shd.g_rec_type) is
397 --
398 l_proc varchar2(72) := g_package||'convert_defs';
399 --
400 Begin
401 --
402 hr_utility.set_location('Entering:'||l_proc, 5);
403 --
404 -- We must now examine each argument value in the
405 -- p_rec plsql record structure
406 -- to see if a system default is being used. If a system default
407 -- is being used then we must set to the 'current' argument value.
408 --
409 If (p_rec.start_date = hr_api.g_date) then
410 p_rec.start_date :=
411 per_sub_shd.g_old_rec.start_date;
412 End If;
413 If (p_rec.major = hr_api.g_varchar2) then
414 p_rec.major :=
415 per_sub_shd.g_old_rec.major;
416 End If;
417 If (p_rec.subject_status = hr_api.g_varchar2) then
418 p_rec.subject_status :=
419 per_sub_shd.g_old_rec.subject_status;
420 End If;
421 If (p_rec.subject = hr_api.g_varchar2) then
422 p_rec.subject :=
423 per_sub_shd.g_old_rec.subject;
424 End If;
425 If (p_rec.grade_attained = hr_api.g_varchar2) then
426 p_rec.grade_attained :=
427 per_sub_shd.g_old_rec.grade_attained;
428 End If;
429 If (p_rec.end_date = hr_api.g_date) then
430 p_rec.end_date :=
431 per_sub_shd.g_old_rec.end_date;
432 End If;
433 If (p_rec.qualification_id = hr_api.g_number) then
434 p_rec.qualification_id :=
435 per_sub_shd.g_old_rec.qualification_id;
436 End If;
437 If (p_rec.attribute_category = hr_api.g_varchar2) then
438 p_rec.attribute_category :=
439 per_sub_shd.g_old_rec.attribute_category;
440 End If;
441 If (p_rec.attribute1 = hr_api.g_varchar2) then
442 p_rec.attribute1 :=
443 per_sub_shd.g_old_rec.attribute1;
444 End If;
445 If (p_rec.attribute2 = hr_api.g_varchar2) then
446 p_rec.attribute2 :=
447 per_sub_shd.g_old_rec.attribute2;
448 End If;
449 If (p_rec.attribute3 = hr_api.g_varchar2) then
450 p_rec.attribute3 :=
451 per_sub_shd.g_old_rec.attribute3;
452 End If;
453 If (p_rec.attribute4 = hr_api.g_varchar2) then
454 p_rec.attribute4 :=
455 per_sub_shd.g_old_rec.attribute4;
456 End If;
457 If (p_rec.attribute5 = hr_api.g_varchar2) then
458 p_rec.attribute5 :=
459 per_sub_shd.g_old_rec.attribute5;
460 End If;
461 If (p_rec.attribute6 = hr_api.g_varchar2) then
462 p_rec.attribute6 :=
463 per_sub_shd.g_old_rec.attribute6;
464 End If;
465 If (p_rec.attribute7 = hr_api.g_varchar2) then
466 p_rec.attribute7 :=
467 per_sub_shd.g_old_rec.attribute7;
468 End If;
469 If (p_rec.attribute8 = hr_api.g_varchar2) then
470 p_rec.attribute8 :=
471 per_sub_shd.g_old_rec.attribute8;
472 End If;
473 If (p_rec.attribute9 = hr_api.g_varchar2) then
474 p_rec.attribute9 :=
475 per_sub_shd.g_old_rec.attribute9;
476 End If;
477 If (p_rec.attribute10 = hr_api.g_varchar2) then
478 p_rec.attribute10 :=
479 per_sub_shd.g_old_rec.attribute10;
480 End If;
481 If (p_rec.attribute11 = hr_api.g_varchar2) then
482 p_rec.attribute11 :=
483 per_sub_shd.g_old_rec.attribute11;
484 End If;
485 If (p_rec.attribute12 = hr_api.g_varchar2) then
486 p_rec.attribute12 :=
487 per_sub_shd.g_old_rec.attribute12;
488 End If;
489 If (p_rec.attribute13 = hr_api.g_varchar2) then
490 p_rec.attribute13 :=
491 per_sub_shd.g_old_rec.attribute13;
492 End If;
493 If (p_rec.attribute14 = hr_api.g_varchar2) then
494 p_rec.attribute14 :=
495 per_sub_shd.g_old_rec.attribute14;
496 End If;
497 If (p_rec.attribute15 = hr_api.g_varchar2) then
498 p_rec.attribute15 :=
499 per_sub_shd.g_old_rec.attribute15;
500 End If;
501 If (p_rec.attribute16 = hr_api.g_varchar2) then
502 p_rec.attribute16 :=
503 per_sub_shd.g_old_rec.attribute16;
504 End If;
505 If (p_rec.attribute17 = hr_api.g_varchar2) then
506 p_rec.attribute17 :=
507 per_sub_shd.g_old_rec.attribute17;
508 End If;
509 If (p_rec.attribute18 = hr_api.g_varchar2) then
510 p_rec.attribute18 :=
511 per_sub_shd.g_old_rec.attribute18;
512 End If;
513 If (p_rec.attribute19 = hr_api.g_varchar2) then
514 p_rec.attribute19 :=
515 per_sub_shd.g_old_rec.attribute19;
516 End If;
517 If (p_rec.attribute20 = hr_api.g_varchar2) then
518 p_rec.attribute20 :=
519 per_sub_shd.g_old_rec.attribute20;
520 End If;
521 If (p_rec.sub_information_category = hr_api.g_varchar2) then
522 p_rec.sub_information_category :=
523 per_sub_shd.g_old_rec.sub_information_category;
524 End If;
525 If (p_rec.sub_information1 = hr_api.g_varchar2) then
526 p_rec.sub_information1 :=
527 per_sub_shd.g_old_rec.sub_information1;
528 End If;
529 If (p_rec.sub_information2 = hr_api.g_varchar2) then
530 p_rec.sub_information2 :=
531 per_sub_shd.g_old_rec.sub_information2;
532 End If;
533 If (p_rec.sub_information3 = hr_api.g_varchar2) then
534 p_rec.sub_information3 :=
535 per_sub_shd.g_old_rec.sub_information3;
536 End If;
537 If (p_rec.sub_information4 = hr_api.g_varchar2) then
538 p_rec.sub_information4 :=
539 per_sub_shd.g_old_rec.sub_information4;
540 End If;
541 If (p_rec.sub_information5 = hr_api.g_varchar2) then
542 p_rec.sub_information5 :=
543 per_sub_shd.g_old_rec.sub_information5;
544 End If;
545 If (p_rec.sub_information6 = hr_api.g_varchar2) then
546 p_rec.sub_information6 :=
547 per_sub_shd.g_old_rec.sub_information6;
548 End If;
549 If (p_rec.sub_information7 = hr_api.g_varchar2) then
550 p_rec.sub_information7 :=
551 per_sub_shd.g_old_rec.sub_information7;
552 End If;
553 If (p_rec.sub_information8 = hr_api.g_varchar2) then
554 p_rec.sub_information8 :=
555 per_sub_shd.g_old_rec.sub_information8;
556 End If;
557 If (p_rec.sub_information9 = hr_api.g_varchar2) then
558 p_rec.sub_information9 :=
559 per_sub_shd.g_old_rec.sub_information9;
560 End If;
561 If (p_rec.sub_information10 = hr_api.g_varchar2) then
562 p_rec.sub_information10 :=
563 per_sub_shd.g_old_rec.sub_information10;
564 End If;
565 If (p_rec.sub_information11 = hr_api.g_varchar2) then
566 p_rec.sub_information11 :=
567 per_sub_shd.g_old_rec.sub_information11;
568 End If;
569 If (p_rec.sub_information12 = hr_api.g_varchar2) then
570 p_rec.sub_information12 :=
571 per_sub_shd.g_old_rec.sub_information12;
572 End If;
573 If (p_rec.sub_information13 = hr_api.g_varchar2) then
574 p_rec.sub_information13 :=
575 per_sub_shd.g_old_rec.sub_information13;
576 End If;
577 If (p_rec.sub_information14 = hr_api.g_varchar2) then
578 p_rec.sub_information14 :=
579 per_sub_shd.g_old_rec.sub_information14;
580 End If;
581 If (p_rec.sub_information15 = hr_api.g_varchar2) then
582 p_rec.sub_information15 :=
583 per_sub_shd.g_old_rec.sub_information15;
584 End If;
585 If (p_rec.sub_information16 = hr_api.g_varchar2) then
586 p_rec.sub_information16 :=
587 per_sub_shd.g_old_rec.sub_information16;
588 End If;
589 If (p_rec.sub_information17 = hr_api.g_varchar2) then
590 p_rec.sub_information17 :=
591 per_sub_shd.g_old_rec.sub_information17;
592 End If;
593 If (p_rec.sub_information18 = hr_api.g_varchar2) then
594 p_rec.sub_information18 :=
595 per_sub_shd.g_old_rec.sub_information18;
596 End If;
597 If (p_rec.sub_information19 = hr_api.g_varchar2) then
598 p_rec.sub_information19 :=
599 per_sub_shd.g_old_rec.sub_information19;
600 End If;
601 If (p_rec.sub_information20 = hr_api.g_varchar2) then
602 p_rec.sub_information20 :=
603 per_sub_shd.g_old_rec.sub_information20;
604 End If;
605 --
606 hr_utility.set_location(' Leaving:'||l_proc, 10);
607 --
608 End convert_defs;
609 --
610 -- ----------------------------------------------------------------------------
611 -- |---------------------------------< upd >----------------------------------|
612 -- ----------------------------------------------------------------------------
613 Procedure upd
614 (
615 p_rec in out nocopy per_sub_shd.g_rec_type,
616 p_effective_date in date,
617 p_validate in boolean default false
618 ) is
619 --
620 l_proc varchar2(72) := g_package||'upd';
621 --
622 Begin
623 hr_utility.set_location('Entering:'||l_proc, 5);
624 --
625 -- Determine if the business process is to be validated.
626 --
627 If p_validate then
628 --
629 -- Issue the savepoint.
630 --
631 SAVEPOINT upd_sub;
632 End If;
633 --
634 -- We must lock the row which we need to update.
635 --
636 per_sub_shd.lck
637 (
638 p_rec.subjects_taken_id,
639 p_rec.object_version_number
640 );
641 --
642 -- 1. During an update system defaults are used to determine if
643 -- arguments have been defaulted or not. We must therefore
644 -- derive the full record structure values to be updated.
645 --
646 -- 2. Call the supporting update validate operations.
647 --
648 convert_defs(p_rec);
649 per_sub_bus.update_validate(p_rec,p_effective_date);
650 --
651 -- Call the supporting pre-update operation
652 --
653 pre_update(p_rec);
654 --
655 -- Update the row.
656 --
657 update_dml(p_rec);
658 --
659 -- Call the supporting post-update operation
660 --
661 post_update(p_rec, p_effective_date);
662 --
663 -- If we are validating then raise the Validate_Enabled exception
664 --
665 If p_validate then
666 Raise HR_Api.Validate_Enabled;
667 End If;
668 --
669 hr_utility.set_location(' Leaving:'||l_proc, 10);
670 Exception
671 When HR_Api.Validate_Enabled Then
672 --
673 -- As the Validate_Enabled exception has been raised
674 -- we must rollback to the savepoint
675 --
676 ROLLBACK TO upd_sub;
677 End upd;
678 --
679 -- ----------------------------------------------------------------------------
680 -- |---------------------------------< upd >----------------------------------|
681 -- ----------------------------------------------------------------------------
682 Procedure upd
683 (
684 p_subjects_taken_id in number,
685 p_start_date in date default hr_api.g_date,
686 p_major in varchar2 default hr_api.g_varchar2,
687 p_subject_status in varchar2 default hr_api.g_varchar2,
688 p_subject in varchar2 default hr_api.g_varchar2,
689 p_grade_attained in varchar2 default hr_api.g_varchar2,
690 p_end_date in date default hr_api.g_date,
691 p_qualification_id in number default hr_api.g_number,
692 p_object_version_number in out nocopy number,
693 p_attribute_category in varchar2 default hr_api.g_varchar2,
694 p_attribute1 in varchar2 default hr_api.g_varchar2,
695 p_attribute2 in varchar2 default hr_api.g_varchar2,
696 p_attribute3 in varchar2 default hr_api.g_varchar2,
697 p_attribute4 in varchar2 default hr_api.g_varchar2,
698 p_attribute5 in varchar2 default hr_api.g_varchar2,
699 p_attribute6 in varchar2 default hr_api.g_varchar2,
700 p_attribute7 in varchar2 default hr_api.g_varchar2,
701 p_attribute8 in varchar2 default hr_api.g_varchar2,
702 p_attribute9 in varchar2 default hr_api.g_varchar2,
703 p_attribute10 in varchar2 default hr_api.g_varchar2,
704 p_attribute11 in varchar2 default hr_api.g_varchar2,
705 p_attribute12 in varchar2 default hr_api.g_varchar2,
706 p_attribute13 in varchar2 default hr_api.g_varchar2,
707 p_attribute14 in varchar2 default hr_api.g_varchar2,
708 p_attribute15 in varchar2 default hr_api.g_varchar2,
709 p_attribute16 in varchar2 default hr_api.g_varchar2,
710 p_attribute17 in varchar2 default hr_api.g_varchar2,
711 p_attribute18 in varchar2 default hr_api.g_varchar2,
712 p_attribute19 in varchar2 default hr_api.g_varchar2,
713 p_attribute20 in varchar2 default hr_api.g_varchar2,
714 p_sub_information_category in varchar2 default hr_api.g_varchar2,
715 p_sub_information1 in varchar2 default hr_api.g_varchar2,
716 p_sub_information2 in varchar2 default hr_api.g_varchar2,
717 p_sub_information3 in varchar2 default hr_api.g_varchar2,
718 p_sub_information4 in varchar2 default hr_api.g_varchar2,
719 p_sub_information5 in varchar2 default hr_api.g_varchar2,
720 p_sub_information6 in varchar2 default hr_api.g_varchar2,
721 p_sub_information7 in varchar2 default hr_api.g_varchar2,
722 p_sub_information8 in varchar2 default hr_api.g_varchar2,
723 p_sub_information9 in varchar2 default hr_api.g_varchar2,
724 p_sub_information10 in varchar2 default hr_api.g_varchar2,
725 p_sub_information11 in varchar2 default hr_api.g_varchar2,
726 p_sub_information12 in varchar2 default hr_api.g_varchar2,
727 p_sub_information13 in varchar2 default hr_api.g_varchar2,
728 p_sub_information14 in varchar2 default hr_api.g_varchar2,
729 p_sub_information15 in varchar2 default hr_api.g_varchar2,
730 p_sub_information16 in varchar2 default hr_api.g_varchar2,
731 p_sub_information17 in varchar2 default hr_api.g_varchar2,
732 p_sub_information18 in varchar2 default hr_api.g_varchar2,
733 p_sub_information19 in varchar2 default hr_api.g_varchar2,
734 p_sub_information20 in varchar2 default hr_api.g_varchar2,
735 p_effective_date in date,
736 p_validate in boolean default false
737 ) is
738 --
739 l_rec per_sub_shd.g_rec_type;
740 l_proc varchar2(72) := g_package||'upd';
741 --
742 Begin
743 hr_utility.set_location('Entering:'||l_proc, 5);
744 --
745 -- Call conversion function to turn arguments into the
746 -- l_rec structure.
747 --
748 l_rec :=
749 per_sub_shd.convert_args
750 (
751 p_subjects_taken_id,
752 p_start_date,
753 p_major,
754 p_subject_status,
755 p_subject,
756 p_grade_attained,
757 p_end_date,
758 p_qualification_id,
759 p_object_version_number,
760 p_attribute_category,
761 p_attribute1,
762 p_attribute2,
763 p_attribute3,
764 p_attribute4,
765 p_attribute5,
766 p_attribute6,
767 p_attribute7,
768 p_attribute8,
769 p_attribute9,
770 p_attribute10,
771 p_attribute11,
772 p_attribute12,
773 p_attribute13,
774 p_attribute14,
775 p_attribute15,
776 p_attribute16,
777 p_attribute17,
778 p_attribute18,
779 p_attribute19,
780 p_attribute20,
781 p_sub_information_category,
782 p_sub_information1,
783 p_sub_information2,
784 p_sub_information3,
785 p_sub_information4,
786 p_sub_information5,
787 p_sub_information6,
788 p_sub_information7,
789 p_sub_information8,
790 p_sub_information9,
791 p_sub_information10,
792 p_sub_information11,
793 p_sub_information12,
794 p_sub_information13,
795 p_sub_information14,
796 p_sub_information15,
797 p_sub_information16,
798 p_sub_information17,
799 p_sub_information18,
800 p_sub_information19,
801 p_sub_information20
802 );
803 --
804 -- Having converted the arguments into the
805 -- plsql record structure we call the corresponding record
806 -- business process.
807 --
808 upd(l_rec, p_effective_date, p_validate);
809 p_object_version_number := l_rec.object_version_number;
810 --
811 hr_utility.set_location(' Leaving:'||l_proc, 10);
812 End upd;
813 --
814 end per_sub_upd;