1 Package Body ben_cwg_upd as
2 /* $Header: becwgrhi.pkb 120.0 2005/05/28 01:29:54 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' ben_cwg_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_cwg_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 --
67 --
68 -- Update the ben_cwb_wksht_grp Row
69 --
70 update ben_cwb_wksht_grp
71 set
72 cwb_wksht_grp_id = p_rec.cwb_wksht_grp_id
73 ,ordr_num = p_rec.ordr_num
74 ,wksht_grp_cd = p_rec.wksht_grp_cd
75 ,label = p_rec.label
76 ,cwg_attribute_category = p_rec.cwg_attribute_category
77 ,cwg_attribute1 = p_rec.cwg_attribute1
78 ,cwg_attribute2 = p_rec.cwg_attribute2
79 ,cwg_attribute3 = p_rec.cwg_attribute3
80 ,cwg_attribute4 = p_rec.cwg_attribute4
81 ,cwg_attribute5 = p_rec.cwg_attribute5
82 ,cwg_attribute6 = p_rec.cwg_attribute6
83 ,cwg_attribute7 = p_rec.cwg_attribute7
84 ,cwg_attribute8 = p_rec.cwg_attribute8
85 ,cwg_attribute9 = p_rec.cwg_attribute9
86 ,cwg_attribute10 = p_rec.cwg_attribute10
87 ,cwg_attribute11 = p_rec.cwg_attribute11
88 ,cwg_attribute12 = p_rec.cwg_attribute12
89 ,cwg_attribute13 = p_rec.cwg_attribute13
90 ,cwg_attribute14 = p_rec.cwg_attribute14
91 ,cwg_attribute15 = p_rec.cwg_attribute15
92 ,cwg_attribute16 = p_rec.cwg_attribute16
93 ,cwg_attribute17 = p_rec.cwg_attribute17
94 ,cwg_attribute18 = p_rec.cwg_attribute18
95 ,cwg_attribute19 = p_rec.cwg_attribute19
96 ,cwg_attribute20 = p_rec.cwg_attribute20
97 ,cwg_attribute21 = p_rec.cwg_attribute21
98 ,cwg_attribute22 = p_rec.cwg_attribute22
99 ,cwg_attribute23 = p_rec.cwg_attribute23
100 ,cwg_attribute24 = p_rec.cwg_attribute24
101 ,cwg_attribute25 = p_rec.cwg_attribute25
102 ,cwg_attribute26 = p_rec.cwg_attribute26
103 ,cwg_attribute27 = p_rec.cwg_attribute27
104 ,cwg_attribute28 = p_rec.cwg_attribute28
105 ,cwg_attribute29 = p_rec.cwg_attribute29
106 ,cwg_attribute30 = p_rec.cwg_attribute30
107 ,status_cd = p_rec.status_cd
108 ,hidden_cd = p_rec.hidden_cd
109 ,object_version_number = p_rec.object_version_number
110 where cwb_wksht_grp_id = p_rec.cwb_wksht_grp_id;
111 --
112 --
113 --
114 hr_utility.set_location(' Leaving:'||l_proc, 10);
115 --
116 Exception
117 When hr_api.check_integrity_violated Then
118 -- A check constraint has been violated
119 --
120 ben_cwg_shd.constraint_error
121 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
122 When hr_api.parent_integrity_violated Then
123 -- Parent integrity has been violated
124 --
125 ben_cwg_shd.constraint_error
126 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
127 When hr_api.unique_integrity_violated Then
128 -- Unique integrity has been violated
129 --
130 ben_cwg_shd.constraint_error
131 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
132 When Others Then
133 --
134 Raise;
135 End update_dml;
136 --
137 -- ----------------------------------------------------------------------------
138 -- |------------------------------< pre_update >------------------------------|
139 -- ----------------------------------------------------------------------------
140 -- {Start Of Comments}
141 --
142 -- Description:
143 -- This private procedure contains any processing which is required before
144 -- the update dml.
145 --
146 -- Prerequisites:
147 -- This is an internal procedure which is called from the upd procedure.
148 --
149 -- In Parameters:
150 -- A Pl/Sql record structure.
151 --
152 -- Post Success:
153 -- Processing continues.
154 --
155 -- Post Failure:
156 -- If an error has occurred, an error message and exception wil be raised
157 -- but not handled.
158 --
159 -- Developer Implementation Notes:
160 -- Any pre-processing required before the update dml is issued should be
161 -- coded within this procedure. It is important to note that any 3rd party
162 -- maintenance should be reviewed before placing in this procedure.
163 --
164 -- Access Status:
165 -- Internal Row Handler Use Only.
166 --
167 -- {End Of Comments}
168 -- ----------------------------------------------------------------------------
169 Procedure pre_update
170 (p_rec in ben_cwg_shd.g_rec_type
171 ) is
172 --
173 l_proc varchar2(72) := g_package||'pre_update';
174 --
175 Begin
176 hr_utility.set_location('Entering:'||l_proc, 5);
177 --
178 hr_utility.set_location(' Leaving:'||l_proc, 10);
179 End pre_update;
180 --
181 -- ----------------------------------------------------------------------------
182 -- |-----------------------------< post_update >------------------------------|
183 -- ----------------------------------------------------------------------------
184 -- {Start Of Comments}
185 --
186 -- Description:
187 -- This private procedure contains any processing which is required after
188 -- the update dml.
189 --
190 -- Prerequisites:
191 -- This is an internal procedure which is called from the upd procedure.
192 --
193 -- In Parameters:
194 -- A Pl/Sql record structure.
195 --
196 -- Post Success:
197 -- Processing continues.
198 --
199 -- Post Failure:
200 -- If an error has occurred, an error message and exception will be raised
201 -- but not handled.
202 --
203 -- Developer Implementation Notes:
204 -- Any post-processing required after the update dml is issued should be
205 -- coded within this procedure. It is important to note that any 3rd party
206 -- maintenance should be reviewed before placing in this procedure.
207 --
208 -- Access Status:
209 -- Internal Row Handler Use Only.
210 --
211 -- {End Of Comments}
212 -- ----------------------------------------------------------------------------
213 Procedure post_update
214 (p_effective_date in date
215 ,p_rec in ben_cwg_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_cwg_rku.after_update
225 (p_effective_date => p_effective_date
226 ,p_cwb_wksht_grp_id
227 => p_rec.cwb_wksht_grp_id
228 ,p_ordr_num
229 => p_rec.ordr_num
230 ,p_wksht_grp_cd
231 => p_rec.wksht_grp_cd
232 ,p_label
233 => p_rec.label
234 ,p_cwg_attribute_category
235 => p_rec.cwg_attribute_category
236 ,p_cwg_attribute1
237 => p_rec.cwg_attribute1
238 ,p_cwg_attribute2
239 => p_rec.cwg_attribute2
240 ,p_cwg_attribute3
241 => p_rec.cwg_attribute3
242 ,p_cwg_attribute4
243 => p_rec.cwg_attribute4
244 ,p_cwg_attribute5
245 => p_rec.cwg_attribute5
246 ,p_cwg_attribute6
247 => p_rec.cwg_attribute6
248 ,p_cwg_attribute7
249 => p_rec.cwg_attribute7
250 ,p_cwg_attribute8
251 => p_rec.cwg_attribute8
252 ,p_cwg_attribute9
253 => p_rec.cwg_attribute9
254 ,p_cwg_attribute10
255 => p_rec.cwg_attribute10
256 ,p_cwg_attribute11
257 => p_rec.cwg_attribute11
258 ,p_cwg_attribute12
259 => p_rec.cwg_attribute12
260 ,p_cwg_attribute13
261 => p_rec.cwg_attribute13
262 ,p_cwg_attribute14
263 => p_rec.cwg_attribute14
264 ,p_cwg_attribute15
265 => p_rec.cwg_attribute15
266 ,p_cwg_attribute16
267 => p_rec.cwg_attribute16
268 ,p_cwg_attribute17
269 => p_rec.cwg_attribute17
270 ,p_cwg_attribute18
271 => p_rec.cwg_attribute18
272 ,p_cwg_attribute19
273 => p_rec.cwg_attribute19
274 ,p_cwg_attribute20
275 => p_rec.cwg_attribute20
276 ,p_cwg_attribute21
277 => p_rec.cwg_attribute21
278 ,p_cwg_attribute22
279 => p_rec.cwg_attribute22
280 ,p_cwg_attribute23
281 => p_rec.cwg_attribute23
282 ,p_cwg_attribute24
283 => p_rec.cwg_attribute24
284 ,p_cwg_attribute25
285 => p_rec.cwg_attribute25
286 ,p_cwg_attribute26
287 => p_rec.cwg_attribute26
288 ,p_cwg_attribute27
289 => p_rec.cwg_attribute27
290 ,p_cwg_attribute28
291 => p_rec.cwg_attribute28
292 ,p_cwg_attribute29
293 => p_rec.cwg_attribute29
294 ,p_cwg_attribute30 => p_rec.cwg_attribute30
295 ,p_status_cd => p_rec.status_cd
296 ,p_hidden_cd => p_rec.hidden_cd
297 ,p_object_version_number
298 => p_rec.object_version_number
299 ,p_business_group_id_o
300 => ben_cwg_shd.g_old_rec.business_group_id
301 ,p_pl_id_o
302 => ben_cwg_shd.g_old_rec.pl_id
303 ,p_ordr_num_o
304 => ben_cwg_shd.g_old_rec.ordr_num
305 ,p_wksht_grp_cd_o
306 => ben_cwg_shd.g_old_rec.wksht_grp_cd
307 ,p_label_o
308 => ben_cwg_shd.g_old_rec.label
309 ,p_cwg_attribute_category_o
310 => ben_cwg_shd.g_old_rec.cwg_attribute_category
311 ,p_cwg_attribute1_o
312 => ben_cwg_shd.g_old_rec.cwg_attribute1
313 ,p_cwg_attribute2_o
314 => ben_cwg_shd.g_old_rec.cwg_attribute2
315 ,p_cwg_attribute3_o
316 => ben_cwg_shd.g_old_rec.cwg_attribute3
317 ,p_cwg_attribute4_o
318 => ben_cwg_shd.g_old_rec.cwg_attribute4
319 ,p_cwg_attribute5_o
320 => ben_cwg_shd.g_old_rec.cwg_attribute5
321 ,p_cwg_attribute6_o
322 => ben_cwg_shd.g_old_rec.cwg_attribute6
323 ,p_cwg_attribute7_o
324 => ben_cwg_shd.g_old_rec.cwg_attribute7
325 ,p_cwg_attribute8_o
326 => ben_cwg_shd.g_old_rec.cwg_attribute8
327 ,p_cwg_attribute9_o
328 => ben_cwg_shd.g_old_rec.cwg_attribute9
329 ,p_cwg_attribute10_o
330 => ben_cwg_shd.g_old_rec.cwg_attribute10
331 ,p_cwg_attribute11_o
332 => ben_cwg_shd.g_old_rec.cwg_attribute11
333 ,p_cwg_attribute12_o
334 => ben_cwg_shd.g_old_rec.cwg_attribute12
335 ,p_cwg_attribute13_o
336 => ben_cwg_shd.g_old_rec.cwg_attribute13
337 ,p_cwg_attribute14_o
338 => ben_cwg_shd.g_old_rec.cwg_attribute14
339 ,p_cwg_attribute15_o
340 => ben_cwg_shd.g_old_rec.cwg_attribute15
341 ,p_cwg_attribute16_o
342 => ben_cwg_shd.g_old_rec.cwg_attribute16
343 ,p_cwg_attribute17_o
344 => ben_cwg_shd.g_old_rec.cwg_attribute17
345 ,p_cwg_attribute18_o
346 => ben_cwg_shd.g_old_rec.cwg_attribute18
347 ,p_cwg_attribute19_o
348 => ben_cwg_shd.g_old_rec.cwg_attribute19
349 ,p_cwg_attribute20_o
350 => ben_cwg_shd.g_old_rec.cwg_attribute20
351 ,p_cwg_attribute21_o
352 => ben_cwg_shd.g_old_rec.cwg_attribute21
353 ,p_cwg_attribute22_o
354 => ben_cwg_shd.g_old_rec.cwg_attribute22
355 ,p_cwg_attribute23_o
356 => ben_cwg_shd.g_old_rec.cwg_attribute23
357 ,p_cwg_attribute24_o
358 => ben_cwg_shd.g_old_rec.cwg_attribute24
359 ,p_cwg_attribute25_o
360 => ben_cwg_shd.g_old_rec.cwg_attribute25
361 ,p_cwg_attribute26_o
362 => ben_cwg_shd.g_old_rec.cwg_attribute26
363 ,p_cwg_attribute27_o
364 => ben_cwg_shd.g_old_rec.cwg_attribute27
365 ,p_cwg_attribute28_o
366 => ben_cwg_shd.g_old_rec.cwg_attribute28
367 ,p_cwg_attribute29_o
368 => ben_cwg_shd.g_old_rec.cwg_attribute29
369 ,p_cwg_attribute30_o => ben_cwg_shd.g_old_rec.cwg_attribute30
370 ,p_status_cd_o => ben_cwg_shd.g_old_rec.status_cd
371 ,p_hidden_cd_o => ben_cwg_shd.g_old_rec.hidden_cd
372 ,p_object_version_number_o => ben_cwg_shd.g_old_rec.object_version_number
373 );
374 --
375 exception
376 --
377 when hr_api.cannot_find_prog_unit then
378 --
379 hr_api.cannot_find_prog_unit_error
380 (p_module_name => 'BEN_CWB_WKSHT_GRP'
381 ,p_hook_type => 'AU');
382 --
383 end;
384 --
385 hr_utility.set_location(' Leaving:'||l_proc, 10);
386 End post_update;
387 --
388 -- ----------------------------------------------------------------------------
389 -- |-----------------------------< convert_defs >-----------------------------|
390 -- ----------------------------------------------------------------------------
391 -- {Start Of Comments}
392 --
393 -- Description:
394 -- The Convert_Defs procedure has one very important function:
395 -- It must return the record structure for the row with all system defaulted
396 -- values converted into its corresponding parameter value for update. When
397 -- we attempt to update a row through the Upd process , certain
398 -- parameters can be defaulted which enables flexibility in the calling of
399 -- the upd process (e.g. only attributes which need to be updated need to be
400 -- specified). For the upd process to determine which attributes
401 -- have NOT been specified we need to check if the parameter has a reserved
402 -- system default value. Therefore, for all parameters which have a
403 -- corresponding reserved system default mechanism specified we need to
404 -- check if a system default is being used. If a system default is being
405 -- used then we convert the defaulted value into its corresponding attribute
406 -- value held in the g_old_rec data structure.
407 --
408 -- Prerequisites:
409 -- This private function can only be called from the upd process.
410 --
411 -- In Parameters:
412 -- A Pl/Sql record structure.
413 --
414 -- Post Success:
415 -- The record structure will be returned with all system defaulted parameter
416 -- values converted into its current row attribute value.
417 --
418 -- Post Failure:
419 -- No direct error handling is required within this function. Any possible
420 -- errors within this procedure will be a PL/SQL value error due to
421 -- conversion of datatypes or data lengths.
422 --
423 -- Developer Implementation Notes:
424 -- None.
425 --
426 -- Access Status:
427 -- Internal Row Handler Use Only.
428 --
429 -- {End Of Comments}
430 -- ----------------------------------------------------------------------------
431 Procedure convert_defs
432 (p_rec in out nocopy ben_cwg_shd.g_rec_type
433 ) is
434 --
435 Begin
436 --
437 -- We must now examine each argument value in the
438 -- p_rec plsql record structure
439 -- to see if a system default is being used. If a system default
440 -- is being used then we must set to the 'current' argument value.
441 --
442 If (p_rec.business_group_id = hr_api.g_number) then
443 p_rec.business_group_id :=
444 ben_cwg_shd.g_old_rec.business_group_id;
445 End If;
446 If (p_rec.pl_id = hr_api.g_number) then
447 p_rec.pl_id :=
448 ben_cwg_shd.g_old_rec.pl_id;
449 End If;
450 If (p_rec.ordr_num = hr_api.g_number) then
451 p_rec.ordr_num :=
452 ben_cwg_shd.g_old_rec.ordr_num;
453 End If;
454 If (p_rec.wksht_grp_cd = hr_api.g_varchar2) then
455 p_rec.wksht_grp_cd :=
456 ben_cwg_shd.g_old_rec.wksht_grp_cd;
457 End If;
458 If (p_rec.label = hr_api.g_varchar2) then
459 p_rec.label :=
460 ben_cwg_shd.g_old_rec.label;
461 End If;
462 If (p_rec.cwg_attribute_category = hr_api.g_varchar2) then
463 p_rec.cwg_attribute_category :=
464 ben_cwg_shd.g_old_rec.cwg_attribute_category;
465 End If;
466 If (p_rec.cwg_attribute1 = hr_api.g_varchar2) then
467 p_rec.cwg_attribute1 :=
468 ben_cwg_shd.g_old_rec.cwg_attribute1;
469 End If;
470 If (p_rec.cwg_attribute2 = hr_api.g_varchar2) then
471 p_rec.cwg_attribute2 :=
472 ben_cwg_shd.g_old_rec.cwg_attribute2;
473 End If;
474 If (p_rec.cwg_attribute3 = hr_api.g_varchar2) then
475 p_rec.cwg_attribute3 :=
476 ben_cwg_shd.g_old_rec.cwg_attribute3;
477 End If;
478 If (p_rec.cwg_attribute4 = hr_api.g_varchar2) then
479 p_rec.cwg_attribute4 :=
480 ben_cwg_shd.g_old_rec.cwg_attribute4;
481 End If;
482 If (p_rec.cwg_attribute5 = hr_api.g_varchar2) then
483 p_rec.cwg_attribute5 :=
484 ben_cwg_shd.g_old_rec.cwg_attribute5;
485 End If;
486 If (p_rec.cwg_attribute6 = hr_api.g_varchar2) then
487 p_rec.cwg_attribute6 :=
488 ben_cwg_shd.g_old_rec.cwg_attribute6;
489 End If;
490 If (p_rec.cwg_attribute7 = hr_api.g_varchar2) then
491 p_rec.cwg_attribute7 :=
492 ben_cwg_shd.g_old_rec.cwg_attribute7;
493 End If;
494 If (p_rec.cwg_attribute8 = hr_api.g_varchar2) then
495 p_rec.cwg_attribute8 :=
496 ben_cwg_shd.g_old_rec.cwg_attribute8;
497 End If;
498 If (p_rec.cwg_attribute9 = hr_api.g_varchar2) then
499 p_rec.cwg_attribute9 :=
500 ben_cwg_shd.g_old_rec.cwg_attribute9;
501 End If;
502 If (p_rec.cwg_attribute10 = hr_api.g_varchar2) then
503 p_rec.cwg_attribute10 :=
504 ben_cwg_shd.g_old_rec.cwg_attribute10;
505 End If;
506 If (p_rec.cwg_attribute11 = hr_api.g_varchar2) then
507 p_rec.cwg_attribute11 :=
508 ben_cwg_shd.g_old_rec.cwg_attribute11;
509 End If;
510 If (p_rec.cwg_attribute12 = hr_api.g_varchar2) then
511 p_rec.cwg_attribute12 :=
512 ben_cwg_shd.g_old_rec.cwg_attribute12;
513 End If;
514 If (p_rec.cwg_attribute13 = hr_api.g_varchar2) then
515 p_rec.cwg_attribute13 :=
516 ben_cwg_shd.g_old_rec.cwg_attribute13;
517 End If;
518 If (p_rec.cwg_attribute14 = hr_api.g_varchar2) then
519 p_rec.cwg_attribute14 :=
520 ben_cwg_shd.g_old_rec.cwg_attribute14;
521 End If;
522 If (p_rec.cwg_attribute15 = hr_api.g_varchar2) then
523 p_rec.cwg_attribute15 :=
524 ben_cwg_shd.g_old_rec.cwg_attribute15;
525 End If;
526 If (p_rec.cwg_attribute16 = hr_api.g_varchar2) then
527 p_rec.cwg_attribute16 :=
528 ben_cwg_shd.g_old_rec.cwg_attribute16;
529 End If;
530 If (p_rec.cwg_attribute17 = hr_api.g_varchar2) then
531 p_rec.cwg_attribute17 :=
532 ben_cwg_shd.g_old_rec.cwg_attribute17;
533 End If;
534 If (p_rec.cwg_attribute18 = hr_api.g_varchar2) then
535 p_rec.cwg_attribute18 :=
536 ben_cwg_shd.g_old_rec.cwg_attribute18;
537 End If;
538 If (p_rec.cwg_attribute19 = hr_api.g_varchar2) then
539 p_rec.cwg_attribute19 :=
540 ben_cwg_shd.g_old_rec.cwg_attribute19;
541 End If;
542 If (p_rec.cwg_attribute20 = hr_api.g_varchar2) then
543 p_rec.cwg_attribute20 :=
544 ben_cwg_shd.g_old_rec.cwg_attribute20;
545 End If;
546 If (p_rec.cwg_attribute21 = hr_api.g_varchar2) then
547 p_rec.cwg_attribute21 :=
548 ben_cwg_shd.g_old_rec.cwg_attribute21;
549 End If;
550 If (p_rec.cwg_attribute22 = hr_api.g_varchar2) then
551 p_rec.cwg_attribute22 :=
552 ben_cwg_shd.g_old_rec.cwg_attribute22;
553 End If;
554 If (p_rec.cwg_attribute23 = hr_api.g_varchar2) then
555 p_rec.cwg_attribute23 :=
556 ben_cwg_shd.g_old_rec.cwg_attribute23;
557 End If;
558 If (p_rec.cwg_attribute24 = hr_api.g_varchar2) then
559 p_rec.cwg_attribute24 :=
560 ben_cwg_shd.g_old_rec.cwg_attribute24;
561 End If;
562 If (p_rec.cwg_attribute25 = hr_api.g_varchar2) then
563 p_rec.cwg_attribute25 :=
564 ben_cwg_shd.g_old_rec.cwg_attribute25;
565 End If;
566 If (p_rec.cwg_attribute26 = hr_api.g_varchar2) then
567 p_rec.cwg_attribute26 :=
568 ben_cwg_shd.g_old_rec.cwg_attribute26;
569 End If;
570 If (p_rec.cwg_attribute27 = hr_api.g_varchar2) then
571 p_rec.cwg_attribute27 :=
572 ben_cwg_shd.g_old_rec.cwg_attribute27;
573 End If;
574 If (p_rec.cwg_attribute28 = hr_api.g_varchar2) then
575 p_rec.cwg_attribute28 :=
576 ben_cwg_shd.g_old_rec.cwg_attribute28;
577 End If;
578 If (p_rec.cwg_attribute29 = hr_api.g_varchar2) then
579 p_rec.cwg_attribute29 :=
580 ben_cwg_shd.g_old_rec.cwg_attribute29;
581 End If;
582 If (p_rec.cwg_attribute30 = hr_api.g_varchar2) then
583 p_rec.cwg_attribute30 :=
584 ben_cwg_shd.g_old_rec.cwg_attribute30;
585 End If;
586
587 --
588 If (p_rec.status_cd = hr_api.g_varchar2) then
589 p_rec.status_cd := ben_cwg_shd.g_old_rec.status_cd;
590 End If;
591
592 If (p_rec.hidden_cd = hr_api.g_varchar2) then
593 p_rec.hidden_cd := ben_cwg_shd.g_old_rec.hidden_cd;
594 End If;
595
596 End convert_defs;
597 --
598 -- ----------------------------------------------------------------------------
599 -- |---------------------------------< upd >----------------------------------|
600 -- ----------------------------------------------------------------------------
601 Procedure upd
602 (p_effective_date in date
603 ,p_rec in out nocopy ben_cwg_shd.g_rec_type
604 ) is
605 --
606 l_proc varchar2(72) := g_package||'upd';
607 --
608 Begin
609 hr_utility.set_location('Entering:'||l_proc, 5);
610 --
611 -- We must lock the row which we need to update.
612 --
613 ben_cwg_shd.lck
614 (p_rec.cwb_wksht_grp_id
615 ,p_rec.object_version_number
616 );
617 --
618 -- 1. During an update system defaults are used to determine if
619 -- arguments have been defaulted or not. We must therefore
620 -- derive the full record structure values to be updated.
621 --
622 -- 2. Call the supporting update validate operations.
623 --
624 convert_defs(p_rec);
625 ben_cwg_bus.update_validate
626 (p_effective_date
627 ,p_rec
628 );
629 --
630 -- Call to raise any errors on multi-message list
631 hr_multi_message.end_validation_set;
632 --
633 -- Call the supporting pre-update operation
634 --
635 ben_cwg_upd.pre_update(p_rec);
636 --
637 -- Update the row.
638 --
639 ben_cwg_upd.update_dml(p_rec);
640 --
641 -- Call the supporting post-update operation
642 --
643 ben_cwg_upd.post_update
644 (p_effective_date
645 ,p_rec
646 );
647 --
648 -- Call to raise any errors on multi-message list
649 hr_multi_message.end_validation_set;
650 End upd;
651 --
652 -- ----------------------------------------------------------------------------
653 -- |---------------------------------< upd >----------------------------------|
654 -- ----------------------------------------------------------------------------
655 Procedure upd
656 (p_effective_date in date
657 ,p_cwb_wksht_grp_id in number
658 ,p_object_version_number in out nocopy number
659 ,p_ordr_num in number default hr_api.g_number
660 ,p_wksht_grp_cd in varchar2 default hr_api.g_varchar2
661 ,p_label in varchar2 default hr_api.g_varchar2
662 ,p_cwg_attribute_category in varchar2 default hr_api.g_varchar2
663 ,p_cwg_attribute1 in varchar2 default hr_api.g_varchar2
664 ,p_cwg_attribute2 in varchar2 default hr_api.g_varchar2
665 ,p_cwg_attribute3 in varchar2 default hr_api.g_varchar2
666 ,p_cwg_attribute4 in varchar2 default hr_api.g_varchar2
667 ,p_cwg_attribute5 in varchar2 default hr_api.g_varchar2
668 ,p_cwg_attribute6 in varchar2 default hr_api.g_varchar2
669 ,p_cwg_attribute7 in varchar2 default hr_api.g_varchar2
670 ,p_cwg_attribute8 in varchar2 default hr_api.g_varchar2
671 ,p_cwg_attribute9 in varchar2 default hr_api.g_varchar2
672 ,p_cwg_attribute10 in varchar2 default hr_api.g_varchar2
673 ,p_cwg_attribute11 in varchar2 default hr_api.g_varchar2
674 ,p_cwg_attribute12 in varchar2 default hr_api.g_varchar2
675 ,p_cwg_attribute13 in varchar2 default hr_api.g_varchar2
676 ,p_cwg_attribute14 in varchar2 default hr_api.g_varchar2
677 ,p_cwg_attribute15 in varchar2 default hr_api.g_varchar2
678 ,p_cwg_attribute16 in varchar2 default hr_api.g_varchar2
679 ,p_cwg_attribute17 in varchar2 default hr_api.g_varchar2
680 ,p_cwg_attribute18 in varchar2 default hr_api.g_varchar2
681 ,p_cwg_attribute19 in varchar2 default hr_api.g_varchar2
682 ,p_cwg_attribute20 in varchar2 default hr_api.g_varchar2
683 ,p_cwg_attribute21 in varchar2 default hr_api.g_varchar2
684 ,p_cwg_attribute22 in varchar2 default hr_api.g_varchar2
685 ,p_cwg_attribute23 in varchar2 default hr_api.g_varchar2
686 ,p_cwg_attribute24 in varchar2 default hr_api.g_varchar2
687 ,p_cwg_attribute25 in varchar2 default hr_api.g_varchar2
688 ,p_cwg_attribute26 in varchar2 default hr_api.g_varchar2
689 ,p_cwg_attribute27 in varchar2 default hr_api.g_varchar2
690 ,p_cwg_attribute28 in varchar2 default hr_api.g_varchar2
691 ,p_cwg_attribute29 in varchar2 default hr_api.g_varchar2
692 ,p_cwg_attribute30 in varchar2 default hr_api.g_varchar2
693 ,p_status_cd in varchar2 default hr_api.g_varchar2
694 ,p_hidden_cd in varchar2 default hr_api.g_varchar2
695 ) is
696 --
697 l_rec ben_cwg_shd.g_rec_type;
698 l_proc varchar2(72) := g_package||'upd';
699 --
700 Begin
701 hr_utility.set_location('Entering:'||l_proc, 5);
702 --
703 -- Call conversion function to turn arguments into the
704 -- l_rec structure.
705 --
706 l_rec :=
707 ben_cwg_shd.convert_args
708 (p_cwb_wksht_grp_id
709 ,hr_api.g_number
710 ,hr_api.g_number
711 ,p_ordr_num
712 ,p_wksht_grp_cd
713 ,p_label
714 ,p_cwg_attribute_category
715 ,p_cwg_attribute1
716 ,p_cwg_attribute2
717 ,p_cwg_attribute3
718 ,p_cwg_attribute4
719 ,p_cwg_attribute5
720 ,p_cwg_attribute6
721 ,p_cwg_attribute7
722 ,p_cwg_attribute8
723 ,p_cwg_attribute9
724 ,p_cwg_attribute10
725 ,p_cwg_attribute11
726 ,p_cwg_attribute12
727 ,p_cwg_attribute13
728 ,p_cwg_attribute14
729 ,p_cwg_attribute15
730 ,p_cwg_attribute16
731 ,p_cwg_attribute17
732 ,p_cwg_attribute18
733 ,p_cwg_attribute19
734 ,p_cwg_attribute20
735 ,p_cwg_attribute21
736 ,p_cwg_attribute22
737 ,p_cwg_attribute23
738 ,p_cwg_attribute24
739 ,p_cwg_attribute25
740 ,p_cwg_attribute26
741 ,p_cwg_attribute27
742 ,p_cwg_attribute28
743 ,p_cwg_attribute29
744 ,p_cwg_attribute30
745 ,p_status_cd
746 ,p_hidden_cd
747 ,p_object_version_number
748 );
749 --
750 -- Having converted the arguments into the
751 -- plsql record structure we call the corresponding record
752 -- business process.
753 --
754 ben_cwg_upd.upd
755 (p_effective_date
756 ,l_rec
757 );
758 p_object_version_number := l_rec.object_version_number;
759 --
760 hr_utility.set_location(' Leaving:'||l_proc, 10);
761 End upd;
762 --
763 end ben_cwg_upd;