1 Package Body ben_pty_upd as
2 /* $Header: beptyrhi.pkb 115.7 2002/12/10 15:22:41 bmanyam noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' ben_pty_upd.'; -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |------------------------------< update_dml >------------------------------|
12 -- ----------------------------------------------------------------------------
13 -- {Start Of Comments}
14 --
15 -- Description:
16 -- This procedure controls the actual dml update logic. The processing of
17 -- this procedure is:
18 -- 1) Increment the object_version_number by 1 if the object_version_number
19 -- is defined as an attribute for this entity.
20 -- 2) To set and unset the g_api_dml status as required (as we are about to
21 -- perform dml).
22 -- 3) To update the specified row in the schema using the primary key in
23 -- the predicates.
24 -- 4) To trap any constraint violations that may have occurred.
25 -- 5) To raise any other errors.
26 --
27 -- Prerequisites:
28 -- This is an internal private procedure which must be called from the upd
29 -- procedure.
30 --
31 -- In Parameters:
32 -- A Pl/Sql record structre.
33 --
34 -- Post Success:
35 -- The specified row will be updated in the schema.
36 --
37 -- Post Failure:
38 -- On the update dml failure it is important to note that we always reset the
39 -- g_api_dml status to false.
40 -- If a check, unique or parent integrity constraint violation is raised the
41 -- constraint_error procedure will be called.
42 -- If any other error is reported, the error will be raised after the
43 -- g_api_dml status is reset.
44 --
45 -- Developer Implementation Notes:
46 -- The update 'set' attribute list should be modified if any of your
47 -- attributes are not updateable.
48 --
49 -- Access Status:
50 -- Internal Row Handler Use Only.
51 --
52 -- {End Of Comments}
53 -- ----------------------------------------------------------------------------
54 Procedure update_dml
55 (p_rec in out nocopy ben_pty_shd.g_rec_type
56 ) is
57 --
58 l_proc varchar2(72) := g_package||'update_dml';
59 --
60 Begin
61 hr_utility.set_location('Entering:'||l_proc, 5);
62 --
63 -- Increment the object version
64 p_rec.object_version_number := p_rec.object_version_number + 1;
65 --
66 ben_pty_shd.g_api_dml := true; -- Set the api dml status
67 --
68 -- Update the ben_pl_pcp_typ Row
69 --
70 update ben_pl_pcp_typ
71 set
72 pl_pcp_typ_id = p_rec.pl_pcp_typ_id
73 ,pl_pcp_id = p_rec.pl_pcp_id
74 ,business_group_id = p_rec.business_group_id
75 ,pcp_typ_cd = p_rec.pcp_typ_cd
76 ,min_age = p_rec.min_age
77 ,max_age = p_rec.max_age
78 ,gndr_alwd_cd = p_rec.gndr_alwd_cd
79 ,pty_attribute_category = p_rec.pty_attribute_category
80 ,pty_attribute1 = p_rec.pty_attribute1
81 ,pty_attribute2 = p_rec.pty_attribute2
82 ,pty_attribute3 = p_rec.pty_attribute3
83 ,pty_attribute4 = p_rec.pty_attribute4
84 ,pty_attribute5 = p_rec.pty_attribute5
85 ,pty_attribute6 = p_rec.pty_attribute6
86 ,pty_attribute7 = p_rec.pty_attribute7
87 ,pty_attribute8 = p_rec.pty_attribute8
88 ,pty_attribute9 = p_rec.pty_attribute9
89 ,pty_attribute10 = p_rec.pty_attribute10
90 ,pty_attribute11 = p_rec.pty_attribute11
91 ,pty_attribute12 = p_rec.pty_attribute12
92 ,pty_attribute13 = p_rec.pty_attribute13
93 ,pty_attribute14 = p_rec.pty_attribute14
94 ,pty_attribute15 = p_rec.pty_attribute15
95 ,pty_attribute16 = p_rec.pty_attribute16
96 ,pty_attribute17 = p_rec.pty_attribute17
97 ,pty_attribute18 = p_rec.pty_attribute18
98 ,pty_attribute19 = p_rec.pty_attribute19
99 ,pty_attribute20 = p_rec.pty_attribute20
100 ,pty_attribute21 = p_rec.pty_attribute21
101 ,pty_attribute22 = p_rec.pty_attribute22
102 ,pty_attribute23 = p_rec.pty_attribute23
103 ,pty_attribute24 = p_rec.pty_attribute24
104 ,pty_attribute25 = p_rec.pty_attribute25
105 ,pty_attribute26 = p_rec.pty_attribute26
106 ,pty_attribute27 = p_rec.pty_attribute27
107 ,pty_attribute28 = p_rec.pty_attribute28
108 ,pty_attribute29 = p_rec.pty_attribute29
109 ,pty_attribute30 = p_rec.pty_attribute30
110 ,object_version_number = p_rec.object_version_number
111 where pl_pcp_typ_id = p_rec.pl_pcp_typ_id;
112 --
113 ben_pty_shd.g_api_dml := false; -- Unset the api dml status
114 --
115 hr_utility.set_location(' Leaving:'||l_proc, 10);
116 --
117 Exception
118 When hr_api.check_integrity_violated Then
119 -- A check constraint has been violated
120 ben_pty_shd.g_api_dml := false; -- Unset the api dml status
121 ben_pty_shd.constraint_error
122 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
123 When hr_api.parent_integrity_violated Then
124 -- Parent integrity has been violated
125 ben_pty_shd.g_api_dml := false; -- Unset the api dml status
126 ben_pty_shd.constraint_error
127 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
128 When hr_api.unique_integrity_violated Then
129 -- Unique integrity has been violated
130 ben_pty_shd.g_api_dml := false; -- Unset the api dml status
131 ben_pty_shd.constraint_error
132 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
133 When Others Then
134 ben_pty_shd.g_api_dml := false; -- Unset the api dml status
135 Raise;
136 End update_dml;
137 --
138 -- ----------------------------------------------------------------------------
139 -- |------------------------------< pre_update >------------------------------|
140 -- ----------------------------------------------------------------------------
141 -- {Start Of Comments}
142 --
143 -- Description:
144 -- This private procedure contains any processing which is required before
145 -- the update dml.
146 --
147 -- Prerequisites:
148 -- This is an internal procedure which is called from the upd procedure.
149 --
150 -- In Parameters:
151 -- A Pl/Sql record structure.
152 --
153 -- Post Success:
154 -- Processing continues.
155 --
156 -- Post Failure:
157 -- If an error has occurred, an error message and exception wil be raised
158 -- but not handled.
159 --
160 -- Developer Implementation Notes:
161 -- Any pre-processing required before the update dml is issued should be
162 -- coded within this procedure. It is important to note that any 3rd party
163 -- maintenance should be reviewed before placing in this procedure.
164 --
165 -- Access Status:
166 -- Internal Row Handler Use Only.
167 --
168 -- {End Of Comments}
169 -- ----------------------------------------------------------------------------
170 Procedure pre_update
171 (p_rec in ben_pty_shd.g_rec_type
172 ) is
173 --
174 l_proc varchar2(72) := g_package||'pre_update';
175 --
176 Begin
177 hr_utility.set_location('Entering:'||l_proc, 5);
178 --
179 hr_utility.set_location(' Leaving:'||l_proc, 10);
180 End pre_update;
181 --
182 -- ----------------------------------------------------------------------------
183 -- |-----------------------------< post_update >------------------------------|
184 -- ----------------------------------------------------------------------------
185 -- {Start Of Comments}
186 --
187 -- Description:
188 -- This private procedure contains any processing which is required after the
189 -- update dml.
190 --
191 -- Prerequisites:
192 -- This is an internal procedure which is called from the upd procedure.
193 --
194 -- In Parameters:
195 -- A Pl/Sql record structure.
196 --
197 -- Post Success:
198 -- Processing continues.
199 --
200 -- Post Failure:
201 -- If an error has occurred, an error message and exception will be raised
202 -- but not handled.
203 --
204 -- Developer Implementation Notes:
205 -- Any post-processing required after the update dml is issued should be
206 -- coded within this procedure. It is important to note that any 3rd party
207 -- maintenance should be reviewed before placing in this procedure.
208 --
209 -- Access Status:
210 -- Internal Row Handler Use Only.
211 --
212 -- {End Of Comments}
213 -- ----------------------------------------------------------------------------
214 Procedure post_update
215 (p_rec in ben_pty_shd.g_rec_type
216 ) is
217 --
218 l_proc varchar2(72) := g_package||'post_update';
219 --
220 Begin
221 hr_utility.set_location('Entering:'||l_proc, 5);
222 begin
223 --
224 ben_pty_rku.after_update
225 (p_pl_pcp_typ_id
226 => p_rec.pl_pcp_typ_id
227 ,p_pl_pcp_id
228 => p_rec.pl_pcp_id
229 ,p_business_group_id
230 => p_rec.business_group_id
231 ,p_pcp_typ_cd
232 => p_rec.pcp_typ_cd
233 ,p_min_age
234 => p_rec.min_age
235 ,p_max_age
236 => p_rec.max_age
237 ,p_gndr_alwd_cd
238 => p_rec.gndr_alwd_cd
239 ,p_pty_attribute_category
240 => p_rec.pty_attribute_category
241 ,p_pty_attribute1
242 => p_rec.pty_attribute1
243 ,p_pty_attribute2
244 => p_rec.pty_attribute2
245 ,p_pty_attribute3
246 => p_rec.pty_attribute3
247 ,p_pty_attribute4
248 => p_rec.pty_attribute4
249 ,p_pty_attribute5
250 => p_rec.pty_attribute5
251 ,p_pty_attribute6
252 => p_rec.pty_attribute6
253 ,p_pty_attribute7
254 => p_rec.pty_attribute7
255 ,p_pty_attribute8
256 => p_rec.pty_attribute8
257 ,p_pty_attribute9
258 => p_rec.pty_attribute9
259 ,p_pty_attribute10
260 => p_rec.pty_attribute10
261 ,p_pty_attribute11
262 => p_rec.pty_attribute11
263 ,p_pty_attribute12
264 => p_rec.pty_attribute12
265 ,p_pty_attribute13
266 => p_rec.pty_attribute13
267 ,p_pty_attribute14
268 => p_rec.pty_attribute14
269 ,p_pty_attribute15
270 => p_rec.pty_attribute15
271 ,p_pty_attribute16
272 => p_rec.pty_attribute16
273 ,p_pty_attribute17
274 => p_rec.pty_attribute17
275 ,p_pty_attribute18
276 => p_rec.pty_attribute18
277 ,p_pty_attribute19
278 => p_rec.pty_attribute19
279 ,p_pty_attribute20
280 => p_rec.pty_attribute20
281 ,p_pty_attribute21
282 => p_rec.pty_attribute21
283 ,p_pty_attribute22
284 => p_rec.pty_attribute22
285 ,p_pty_attribute23
286 => p_rec.pty_attribute23
287 ,p_pty_attribute24
288 => p_rec.pty_attribute24
289 ,p_pty_attribute25
290 => p_rec.pty_attribute25
291 ,p_pty_attribute26
292 => p_rec.pty_attribute26
293 ,p_pty_attribute27
294 => p_rec.pty_attribute27
295 ,p_pty_attribute28
296 => p_rec.pty_attribute28
297 ,p_pty_attribute29
298 => p_rec.pty_attribute29
299 ,p_pty_attribute30
300 => p_rec.pty_attribute30
301 ,p_object_version_number
302 => p_rec.object_version_number
303 ,p_pl_pcp_id_o
304 => ben_pty_shd.g_old_rec.pl_pcp_id
305 ,p_business_group_id_o
306 => ben_pty_shd.g_old_rec.business_group_id
307 ,p_pcp_typ_cd_o
308 => ben_pty_shd.g_old_rec.pcp_typ_cd
309 ,p_min_age_o
310 => ben_pty_shd.g_old_rec.min_age
311 ,p_max_age_o
312 => ben_pty_shd.g_old_rec.max_age
313 ,p_gndr_alwd_cd_o
314 => ben_pty_shd.g_old_rec.gndr_alwd_cd
315 ,p_pty_attribute_category_o
316 => ben_pty_shd.g_old_rec.pty_attribute_category
317 ,p_pty_attribute1_o
318 => ben_pty_shd.g_old_rec.pty_attribute1
319 ,p_pty_attribute2_o
320 => ben_pty_shd.g_old_rec.pty_attribute2
321 ,p_pty_attribute3_o
322 => ben_pty_shd.g_old_rec.pty_attribute3
323 ,p_pty_attribute4_o
324 => ben_pty_shd.g_old_rec.pty_attribute4
325 ,p_pty_attribute5_o
326 => ben_pty_shd.g_old_rec.pty_attribute5
327 ,p_pty_attribute6_o
328 => ben_pty_shd.g_old_rec.pty_attribute6
329 ,p_pty_attribute7_o
330 => ben_pty_shd.g_old_rec.pty_attribute7
331 ,p_pty_attribute8_o
332 => ben_pty_shd.g_old_rec.pty_attribute8
333 ,p_pty_attribute9_o
334 => ben_pty_shd.g_old_rec.pty_attribute9
335 ,p_pty_attribute10_o
336 => ben_pty_shd.g_old_rec.pty_attribute10
337 ,p_pty_attribute11_o
338 => ben_pty_shd.g_old_rec.pty_attribute11
339 ,p_pty_attribute12_o
340 => ben_pty_shd.g_old_rec.pty_attribute12
341 ,p_pty_attribute13_o
342 => ben_pty_shd.g_old_rec.pty_attribute13
343 ,p_pty_attribute14_o
344 => ben_pty_shd.g_old_rec.pty_attribute14
345 ,p_pty_attribute15_o
346 => ben_pty_shd.g_old_rec.pty_attribute15
347 ,p_pty_attribute16_o
348 => ben_pty_shd.g_old_rec.pty_attribute16
349 ,p_pty_attribute17_o
350 => ben_pty_shd.g_old_rec.pty_attribute17
351 ,p_pty_attribute18_o
352 => ben_pty_shd.g_old_rec.pty_attribute18
353 ,p_pty_attribute19_o
354 => ben_pty_shd.g_old_rec.pty_attribute19
355 ,p_pty_attribute20_o
356 => ben_pty_shd.g_old_rec.pty_attribute20
357 ,p_pty_attribute21_o
358 => ben_pty_shd.g_old_rec.pty_attribute21
359 ,p_pty_attribute22_o
360 => ben_pty_shd.g_old_rec.pty_attribute22
361 ,p_pty_attribute23_o
362 => ben_pty_shd.g_old_rec.pty_attribute23
363 ,p_pty_attribute24_o
364 => ben_pty_shd.g_old_rec.pty_attribute24
365 ,p_pty_attribute25_o
366 => ben_pty_shd.g_old_rec.pty_attribute25
367 ,p_pty_attribute26_o
368 => ben_pty_shd.g_old_rec.pty_attribute26
369 ,p_pty_attribute27_o
370 => ben_pty_shd.g_old_rec.pty_attribute27
371 ,p_pty_attribute28_o
372 => ben_pty_shd.g_old_rec.pty_attribute28
373 ,p_pty_attribute29_o
374 => ben_pty_shd.g_old_rec.pty_attribute29
375 ,p_pty_attribute30_o
376 => ben_pty_shd.g_old_rec.pty_attribute30
377 ,p_object_version_number_o
378 => ben_pty_shd.g_old_rec.object_version_number
379 );
380 --
381 exception
382 --
383 when hr_api.cannot_find_prog_unit then
384 --
385 hr_api.cannot_find_prog_unit_error
386 (p_module_name => 'BEN_PL_PCP_TYP'
387 ,p_hook_type => 'AU');
388 --
389 end;
390 --
391 hr_utility.set_location(' Leaving:'||l_proc, 10);
392 End post_update;
393 --
394 -- ----------------------------------------------------------------------------
395 -- |-----------------------------< convert_defs >-----------------------------|
396 -- ----------------------------------------------------------------------------
397 -- {Start Of Comments}
398 --
399 -- Description:
400 -- The Convert_Defs procedure has one very important function:
401 -- It must return the record structure for the row with all system defaulted
402 -- values converted into its corresponding parameter value for update. When
403 -- we attempt to update a row through the Upd process , certain
404 -- parameters can be defaulted which enables flexibility in the calling of
405 -- the upd process (e.g. only attributes which need to be updated need to be
406 -- specified). For the upd process to determine which attributes
407 -- have NOT been specified we need to check if the parameter has a reserved
408 -- system default value. Therefore, for all parameters which have a
409 -- corresponding reserved system default mechanism specified we need to
410 -- check if a system default is being used. If a system default is being
411 -- used then we convert the defaulted value into its corresponding attribute
412 -- value held in the g_old_rec data structure.
413 --
414 -- Prerequisites:
415 -- This private function can only be called from the upd process.
416 --
417 -- In Parameters:
418 -- A Pl/Sql record structure.
419 --
420 -- Post Success:
421 -- The record structure will be returned with all system defaulted parameter
422 -- values converted into its current row attribute value.
423 --
424 -- Post Failure:
425 -- No direct error handling is required within this function. Any possible
426 -- errors within this procedure will be a PL/SQL value error due to
427 -- conversion of datatypes or data lengths.
428 --
429 -- Developer Implementation Notes:
430 -- None.
431 --
432 -- Access Status:
433 -- Internal Row Handler Use Only.
434 --
435 -- {End Of Comments}
436 -- ----------------------------------------------------------------------------
437 Procedure convert_defs
438 (p_rec in out nocopy ben_pty_shd.g_rec_type
439 ) is
440 --
441 Begin
442 --
443 -- We must now examine each argument value in the
444 -- p_rec plsql record structure
445 -- to see if a system default is being used. If a system default
446 -- is being used then we must set to the 'current' argument value.
447 --
448 If (p_rec.pl_pcp_id = hr_api.g_number) then
449 p_rec.pl_pcp_id :=
450 ben_pty_shd.g_old_rec.pl_pcp_id;
451 End If;
452 If (p_rec.business_group_id = hr_api.g_number) then
453 p_rec.business_group_id :=
454 ben_pty_shd.g_old_rec.business_group_id;
455 End If;
456 If (p_rec.pcp_typ_cd = hr_api.g_varchar2) then
457 p_rec.pcp_typ_cd :=
458 ben_pty_shd.g_old_rec.pcp_typ_cd;
459 End If;
460 If (p_rec.min_age = hr_api.g_number) then
461 p_rec.min_age :=
462 ben_pty_shd.g_old_rec.min_age;
463 End If;
464 If (p_rec.max_age = hr_api.g_number) then
465 p_rec.max_age :=
466 ben_pty_shd.g_old_rec.max_age;
467 End If;
468 If (p_rec.gndr_alwd_cd = hr_api.g_varchar2) then
469 p_rec.gndr_alwd_cd :=
470 ben_pty_shd.g_old_rec.gndr_alwd_cd;
471 End If;
472 If (p_rec.pty_attribute_category = hr_api.g_varchar2) then
473 p_rec.pty_attribute_category :=
474 ben_pty_shd.g_old_rec.pty_attribute_category;
475 End If;
476 If (p_rec.pty_attribute1 = hr_api.g_varchar2) then
477 p_rec.pty_attribute1 :=
478 ben_pty_shd.g_old_rec.pty_attribute1;
479 End If;
480 If (p_rec.pty_attribute2 = hr_api.g_varchar2) then
481 p_rec.pty_attribute2 :=
482 ben_pty_shd.g_old_rec.pty_attribute2;
483 End If;
484 If (p_rec.pty_attribute3 = hr_api.g_varchar2) then
485 p_rec.pty_attribute3 :=
486 ben_pty_shd.g_old_rec.pty_attribute3;
487 End If;
488 If (p_rec.pty_attribute4 = hr_api.g_varchar2) then
489 p_rec.pty_attribute4 :=
490 ben_pty_shd.g_old_rec.pty_attribute4;
491 End If;
492 If (p_rec.pty_attribute5 = hr_api.g_varchar2) then
493 p_rec.pty_attribute5 :=
494 ben_pty_shd.g_old_rec.pty_attribute5;
495 End If;
496 If (p_rec.pty_attribute6 = hr_api.g_varchar2) then
497 p_rec.pty_attribute6 :=
498 ben_pty_shd.g_old_rec.pty_attribute6;
499 End If;
500 If (p_rec.pty_attribute7 = hr_api.g_varchar2) then
501 p_rec.pty_attribute7 :=
502 ben_pty_shd.g_old_rec.pty_attribute7;
503 End If;
504 If (p_rec.pty_attribute8 = hr_api.g_varchar2) then
505 p_rec.pty_attribute8 :=
506 ben_pty_shd.g_old_rec.pty_attribute8;
507 End If;
508 If (p_rec.pty_attribute9 = hr_api.g_varchar2) then
509 p_rec.pty_attribute9 :=
510 ben_pty_shd.g_old_rec.pty_attribute9;
511 End If;
512 If (p_rec.pty_attribute10 = hr_api.g_varchar2) then
513 p_rec.pty_attribute10 :=
514 ben_pty_shd.g_old_rec.pty_attribute10;
515 End If;
516 If (p_rec.pty_attribute11 = hr_api.g_varchar2) then
517 p_rec.pty_attribute11 :=
518 ben_pty_shd.g_old_rec.pty_attribute11;
519 End If;
520 If (p_rec.pty_attribute12 = hr_api.g_varchar2) then
521 p_rec.pty_attribute12 :=
522 ben_pty_shd.g_old_rec.pty_attribute12;
523 End If;
524 If (p_rec.pty_attribute13 = hr_api.g_varchar2) then
525 p_rec.pty_attribute13 :=
526 ben_pty_shd.g_old_rec.pty_attribute13;
527 End If;
528 If (p_rec.pty_attribute14 = hr_api.g_varchar2) then
529 p_rec.pty_attribute14 :=
530 ben_pty_shd.g_old_rec.pty_attribute14;
531 End If;
532 If (p_rec.pty_attribute15 = hr_api.g_varchar2) then
533 p_rec.pty_attribute15 :=
534 ben_pty_shd.g_old_rec.pty_attribute15;
535 End If;
536 If (p_rec.pty_attribute16 = hr_api.g_varchar2) then
537 p_rec.pty_attribute16 :=
538 ben_pty_shd.g_old_rec.pty_attribute16;
539 End If;
540 If (p_rec.pty_attribute17 = hr_api.g_varchar2) then
541 p_rec.pty_attribute17 :=
542 ben_pty_shd.g_old_rec.pty_attribute17;
543 End If;
544 If (p_rec.pty_attribute18 = hr_api.g_varchar2) then
545 p_rec.pty_attribute18 :=
546 ben_pty_shd.g_old_rec.pty_attribute18;
547 End If;
548 If (p_rec.pty_attribute19 = hr_api.g_varchar2) then
549 p_rec.pty_attribute19 :=
550 ben_pty_shd.g_old_rec.pty_attribute19;
551 End If;
552 If (p_rec.pty_attribute20 = hr_api.g_varchar2) then
553 p_rec.pty_attribute20 :=
554 ben_pty_shd.g_old_rec.pty_attribute20;
555 End If;
556 If (p_rec.pty_attribute21 = hr_api.g_varchar2) then
557 p_rec.pty_attribute21 :=
558 ben_pty_shd.g_old_rec.pty_attribute21;
559 End If;
560 If (p_rec.pty_attribute22 = hr_api.g_varchar2) then
561 p_rec.pty_attribute22 :=
562 ben_pty_shd.g_old_rec.pty_attribute22;
563 End If;
564 If (p_rec.pty_attribute23 = hr_api.g_varchar2) then
565 p_rec.pty_attribute23 :=
566 ben_pty_shd.g_old_rec.pty_attribute23;
567 End If;
568 If (p_rec.pty_attribute24 = hr_api.g_varchar2) then
569 p_rec.pty_attribute24 :=
570 ben_pty_shd.g_old_rec.pty_attribute24;
571 End If;
572 If (p_rec.pty_attribute25 = hr_api.g_varchar2) then
573 p_rec.pty_attribute25 :=
574 ben_pty_shd.g_old_rec.pty_attribute25;
575 End If;
576 If (p_rec.pty_attribute26 = hr_api.g_varchar2) then
577 p_rec.pty_attribute26 :=
578 ben_pty_shd.g_old_rec.pty_attribute26;
579 End If;
580 If (p_rec.pty_attribute27 = hr_api.g_varchar2) then
581 p_rec.pty_attribute27 :=
582 ben_pty_shd.g_old_rec.pty_attribute27;
583 End If;
584 If (p_rec.pty_attribute28 = hr_api.g_varchar2) then
585 p_rec.pty_attribute28 :=
586 ben_pty_shd.g_old_rec.pty_attribute28;
587 End If;
588 If (p_rec.pty_attribute29 = hr_api.g_varchar2) then
589 p_rec.pty_attribute29 :=
590 ben_pty_shd.g_old_rec.pty_attribute29;
591 End If;
592 If (p_rec.pty_attribute30 = hr_api.g_varchar2) then
593 p_rec.pty_attribute30 :=
594 ben_pty_shd.g_old_rec.pty_attribute30;
595 End If;
596 --
597 End convert_defs;
598 --
599 -- ----------------------------------------------------------------------------
600 -- |---------------------------------< upd >----------------------------------|
601 -- ----------------------------------------------------------------------------
602 Procedure upd
603 (p_effective_date in date,
604 p_rec in out nocopy ben_pty_shd.g_rec_type
605 ) is
606 --
607 l_proc varchar2(72) := g_package||'upd';
608 --
609 Begin
610 hr_utility.set_location('Entering:'||l_proc, 5);
611 --
612 -- We must lock the row which we need to update.
613 --
614 ben_pty_shd.lck
615 (p_rec.pl_pcp_typ_id
616 ,p_rec.object_version_number
617 );
618 --
619 -- 1. During an update system defaults are used to determine if
620 -- arguments have been defaulted or not. We must therefore
621 -- derive the full record structure values to be updated.
622 --
623 -- 2. Call the supporting update validate operations.
624 --
625 convert_defs(p_rec);
626 ben_pty_bus.update_validate
627 (p_rec, p_effective_date
628 );
629 --
630 -- Call the supporting pre-update operation
631 --
632 ben_pty_upd.pre_update(p_rec);
633 --
634 -- Update the row.
635 --
636 ben_pty_upd.update_dml(p_rec);
637 --
638 -- Call the supporting post-update operation
639 --
640 ben_pty_upd.post_update
641 (p_rec
642 );
643 End upd;
644 --
645 -- ----------------------------------------------------------------------------
646 -- |---------------------------------< upd >----------------------------------|
647 -- ----------------------------------------------------------------------------
648 Procedure upd
649 (p_effective_date in date
650 ,p_pl_pcp_typ_id in number
651 ,p_object_version_number in out nocopy number
652 ,p_pl_pcp_id in number default hr_api.g_number
653 ,p_business_group_id in number default hr_api.g_number
654 ,p_pcp_typ_cd in varchar2 default hr_api.g_varchar2
655 ,p_min_age in number default hr_api.g_number
656 ,p_max_age in number default hr_api.g_number
657 ,p_gndr_alwd_cd in varchar2 default hr_api.g_varchar2
658 ,p_pty_attribute_category in varchar2 default hr_api.g_varchar2
659 ,p_pty_attribute1 in varchar2 default hr_api.g_varchar2
660 ,p_pty_attribute2 in varchar2 default hr_api.g_varchar2
661 ,p_pty_attribute3 in varchar2 default hr_api.g_varchar2
662 ,p_pty_attribute4 in varchar2 default hr_api.g_varchar2
663 ,p_pty_attribute5 in varchar2 default hr_api.g_varchar2
664 ,p_pty_attribute6 in varchar2 default hr_api.g_varchar2
665 ,p_pty_attribute7 in varchar2 default hr_api.g_varchar2
666 ,p_pty_attribute8 in varchar2 default hr_api.g_varchar2
667 ,p_pty_attribute9 in varchar2 default hr_api.g_varchar2
668 ,p_pty_attribute10 in varchar2 default hr_api.g_varchar2
669 ,p_pty_attribute11 in varchar2 default hr_api.g_varchar2
670 ,p_pty_attribute12 in varchar2 default hr_api.g_varchar2
671 ,p_pty_attribute13 in varchar2 default hr_api.g_varchar2
672 ,p_pty_attribute14 in varchar2 default hr_api.g_varchar2
673 ,p_pty_attribute15 in varchar2 default hr_api.g_varchar2
674 ,p_pty_attribute16 in varchar2 default hr_api.g_varchar2
675 ,p_pty_attribute17 in varchar2 default hr_api.g_varchar2
676 ,p_pty_attribute18 in varchar2 default hr_api.g_varchar2
677 ,p_pty_attribute19 in varchar2 default hr_api.g_varchar2
678 ,p_pty_attribute20 in varchar2 default hr_api.g_varchar2
679 ,p_pty_attribute21 in varchar2 default hr_api.g_varchar2
680 ,p_pty_attribute22 in varchar2 default hr_api.g_varchar2
681 ,p_pty_attribute23 in varchar2 default hr_api.g_varchar2
682 ,p_pty_attribute24 in varchar2 default hr_api.g_varchar2
683 ,p_pty_attribute25 in varchar2 default hr_api.g_varchar2
684 ,p_pty_attribute26 in varchar2 default hr_api.g_varchar2
685 ,p_pty_attribute27 in varchar2 default hr_api.g_varchar2
686 ,p_pty_attribute28 in varchar2 default hr_api.g_varchar2
687 ,p_pty_attribute29 in varchar2 default hr_api.g_varchar2
688 ,p_pty_attribute30 in varchar2 default hr_api.g_varchar2
689 ) is
690 --
691 l_rec ben_pty_shd.g_rec_type;
692 l_proc varchar2(72) := g_package||'upd';
693 --
694 Begin
695 hr_utility.set_location('Entering:'||l_proc, 5);
696 --
697 -- Call conversion function to turn arguments into the
698 -- l_rec structure.
699 --
700 l_rec :=
701 ben_pty_shd.convert_args
702 (p_pl_pcp_typ_id
703 ,p_pl_pcp_id
704 ,p_business_group_id
705 ,p_pcp_typ_cd
706 ,p_min_age
707 ,p_max_age
708 ,p_gndr_alwd_cd
709 ,p_pty_attribute_category
710 ,p_pty_attribute1
711 ,p_pty_attribute2
712 ,p_pty_attribute3
713 ,p_pty_attribute4
714 ,p_pty_attribute5
715 ,p_pty_attribute6
716 ,p_pty_attribute7
717 ,p_pty_attribute8
718 ,p_pty_attribute9
719 ,p_pty_attribute10
720 ,p_pty_attribute11
721 ,p_pty_attribute12
722 ,p_pty_attribute13
723 ,p_pty_attribute14
724 ,p_pty_attribute15
725 ,p_pty_attribute16
726 ,p_pty_attribute17
727 ,p_pty_attribute18
728 ,p_pty_attribute19
729 ,p_pty_attribute20
730 ,p_pty_attribute21
731 ,p_pty_attribute22
732 ,p_pty_attribute23
733 ,p_pty_attribute24
734 ,p_pty_attribute25
735 ,p_pty_attribute26
736 ,p_pty_attribute27
737 ,p_pty_attribute28
738 ,p_pty_attribute29
739 ,p_pty_attribute30
740 ,p_object_version_number
741 );
742 --
743 -- Having converted the arguments into the
744 -- plsql record structure we call the corresponding record
745 -- business process.
746 --
747 ben_pty_upd.upd
748 (p_effective_date, l_rec
749 );
750 p_object_version_number := l_rec.object_version_number;
751 --
752 hr_utility.set_location(' Leaving:'||l_proc, 10);
753 End upd;
754 --
755 end ben_pty_upd;