1 Package Body ben_wyp_upd as
2 /* $Header: bewyprhi.pkb 115.12 2003/01/01 00:03:22 mmudigon ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' ben_wyp_upd.'; -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |------------------------------< update_dml >------------------------------|
12 -- ----------------------------------------------------------------------------
13 -- {Start Of Comments}
14 --
15 -- Description:
16 -- This procedure controls the actual dml update logic. The processing of
17 -- this procedure is:
18 -- 1) Increment the object_version_number by 1 if the object_version_number
19 -- is defined as an attribute for this entity.
20 -- 2) To set and unset the g_api_dml status as required (as we are about to
21 -- perform dml).
22 -- 3) To update the specified row in the schema using the primary key in
23 -- the predicates.
24 -- 4) To trap any constraint violations that may have occurred.
25 -- 5) To raise any other errors.
26 --
27 -- Prerequisites:
28 -- This is an internal private procedure which must be called from the upd
29 -- procedure.
30 --
31 -- In Parameters:
32 -- A Pl/Sql record structre.
33 --
34 -- Post Success:
35 -- The specified row will be updated in the schema.
36 --
37 -- Post Failure:
38 -- On the update dml failure it is important to note that we always reset the
39 -- g_api_dml status to false.
40 -- If a check, unique or parent integrity constraint violation is raised the
41 -- constraint_error procedure will be called.
42 -- If any other error is reported, the error will be raised after the
43 -- g_api_dml status is reset.
44 --
45 -- Developer Implementation Notes:
46 -- The update 'set' attribute list should be modified if any of your
47 -- attributes are not updateable.
48 --
49 -- Access Status:
50 -- Internal Row Handler Use Only.
51 --
52 -- {End Of Comments}
53 -- ----------------------------------------------------------------------------
54 Procedure update_dml(p_rec in out nocopy ben_wyp_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 ben_wyp_shd.g_api_dml := true; -- Set the api dml status
66 --
67 -- Update the ben_wthn_yr_perd Row
68 --
69 update ben_wthn_yr_perd
70 set
71 wthn_yr_perd_id = p_rec.wthn_yr_perd_id,
72 strt_day = p_rec.strt_day,
73 end_day = p_rec.end_day,
74 strt_mo = p_rec.strt_mo,
75 end_mo = p_rec.end_mo,
76 tm_uom = p_rec.tm_uom,
77 yr_perd_id = p_rec.yr_perd_id,
78 business_group_id = p_rec.business_group_id,
79 wyp_attribute_category = p_rec.wyp_attribute_category,
80 wyp_attribute1 = p_rec.wyp_attribute1,
81 wyp_attribute2 = p_rec.wyp_attribute2,
82 wyp_attribute3 = p_rec.wyp_attribute3,
83 wyp_attribute4 = p_rec.wyp_attribute4,
84 wyp_attribute5 = p_rec.wyp_attribute5,
85 wyp_attribute6 = p_rec.wyp_attribute6,
86 wyp_attribute7 = p_rec.wyp_attribute7,
87 wyp_attribute8 = p_rec.wyp_attribute8,
88 wyp_attribute9 = p_rec.wyp_attribute9,
89 wyp_attribute10 = p_rec.wyp_attribute10,
90 wyp_attribute11 = p_rec.wyp_attribute11,
91 wyp_attribute12 = p_rec.wyp_attribute12,
92 wyp_attribute13 = p_rec.wyp_attribute13,
93 wyp_attribute14 = p_rec.wyp_attribute14,
94 wyp_attribute15 = p_rec.wyp_attribute15,
95 wyp_attribute16 = p_rec.wyp_attribute16,
96 wyp_attribute17 = p_rec.wyp_attribute17,
97 wyp_attribute18 = p_rec.wyp_attribute18,
98 wyp_attribute19 = p_rec.wyp_attribute19,
99 wyp_attribute20 = p_rec.wyp_attribute20,
100 wyp_attribute21 = p_rec.wyp_attribute21,
101 wyp_attribute22 = p_rec.wyp_attribute22,
102 wyp_attribute23 = p_rec.wyp_attribute23,
103 wyp_attribute24 = p_rec.wyp_attribute24,
104 wyp_attribute25 = p_rec.wyp_attribute25,
105 wyp_attribute26 = p_rec.wyp_attribute26,
106 wyp_attribute27 = p_rec.wyp_attribute27,
107 wyp_attribute28 = p_rec.wyp_attribute28,
108 wyp_attribute29 = p_rec.wyp_attribute29,
109 wyp_attribute30 = p_rec.wyp_attribute30,
110 object_version_number = p_rec.object_version_number
111 where wthn_yr_perd_id = p_rec.wthn_yr_perd_id;
112 --
113 ben_wyp_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_wyp_shd.g_api_dml := false; -- Unset the api dml status
121 ben_wyp_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_wyp_shd.g_api_dml := false; -- Unset the api dml status
126 ben_wyp_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_wyp_shd.g_api_dml := false; -- Unset the api dml status
131 ben_wyp_shd.constraint_error
132 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
133 When Others Then
134 ben_wyp_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 structre.
152 --
153 -- Post Success:
154 -- Processing continues.
155 --
156 -- Post Failure:
157 -- If an error has occurred, an error message and exception will 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(p_rec in ben_wyp_shd.g_rec_type) is
171 --
172 l_proc varchar2(72) := g_package||'pre_update';
173 --
174 Begin
175 hr_utility.set_location('Entering:'||l_proc, 5);
176 --
177 hr_utility.set_location(' Leaving:'||l_proc, 10);
178 End pre_update;
179 --
180 -- ----------------------------------------------------------------------------
181 -- |-----------------------------< post_update >------------------------------|
182 -- ----------------------------------------------------------------------------
183 -- {Start Of Comments}
184 --
185 -- Description:
186 -- This private procedure contains any processing which is required after the
187 -- update dml.
188 --
189 -- Prerequisites:
190 -- This is an internal procedure which is called from the upd procedure.
191 --
192 -- In Parameters:
193 -- A Pl/Sql record structre.
194 --
195 -- Post Success:
196 -- Processing continues.
197 --
198 -- Post Failure:
199 -- If an error has occurred, an error message and exception will be raised
200 -- but not handled.
201 --
202 -- Developer Implementation Notes:
203 -- Any post-processing required after the update dml is issued should be
204 -- coded within this procedure. It is important to note that any 3rd party
205 -- maintenance should be reviewed before placing in this procedure.
206 --
207 -- Access Status:
208 -- Internal Row Handler Use Only.
209 --
210 -- {End Of Comments}
211 -- ----------------------------------------------------------------------------
212 Procedure post_update(p_effective_date in date,
213 p_rec in ben_wyp_shd.g_rec_type) is
214 --
215 l_proc varchar2(72) := g_package||'post_update';
216 --
217 Begin
218 hr_utility.set_location('Entering:'||l_proc, 5);
219 --
220 --
221 -- Start of API User Hook for post_update.
222 --
223 begin
224 --
225 ben_wyp_rku.after_update
226 (
227 p_wthn_yr_perd_id =>p_rec.wthn_yr_perd_id
228 ,p_strt_day =>p_rec.strt_day
229 ,p_end_day =>p_rec.end_day
230 ,p_strt_mo =>p_rec.strt_mo
231 ,p_end_mo =>p_rec.end_mo
232 ,p_tm_uom =>p_rec.tm_uom
233 ,p_yr_perd_id =>p_rec.yr_perd_id
234 ,p_business_group_id =>p_rec.business_group_id
235 ,p_wyp_attribute_category =>p_rec.wyp_attribute_category
236 ,p_wyp_attribute1 =>p_rec.wyp_attribute1
237 ,p_wyp_attribute2 =>p_rec.wyp_attribute2
238 ,p_wyp_attribute3 =>p_rec.wyp_attribute3
239 ,p_wyp_attribute4 =>p_rec.wyp_attribute4
240 ,p_wyp_attribute5 =>p_rec.wyp_attribute5
241 ,p_wyp_attribute6 =>p_rec.wyp_attribute6
242 ,p_wyp_attribute7 =>p_rec.wyp_attribute7
243 ,p_wyp_attribute8 =>p_rec.wyp_attribute8
244 ,p_wyp_attribute9 =>p_rec.wyp_attribute9
245 ,p_wyp_attribute10 =>p_rec.wyp_attribute10
246 ,p_wyp_attribute11 =>p_rec.wyp_attribute11
247 ,p_wyp_attribute12 =>p_rec.wyp_attribute12
248 ,p_wyp_attribute13 =>p_rec.wyp_attribute13
249 ,p_wyp_attribute14 =>p_rec.wyp_attribute14
250 ,p_wyp_attribute15 =>p_rec.wyp_attribute15
251 ,p_wyp_attribute16 =>p_rec.wyp_attribute16
252 ,p_wyp_attribute17 =>p_rec.wyp_attribute17
253 ,p_wyp_attribute18 =>p_rec.wyp_attribute18
254 ,p_wyp_attribute19 =>p_rec.wyp_attribute19
255 ,p_wyp_attribute20 =>p_rec.wyp_attribute20
256 ,p_wyp_attribute21 =>p_rec.wyp_attribute21
257 ,p_wyp_attribute22 =>p_rec.wyp_attribute22
258 ,p_wyp_attribute23 =>p_rec.wyp_attribute23
259 ,p_wyp_attribute24 =>p_rec.wyp_attribute24
260 ,p_wyp_attribute25 =>p_rec.wyp_attribute25
261 ,p_wyp_attribute26 =>p_rec.wyp_attribute26
262 ,p_wyp_attribute27 =>p_rec.wyp_attribute27
263 ,p_wyp_attribute28 =>p_rec.wyp_attribute28
264 ,p_wyp_attribute29 =>p_rec.wyp_attribute29
265 ,p_wyp_attribute30 =>p_rec.wyp_attribute30
266 ,p_effective_date =>p_effective_date
267 ,p_object_version_number =>p_rec.object_version_number
268 ,p_strt_day_o =>ben_wyp_shd.g_old_rec.strt_day
269 ,p_end_day_o =>ben_wyp_shd.g_old_rec.end_day
270 ,p_strt_mo_o =>ben_wyp_shd.g_old_rec.strt_mo
271 ,p_end_mo_o =>ben_wyp_shd.g_old_rec.end_mo
272 ,p_tm_uom_o =>ben_wyp_shd.g_old_rec.tm_uom
273 ,p_yr_perd_id_o =>ben_wyp_shd.g_old_rec.yr_perd_id
274 ,p_business_group_id_o =>ben_wyp_shd.g_old_rec.business_group_id
275 ,p_wyp_attribute_category_o =>ben_wyp_shd.g_old_rec.wyp_attribute_category
276 ,p_wyp_attribute1_o =>ben_wyp_shd.g_old_rec.wyp_attribute1
277 ,p_wyp_attribute2_o =>ben_wyp_shd.g_old_rec.wyp_attribute2
278 ,p_wyp_attribute3_o =>ben_wyp_shd.g_old_rec.wyp_attribute3
279 ,p_wyp_attribute4_o =>ben_wyp_shd.g_old_rec.wyp_attribute4
280 ,p_wyp_attribute5_o =>ben_wyp_shd.g_old_rec.wyp_attribute5
281 ,p_wyp_attribute6_o =>ben_wyp_shd.g_old_rec.wyp_attribute6
282 ,p_wyp_attribute7_o =>ben_wyp_shd.g_old_rec.wyp_attribute7
283 ,p_wyp_attribute8_o =>ben_wyp_shd.g_old_rec.wyp_attribute8
284 ,p_wyp_attribute9_o =>ben_wyp_shd.g_old_rec.wyp_attribute9
285 ,p_wyp_attribute10_o =>ben_wyp_shd.g_old_rec.wyp_attribute10
286 ,p_wyp_attribute11_o =>ben_wyp_shd.g_old_rec.wyp_attribute11
287 ,p_wyp_attribute12_o =>ben_wyp_shd.g_old_rec.wyp_attribute12
288 ,p_wyp_attribute13_o =>ben_wyp_shd.g_old_rec.wyp_attribute13
289 ,p_wyp_attribute14_o =>ben_wyp_shd.g_old_rec.wyp_attribute14
290 ,p_wyp_attribute15_o =>ben_wyp_shd.g_old_rec.wyp_attribute15
291 ,p_wyp_attribute16_o =>ben_wyp_shd.g_old_rec.wyp_attribute16
292 ,p_wyp_attribute17_o =>ben_wyp_shd.g_old_rec.wyp_attribute17
293 ,p_wyp_attribute18_o =>ben_wyp_shd.g_old_rec.wyp_attribute18
294 ,p_wyp_attribute19_o =>ben_wyp_shd.g_old_rec.wyp_attribute19
295 ,p_wyp_attribute20_o =>ben_wyp_shd.g_old_rec.wyp_attribute20
296 ,p_wyp_attribute21_o =>ben_wyp_shd.g_old_rec.wyp_attribute21
297 ,p_wyp_attribute22_o =>ben_wyp_shd.g_old_rec.wyp_attribute22
298 ,p_wyp_attribute23_o =>ben_wyp_shd.g_old_rec.wyp_attribute23
299 ,p_wyp_attribute24_o =>ben_wyp_shd.g_old_rec.wyp_attribute24
300 ,p_wyp_attribute25_o =>ben_wyp_shd.g_old_rec.wyp_attribute25
301 ,p_wyp_attribute26_o =>ben_wyp_shd.g_old_rec.wyp_attribute26
302 ,p_wyp_attribute27_o =>ben_wyp_shd.g_old_rec.wyp_attribute27
303 ,p_wyp_attribute28_o =>ben_wyp_shd.g_old_rec.wyp_attribute28
304 ,p_wyp_attribute29_o =>ben_wyp_shd.g_old_rec.wyp_attribute29
305 ,p_wyp_attribute30_o =>ben_wyp_shd.g_old_rec.wyp_attribute30
306 ,p_object_version_number_o =>ben_wyp_shd.g_old_rec.object_version_number
307 );
308 --
309 exception
310 --
311 when hr_api.cannot_find_prog_unit then
312 --
313 hr_api.cannot_find_prog_unit_error
314 (p_module_name => 'ben_wthn_yr_perd'
315 ,p_hook_type => 'AU');
316 --
317 end;
318 --
319 -- End of API User Hook for post_update.
320 --
321 --
322 hr_utility.set_location(' Leaving:'||l_proc, 10);
323 End post_update;
324 --
325 -- ----------------------------------------------------------------------------
326 -- |-----------------------------< convert_defs >-----------------------------|
327 -- ----------------------------------------------------------------------------
328 -- {Start Of Comments}
329 --
330 -- Description:
331 -- The Convert_Defs procedure has one very important function:
332 -- It must return the record structure for the row with all system defaulted
333 -- values converted into its corresponding parameter value for update. When
334 -- we attempt to update a row through the Upd process , certain
335 -- parameters can be defaulted which enables flexibility in the calling of
336 -- the upd process (e.g. only attributes which need to be updated need to be
337 -- specified). For the upd process to determine which attributes
338 -- have NOT been specified we need to check if the parameter has a reserved
339 -- system default value. Therefore, for all parameters which have a
340 -- corresponding reserved system default mechanism specified we need to
341 -- check if a system default is being used. If a system default is being
342 -- used then we convert the defaulted value into its corresponding attribute
343 -- value held in the g_old_rec data structure.
344 --
345 -- Prerequisites:
346 -- This private function can only be called from the upd process.
347 --
348 -- In Parameters:
349 -- A Pl/Sql record structre.
350 --
351 -- Post Success:
352 -- The record structure will be returned with all system defaulted parameter
353 -- values converted into its current row attribute value.
354 --
355 -- Post Failure:
356 -- No direct error handling is required within this function. Any possible
357 -- errors within this procedure will be a PL/SQL value error due to conversion
358 -- of datatypes or data lengths.
359 --
360 -- Developer Implementation Notes:
361 -- None.
362 --
363 -- Access Status:
364 -- Internal Row Handler Use Only.
365 --
366 -- {End Of Comments}
367 -- ----------------------------------------------------------------------------
368 Procedure convert_defs(p_rec in out nocopy ben_wyp_shd.g_rec_type) is
369 --
370 l_proc varchar2(72) := g_package||'convert_defs';
371 --
372 Begin
373 --
374 hr_utility.set_location('Entering:'||l_proc, 5);
375 --
376 -- We must now examine each argument value in the
377 -- p_rec plsql record structure
378 -- to see if a system default is being used. If a system default
379 -- is being used then we must set to the 'current' argument value.
380 --
381 If (p_rec.strt_day = hr_api.g_number) then
382 p_rec.strt_day :=
383 ben_wyp_shd.g_old_rec.strt_day;
384 End If;
385 If (p_rec.end_day = hr_api.g_number) then
386 p_rec.end_day :=
387 ben_wyp_shd.g_old_rec.end_day;
388 End If;
389 If (p_rec.strt_mo = hr_api.g_number) then
390 p_rec.strt_mo :=
391 ben_wyp_shd.g_old_rec.strt_mo;
392 End If;
393 If (p_rec.end_mo = hr_api.g_number) then
394 p_rec.end_mo :=
395 ben_wyp_shd.g_old_rec.end_mo;
396 End If;
397 If (p_rec.tm_uom = hr_api.g_varchar2) then
398 p_rec.tm_uom :=
399 ben_wyp_shd.g_old_rec.tm_uom;
400 End If;
401 If (p_rec.yr_perd_id = hr_api.g_number) then
402 p_rec.yr_perd_id :=
403 ben_wyp_shd.g_old_rec.yr_perd_id;
404 End If;
405 If (p_rec.business_group_id = hr_api.g_number) then
406 p_rec.business_group_id :=
407 ben_wyp_shd.g_old_rec.business_group_id;
408 End If;
409 If (p_rec.wyp_attribute_category = hr_api.g_varchar2) then
410 p_rec.wyp_attribute_category :=
411 ben_wyp_shd.g_old_rec.wyp_attribute_category;
412 End If;
413 If (p_rec.wyp_attribute1 = hr_api.g_varchar2) then
414 p_rec.wyp_attribute1 :=
415 ben_wyp_shd.g_old_rec.wyp_attribute1;
416 End If;
417 If (p_rec.wyp_attribute2 = hr_api.g_varchar2) then
418 p_rec.wyp_attribute2 :=
419 ben_wyp_shd.g_old_rec.wyp_attribute2;
420 End If;
421 If (p_rec.wyp_attribute3 = hr_api.g_varchar2) then
422 p_rec.wyp_attribute3 :=
423 ben_wyp_shd.g_old_rec.wyp_attribute3;
424 End If;
425 If (p_rec.wyp_attribute4 = hr_api.g_varchar2) then
426 p_rec.wyp_attribute4 :=
427 ben_wyp_shd.g_old_rec.wyp_attribute4;
428 End If;
429 If (p_rec.wyp_attribute5 = hr_api.g_varchar2) then
430 p_rec.wyp_attribute5 :=
431 ben_wyp_shd.g_old_rec.wyp_attribute5;
432 End If;
433 If (p_rec.wyp_attribute6 = hr_api.g_varchar2) then
434 p_rec.wyp_attribute6 :=
435 ben_wyp_shd.g_old_rec.wyp_attribute6;
436 End If;
437 If (p_rec.wyp_attribute7 = hr_api.g_varchar2) then
438 p_rec.wyp_attribute7 :=
439 ben_wyp_shd.g_old_rec.wyp_attribute7;
440 End If;
441 If (p_rec.wyp_attribute8 = hr_api.g_varchar2) then
442 p_rec.wyp_attribute8 :=
443 ben_wyp_shd.g_old_rec.wyp_attribute8;
444 End If;
445 If (p_rec.wyp_attribute9 = hr_api.g_varchar2) then
446 p_rec.wyp_attribute9 :=
447 ben_wyp_shd.g_old_rec.wyp_attribute9;
448 End If;
449 If (p_rec.wyp_attribute10 = hr_api.g_varchar2) then
450 p_rec.wyp_attribute10 :=
451 ben_wyp_shd.g_old_rec.wyp_attribute10;
452 End If;
453 If (p_rec.wyp_attribute11 = hr_api.g_varchar2) then
454 p_rec.wyp_attribute11 :=
455 ben_wyp_shd.g_old_rec.wyp_attribute11;
456 End If;
457 If (p_rec.wyp_attribute12 = hr_api.g_varchar2) then
458 p_rec.wyp_attribute12 :=
459 ben_wyp_shd.g_old_rec.wyp_attribute12;
460 End If;
461 If (p_rec.wyp_attribute13 = hr_api.g_varchar2) then
462 p_rec.wyp_attribute13 :=
463 ben_wyp_shd.g_old_rec.wyp_attribute13;
464 End If;
465 If (p_rec.wyp_attribute14 = hr_api.g_varchar2) then
466 p_rec.wyp_attribute14 :=
467 ben_wyp_shd.g_old_rec.wyp_attribute14;
468 End If;
469 If (p_rec.wyp_attribute15 = hr_api.g_varchar2) then
470 p_rec.wyp_attribute15 :=
471 ben_wyp_shd.g_old_rec.wyp_attribute15;
472 End If;
473 If (p_rec.wyp_attribute16 = hr_api.g_varchar2) then
474 p_rec.wyp_attribute16 :=
475 ben_wyp_shd.g_old_rec.wyp_attribute16;
476 End If;
477 If (p_rec.wyp_attribute17 = hr_api.g_varchar2) then
478 p_rec.wyp_attribute17 :=
479 ben_wyp_shd.g_old_rec.wyp_attribute17;
480 End If;
481 If (p_rec.wyp_attribute18 = hr_api.g_varchar2) then
482 p_rec.wyp_attribute18 :=
483 ben_wyp_shd.g_old_rec.wyp_attribute18;
484 End If;
485 If (p_rec.wyp_attribute19 = hr_api.g_varchar2) then
486 p_rec.wyp_attribute19 :=
487 ben_wyp_shd.g_old_rec.wyp_attribute19;
488 End If;
489 If (p_rec.wyp_attribute20 = hr_api.g_varchar2) then
490 p_rec.wyp_attribute20 :=
491 ben_wyp_shd.g_old_rec.wyp_attribute20;
492 End If;
493 If (p_rec.wyp_attribute21 = hr_api.g_varchar2) then
494 p_rec.wyp_attribute21 :=
495 ben_wyp_shd.g_old_rec.wyp_attribute21;
496 End If;
497 If (p_rec.wyp_attribute22 = hr_api.g_varchar2) then
498 p_rec.wyp_attribute22 :=
499 ben_wyp_shd.g_old_rec.wyp_attribute22;
500 End If;
501 If (p_rec.wyp_attribute23 = hr_api.g_varchar2) then
502 p_rec.wyp_attribute23 :=
503 ben_wyp_shd.g_old_rec.wyp_attribute23;
504 End If;
505 If (p_rec.wyp_attribute24 = hr_api.g_varchar2) then
506 p_rec.wyp_attribute24 :=
507 ben_wyp_shd.g_old_rec.wyp_attribute24;
508 End If;
509 If (p_rec.wyp_attribute25 = hr_api.g_varchar2) then
510 p_rec.wyp_attribute25 :=
511 ben_wyp_shd.g_old_rec.wyp_attribute25;
512 End If;
513 If (p_rec.wyp_attribute26 = hr_api.g_varchar2) then
514 p_rec.wyp_attribute26 :=
515 ben_wyp_shd.g_old_rec.wyp_attribute26;
516 End If;
517 If (p_rec.wyp_attribute27 = hr_api.g_varchar2) then
518 p_rec.wyp_attribute27 :=
519 ben_wyp_shd.g_old_rec.wyp_attribute27;
520 End If;
521 If (p_rec.wyp_attribute28 = hr_api.g_varchar2) then
522 p_rec.wyp_attribute28 :=
523 ben_wyp_shd.g_old_rec.wyp_attribute28;
524 End If;
525 If (p_rec.wyp_attribute29 = hr_api.g_varchar2) then
526 p_rec.wyp_attribute29 :=
527 ben_wyp_shd.g_old_rec.wyp_attribute29;
528 End If;
529 If (p_rec.wyp_attribute30 = hr_api.g_varchar2) then
530 p_rec.wyp_attribute30 :=
531 ben_wyp_shd.g_old_rec.wyp_attribute30;
532 End If;
533
534 --
535 hr_utility.set_location(' Leaving:'||l_proc, 10);
536 --
537 End convert_defs;
538 --
539 -- ----------------------------------------------------------------------------
540 -- |---------------------------------< upd >----------------------------------|
541 -- ----------------------------------------------------------------------------
542 Procedure upd
543 (
544 p_effective_date in date,
545 p_rec in out nocopy ben_wyp_shd.g_rec_type
546 ) is
547 --
548 l_proc varchar2(72) := g_package||'upd';
549 --
550 Begin
551 hr_utility.set_location('Entering:'||l_proc, 5);
552 --
553 -- We must lock the row which we need to update.
554 --
555 ben_wyp_shd.lck
556 (
557 p_rec.wthn_yr_perd_id,
558 p_rec.object_version_number
559 );
560 --
561 -- 1. During an update system defaults are used to determine if
562 -- arguments have been defaulted or not. We must therefore
563 -- derive the full record structure values to be updated.
564 --
565 -- 2. Call the supporting update validate operations.
566 --
567 convert_defs(p_rec);
568 ben_wyp_bus.update_validate(p_rec
569 ,p_effective_date);
570 --
571 -- Call the supporting pre-update operation
572 --
573 pre_update(p_rec);
574 --
575 -- Update the row.
576 --
577 update_dml(p_rec);
578 --
579 -- Call the supporting post-update operation
580 --
581 post_update(p_effective_date,
582 p_rec);
583 End upd;
584 --
585 -- ----------------------------------------------------------------------------
586 -- |---------------------------------< upd >----------------------------------|
587 -- ----------------------------------------------------------------------------
588 Procedure upd
589 (
590 p_effective_date in date,
591 p_wthn_yr_perd_id in number,
592 p_strt_day in number default hr_api.g_number,
593 p_end_day in number default hr_api.g_number,
594 p_strt_mo in number default hr_api.g_number,
595 p_end_mo in number default hr_api.g_number,
596 p_tm_uom in varchar2 default hr_api.g_varchar2,
597 p_yr_perd_id in number default hr_api.g_number,
598 p_business_group_id in number default hr_api.g_number,
599 p_wyp_attribute_category in varchar2 default hr_api.g_varchar2,
600 p_wyp_attribute1 in varchar2 default hr_api.g_varchar2,
601 p_wyp_attribute2 in varchar2 default hr_api.g_varchar2,
602 p_wyp_attribute3 in varchar2 default hr_api.g_varchar2,
603 p_wyp_attribute4 in varchar2 default hr_api.g_varchar2,
604 p_wyp_attribute5 in varchar2 default hr_api.g_varchar2,
605 p_wyp_attribute6 in varchar2 default hr_api.g_varchar2,
606 p_wyp_attribute7 in varchar2 default hr_api.g_varchar2,
607 p_wyp_attribute8 in varchar2 default hr_api.g_varchar2,
608 p_wyp_attribute9 in varchar2 default hr_api.g_varchar2,
609 p_wyp_attribute10 in varchar2 default hr_api.g_varchar2,
610 p_wyp_attribute11 in varchar2 default hr_api.g_varchar2,
611 p_wyp_attribute12 in varchar2 default hr_api.g_varchar2,
612 p_wyp_attribute13 in varchar2 default hr_api.g_varchar2,
613 p_wyp_attribute14 in varchar2 default hr_api.g_varchar2,
614 p_wyp_attribute15 in varchar2 default hr_api.g_varchar2,
615 p_wyp_attribute16 in varchar2 default hr_api.g_varchar2,
616 p_wyp_attribute17 in varchar2 default hr_api.g_varchar2,
617 p_wyp_attribute18 in varchar2 default hr_api.g_varchar2,
618 p_wyp_attribute19 in varchar2 default hr_api.g_varchar2,
619 p_wyp_attribute20 in varchar2 default hr_api.g_varchar2,
620 p_wyp_attribute21 in varchar2 default hr_api.g_varchar2,
621 p_wyp_attribute22 in varchar2 default hr_api.g_varchar2,
622 p_wyp_attribute23 in varchar2 default hr_api.g_varchar2,
623 p_wyp_attribute24 in varchar2 default hr_api.g_varchar2,
624 p_wyp_attribute25 in varchar2 default hr_api.g_varchar2,
625 p_wyp_attribute26 in varchar2 default hr_api.g_varchar2,
626 p_wyp_attribute27 in varchar2 default hr_api.g_varchar2,
627 p_wyp_attribute28 in varchar2 default hr_api.g_varchar2,
628 p_wyp_attribute29 in varchar2 default hr_api.g_varchar2,
629 p_wyp_attribute30 in varchar2 default hr_api.g_varchar2,
630 p_object_version_number in out nocopy number
631 ) is
632 --
633 l_rec ben_wyp_shd.g_rec_type;
634 l_proc varchar2(72) := g_package||'upd';
635 --
636 Begin
637 hr_utility.set_location('Entering:'||l_proc, 5);
638 --
639 -- Call conversion function to turn arguments into the
640 -- l_rec structure.
641 --
642 l_rec :=
643 ben_wyp_shd.convert_args
644 (
645 p_wthn_yr_perd_id,
646 p_strt_day,
647 p_end_day,
648 p_strt_mo,
649 p_end_mo,
650 p_tm_uom,
651 p_yr_perd_id,
652 p_business_group_id,
653 p_wyp_attribute_category,
654 p_wyp_attribute1,
655 p_wyp_attribute2,
656 p_wyp_attribute3,
657 p_wyp_attribute4,
658 p_wyp_attribute5,
659 p_wyp_attribute6,
660 p_wyp_attribute7,
661 p_wyp_attribute8,
662 p_wyp_attribute9,
663 p_wyp_attribute10,
664 p_wyp_attribute11,
665 p_wyp_attribute12,
666 p_wyp_attribute13,
667 p_wyp_attribute14,
668 p_wyp_attribute15,
669 p_wyp_attribute16,
670 p_wyp_attribute17,
671 p_wyp_attribute18,
672 p_wyp_attribute19,
673 p_wyp_attribute20,
674 p_wyp_attribute21,
675 p_wyp_attribute22,
676 p_wyp_attribute23,
677 p_wyp_attribute24,
678 p_wyp_attribute25,
679 p_wyp_attribute26,
680 p_wyp_attribute27,
681 p_wyp_attribute28,
682 p_wyp_attribute29,
683 p_wyp_attribute30,
684 p_object_version_number
685 );
686 --
687 -- Having converted the arguments into the
688 -- plsql record structure we call the corresponding record
689 -- business process.
690 --
691 upd(p_effective_date,
692 l_rec);
693 p_object_version_number := l_rec.object_version_number;
694 --
695 hr_utility.set_location(' Leaving:'||l_proc, 10);
696 End upd;
697 --
698 end ben_wyp_upd;