1 Package Body ben_cpy_upd as
2 /* $Header: becpyrhi.pkb 120.2 2005/12/19 12:34:35 kmahendr noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' ben_cpy_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_cpy_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_cpy_shd.g_api_dml := true; -- Set the api dml status
66 --
67 -- Update the ben_popl_yr_perd Row
68 --
69 update ben_popl_yr_perd
70 set
71 popl_yr_perd_id = p_rec.popl_yr_perd_id,
72 yr_perd_id = p_rec.yr_perd_id,
73 business_group_id = p_rec.business_group_id,
74 pl_id = p_rec.pl_id,
75 pgm_id = p_rec.pgm_id,
76 ordr_num = p_rec.ordr_num,
77 acpt_clm_rqsts_thru_dt = p_rec.acpt_clm_rqsts_thru_dt,
78 py_clms_thru_dt = p_rec.py_clms_thru_dt,
79 cpy_attribute_category = p_rec.cpy_attribute_category,
80 cpy_attribute1 = p_rec.cpy_attribute1,
81 cpy_attribute2 = p_rec.cpy_attribute2,
82 cpy_attribute3 = p_rec.cpy_attribute3,
83 cpy_attribute4 = p_rec.cpy_attribute4,
84 cpy_attribute5 = p_rec.cpy_attribute5,
85 cpy_attribute6 = p_rec.cpy_attribute6,
86 cpy_attribute7 = p_rec.cpy_attribute7,
87 cpy_attribute8 = p_rec.cpy_attribute8,
88 cpy_attribute9 = p_rec.cpy_attribute9,
89 cpy_attribute10 = p_rec.cpy_attribute10,
90 cpy_attribute11 = p_rec.cpy_attribute11,
91 cpy_attribute12 = p_rec.cpy_attribute12,
92 cpy_attribute13 = p_rec.cpy_attribute13,
93 cpy_attribute14 = p_rec.cpy_attribute14,
94 cpy_attribute15 = p_rec.cpy_attribute15,
95 cpy_attribute16 = p_rec.cpy_attribute16,
96 cpy_attribute17 = p_rec.cpy_attribute17,
97 cpy_attribute18 = p_rec.cpy_attribute18,
98 cpy_attribute19 = p_rec.cpy_attribute19,
99 cpy_attribute20 = p_rec.cpy_attribute20,
100 cpy_attribute21 = p_rec.cpy_attribute21,
101 cpy_attribute22 = p_rec.cpy_attribute22,
102 cpy_attribute23 = p_rec.cpy_attribute23,
103 cpy_attribute24 = p_rec.cpy_attribute24,
104 cpy_attribute25 = p_rec.cpy_attribute25,
105 cpy_attribute26 = p_rec.cpy_attribute26,
106 cpy_attribute27 = p_rec.cpy_attribute27,
107 cpy_attribute28 = p_rec.cpy_attribute28,
108 cpy_attribute29 = p_rec.cpy_attribute29,
109 cpy_attribute30 = p_rec.cpy_attribute30,
110 object_version_number = p_rec.object_version_number
111 where popl_yr_perd_id = p_rec.popl_yr_perd_id;
112 --
113 ben_cpy_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_cpy_shd.g_api_dml := false; -- Unset the api dml status
121 ben_cpy_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_cpy_shd.g_api_dml := false; -- Unset the api dml status
126 ben_cpy_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_cpy_shd.g_api_dml := false; -- Unset the api dml status
131 ben_cpy_shd.constraint_error
132 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
133 When Others Then
134 ben_cpy_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_cpy_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_rec in ben_cpy_shd.g_rec_type) is
213 --
214 l_proc varchar2(72) := g_package||'post_update';
215 --
216 Begin
217 hr_utility.set_location('Entering:'||l_proc, 5);
218 --
219 --
220 -- Start of API User Hook for post_update.
221 --
222 begin
223 --
224 ben_cpy_rku.after_update
225 (
226 p_popl_yr_perd_id =>p_rec.popl_yr_perd_id
227 ,p_yr_perd_id =>p_rec.yr_perd_id
228 ,p_business_group_id =>p_rec.business_group_id
229 ,p_pl_id =>p_rec.pl_id
230 ,p_pgm_id =>p_rec.pgm_id
231 ,p_ordr_num =>p_rec.ordr_num
232 ,p_acpt_clm_rqsts_thru_dt =>p_rec.acpt_clm_rqsts_thru_dt
233 ,p_py_clms_thru_dt =>p_rec.py_clms_thru_dt
234 ,p_cpy_attribute_category =>p_rec.cpy_attribute_category
235 ,p_cpy_attribute1 =>p_rec.cpy_attribute1
236 ,p_cpy_attribute2 =>p_rec.cpy_attribute2
237 ,p_cpy_attribute3 =>p_rec.cpy_attribute3
238 ,p_cpy_attribute4 =>p_rec.cpy_attribute4
239 ,p_cpy_attribute5 =>p_rec.cpy_attribute5
240 ,p_cpy_attribute6 =>p_rec.cpy_attribute6
241 ,p_cpy_attribute7 =>p_rec.cpy_attribute7
242 ,p_cpy_attribute8 =>p_rec.cpy_attribute8
243 ,p_cpy_attribute9 =>p_rec.cpy_attribute9
244 ,p_cpy_attribute10 =>p_rec.cpy_attribute10
245 ,p_cpy_attribute11 =>p_rec.cpy_attribute11
246 ,p_cpy_attribute12 =>p_rec.cpy_attribute12
247 ,p_cpy_attribute13 =>p_rec.cpy_attribute13
248 ,p_cpy_attribute14 =>p_rec.cpy_attribute14
249 ,p_cpy_attribute15 =>p_rec.cpy_attribute15
250 ,p_cpy_attribute16 =>p_rec.cpy_attribute16
251 ,p_cpy_attribute17 =>p_rec.cpy_attribute17
252 ,p_cpy_attribute18 =>p_rec.cpy_attribute18
253 ,p_cpy_attribute19 =>p_rec.cpy_attribute19
254 ,p_cpy_attribute20 =>p_rec.cpy_attribute20
255 ,p_cpy_attribute21 =>p_rec.cpy_attribute21
256 ,p_cpy_attribute22 =>p_rec.cpy_attribute22
257 ,p_cpy_attribute23 =>p_rec.cpy_attribute23
258 ,p_cpy_attribute24 =>p_rec.cpy_attribute24
259 ,p_cpy_attribute25 =>p_rec.cpy_attribute25
260 ,p_cpy_attribute26 =>p_rec.cpy_attribute26
261 ,p_cpy_attribute27 =>p_rec.cpy_attribute27
262 ,p_cpy_attribute28 =>p_rec.cpy_attribute28
263 ,p_cpy_attribute29 =>p_rec.cpy_attribute29
264 ,p_cpy_attribute30 =>p_rec.cpy_attribute30
265 ,p_object_version_number =>p_rec.object_version_number
266 ,p_yr_perd_id_o =>ben_cpy_shd.g_old_rec.yr_perd_id
267 ,p_business_group_id_o =>ben_cpy_shd.g_old_rec.business_group_id
268 ,p_pl_id_o =>ben_cpy_shd.g_old_rec.pl_id
269 ,p_pgm_id_o =>ben_cpy_shd.g_old_rec.pgm_id
270 ,p_ordr_num_o =>ben_cpy_shd.g_old_rec.ordr_num
271 ,p_acpt_clm_rqsts_thru_dt_o =>ben_cpy_shd.g_old_rec.acpt_clm_rqsts_thru_dt
272 ,p_py_clms_thru_dt_o =>ben_cpy_shd.g_old_rec.py_clms_thru_dt
273 ,p_cpy_attribute_category_o =>ben_cpy_shd.g_old_rec.cpy_attribute_category
274 ,p_cpy_attribute1_o =>ben_cpy_shd.g_old_rec.cpy_attribute1
275 ,p_cpy_attribute2_o =>ben_cpy_shd.g_old_rec.cpy_attribute2
276 ,p_cpy_attribute3_o =>ben_cpy_shd.g_old_rec.cpy_attribute3
277 ,p_cpy_attribute4_o =>ben_cpy_shd.g_old_rec.cpy_attribute4
278 ,p_cpy_attribute5_o =>ben_cpy_shd.g_old_rec.cpy_attribute5
279 ,p_cpy_attribute6_o =>ben_cpy_shd.g_old_rec.cpy_attribute6
280 ,p_cpy_attribute7_o =>ben_cpy_shd.g_old_rec.cpy_attribute7
281 ,p_cpy_attribute8_o =>ben_cpy_shd.g_old_rec.cpy_attribute8
282 ,p_cpy_attribute9_o =>ben_cpy_shd.g_old_rec.cpy_attribute9
283 ,p_cpy_attribute10_o =>ben_cpy_shd.g_old_rec.cpy_attribute10
284 ,p_cpy_attribute11_o =>ben_cpy_shd.g_old_rec.cpy_attribute11
285 ,p_cpy_attribute12_o =>ben_cpy_shd.g_old_rec.cpy_attribute12
286 ,p_cpy_attribute13_o =>ben_cpy_shd.g_old_rec.cpy_attribute13
287 ,p_cpy_attribute14_o =>ben_cpy_shd.g_old_rec.cpy_attribute14
288 ,p_cpy_attribute15_o =>ben_cpy_shd.g_old_rec.cpy_attribute15
289 ,p_cpy_attribute16_o =>ben_cpy_shd.g_old_rec.cpy_attribute16
290 ,p_cpy_attribute17_o =>ben_cpy_shd.g_old_rec.cpy_attribute17
291 ,p_cpy_attribute18_o =>ben_cpy_shd.g_old_rec.cpy_attribute18
292 ,p_cpy_attribute19_o =>ben_cpy_shd.g_old_rec.cpy_attribute19
293 ,p_cpy_attribute20_o =>ben_cpy_shd.g_old_rec.cpy_attribute20
294 ,p_cpy_attribute21_o =>ben_cpy_shd.g_old_rec.cpy_attribute21
295 ,p_cpy_attribute22_o =>ben_cpy_shd.g_old_rec.cpy_attribute22
296 ,p_cpy_attribute23_o =>ben_cpy_shd.g_old_rec.cpy_attribute23
297 ,p_cpy_attribute24_o =>ben_cpy_shd.g_old_rec.cpy_attribute24
298 ,p_cpy_attribute25_o =>ben_cpy_shd.g_old_rec.cpy_attribute25
299 ,p_cpy_attribute26_o =>ben_cpy_shd.g_old_rec.cpy_attribute26
300 ,p_cpy_attribute27_o =>ben_cpy_shd.g_old_rec.cpy_attribute27
301 ,p_cpy_attribute28_o =>ben_cpy_shd.g_old_rec.cpy_attribute28
302 ,p_cpy_attribute29_o =>ben_cpy_shd.g_old_rec.cpy_attribute29
303 ,p_cpy_attribute30_o =>ben_cpy_shd.g_old_rec.cpy_attribute30
304 ,p_object_version_number_o =>ben_cpy_shd.g_old_rec.object_version_number
305 );
306 --
307 exception
308 --
309 when hr_api.cannot_find_prog_unit then
310 --
311 hr_api.cannot_find_prog_unit_error
312 (p_module_name => 'ben_popl_yr_perd'
313 ,p_hook_type => 'AU');
314 --
315 end;
316 --
317 -- End of API User Hook for post_update.
318 --
319 --
320 hr_utility.set_location(' Leaving:'||l_proc, 10);
321 End post_update;
322 --
323 -- ----------------------------------------------------------------------------
324 -- |-----------------------------< convert_defs >-----------------------------|
325 -- ----------------------------------------------------------------------------
326 -- {Start Of Comments}
327 --
328 -- Description:
329 -- The Convert_Defs procedure has one very important function:
330 -- It must return the record structure for the row with all system defaulted
331 -- values converted into its corresponding parameter value for update. When
332 -- we attempt to update a row through the Upd process , certain
333 -- parameters can be defaulted which enables flexibility in the calling of
334 -- the upd process (e.g. only attributes which need to be updated need to be
335 -- specified). For the upd process to determine which attributes
336 -- have NOT been specified we need to check if the parameter has a reserved
337 -- system default value. Therefore, for all parameters which have a
338 -- corresponding reserved system default mechanism specified we need to
339 -- check if a system default is being used. If a system default is being
340 -- used then we convert the defaulted value into its corresponding attribute
341 -- value held in the g_old_rec data structure.
342 --
343 -- Prerequisites:
344 -- This private function can only be called from the upd process.
345 --
346 -- In Parameters:
347 -- A Pl/Sql record structre.
348 --
349 -- Post Success:
350 -- The record structure will be returned with all system defaulted parameter
351 -- values converted into its current row attribute value.
352 --
353 -- Post Failure:
354 -- No direct error handling is required within this function. Any possible
355 -- errors within this procedure will be a PL/SQL value error due to conversion
356 -- of datatypes or data lengths.
357 --
358 -- Developer Implementation Notes:
359 -- None.
360 --
361 -- Access Status:
362 -- Internal Row Handler Use Only.
363 --
364 -- {End Of Comments}
365 -- ----------------------------------------------------------------------------
366 Procedure convert_defs(p_rec in out nocopy ben_cpy_shd.g_rec_type) is
367 --
368 l_proc varchar2(72) := g_package||'convert_defs';
369 --
370 Begin
371 --
372 hr_utility.set_location('Entering:'||l_proc, 5);
373 --
374 -- We must now examine each argument value in the
375 -- p_rec plsql record structure
376 -- to see if a system default is being used. If a system default
377 -- is being used then we must set to the 'current' argument value.
378 --
379 If (p_rec.yr_perd_id = hr_api.g_number) then
380 p_rec.yr_perd_id :=
381 ben_cpy_shd.g_old_rec.yr_perd_id;
382 End If;
383 If (p_rec.business_group_id = hr_api.g_number) then
384 p_rec.business_group_id :=
385 ben_cpy_shd.g_old_rec.business_group_id;
386 End If;
387 If (p_rec.pl_id = hr_api.g_number) then
388 p_rec.pl_id :=
389 ben_cpy_shd.g_old_rec.pl_id;
390 End If;
391 If (p_rec.pgm_id = hr_api.g_number) then
392 p_rec.pgm_id :=
393 ben_cpy_shd.g_old_rec.pgm_id;
394 End If;
395 If (p_rec.ordr_num = hr_api.g_number) then
396 p_rec.ordr_num :=
397 ben_cpy_shd.g_old_rec.ordr_num;
398 End If;
399 If (p_rec.acpt_clm_rqsts_thru_dt = hr_api.g_date) then
400 p_rec.acpt_clm_rqsts_thru_dt :=
401 ben_cpy_shd.g_old_rec.acpt_clm_rqsts_thru_dt;
402 End If;
403 If (p_rec.py_clms_thru_dt = hr_api.g_date) then
404 p_rec.py_clms_thru_dt :=
405 ben_cpy_shd.g_old_rec.py_clms_thru_dt;
406 End If;
407 If (p_rec.cpy_attribute_category = hr_api.g_varchar2) then
408 p_rec.cpy_attribute_category :=
409 ben_cpy_shd.g_old_rec.cpy_attribute_category;
410 End If;
411 If (p_rec.cpy_attribute1 = hr_api.g_varchar2) then
412 p_rec.cpy_attribute1 :=
413 ben_cpy_shd.g_old_rec.cpy_attribute1;
414 End If;
415 If (p_rec.cpy_attribute2 = hr_api.g_varchar2) then
416 p_rec.cpy_attribute2 :=
417 ben_cpy_shd.g_old_rec.cpy_attribute2;
418 End If;
419 If (p_rec.cpy_attribute3 = hr_api.g_varchar2) then
420 p_rec.cpy_attribute3 :=
421 ben_cpy_shd.g_old_rec.cpy_attribute3;
422 End If;
423 If (p_rec.cpy_attribute4 = hr_api.g_varchar2) then
424 p_rec.cpy_attribute4 :=
425 ben_cpy_shd.g_old_rec.cpy_attribute4;
426 End If;
427 If (p_rec.cpy_attribute5 = hr_api.g_varchar2) then
428 p_rec.cpy_attribute5 :=
429 ben_cpy_shd.g_old_rec.cpy_attribute5;
430 End If;
431 If (p_rec.cpy_attribute6 = hr_api.g_varchar2) then
432 p_rec.cpy_attribute6 :=
433 ben_cpy_shd.g_old_rec.cpy_attribute6;
434 End If;
435 If (p_rec.cpy_attribute7 = hr_api.g_varchar2) then
436 p_rec.cpy_attribute7 :=
437 ben_cpy_shd.g_old_rec.cpy_attribute7;
438 End If;
439 If (p_rec.cpy_attribute8 = hr_api.g_varchar2) then
440 p_rec.cpy_attribute8 :=
441 ben_cpy_shd.g_old_rec.cpy_attribute8;
442 End If;
443 If (p_rec.cpy_attribute9 = hr_api.g_varchar2) then
444 p_rec.cpy_attribute9 :=
445 ben_cpy_shd.g_old_rec.cpy_attribute9;
446 End If;
447 If (p_rec.cpy_attribute10 = hr_api.g_varchar2) then
448 p_rec.cpy_attribute10 :=
449 ben_cpy_shd.g_old_rec.cpy_attribute10;
450 End If;
451 If (p_rec.cpy_attribute11 = hr_api.g_varchar2) then
452 p_rec.cpy_attribute11 :=
453 ben_cpy_shd.g_old_rec.cpy_attribute11;
454 End If;
455 If (p_rec.cpy_attribute12 = hr_api.g_varchar2) then
456 p_rec.cpy_attribute12 :=
457 ben_cpy_shd.g_old_rec.cpy_attribute12;
458 End If;
459 If (p_rec.cpy_attribute13 = hr_api.g_varchar2) then
460 p_rec.cpy_attribute13 :=
461 ben_cpy_shd.g_old_rec.cpy_attribute13;
462 End If;
463 If (p_rec.cpy_attribute14 = hr_api.g_varchar2) then
464 p_rec.cpy_attribute14 :=
465 ben_cpy_shd.g_old_rec.cpy_attribute14;
466 End If;
467 If (p_rec.cpy_attribute15 = hr_api.g_varchar2) then
468 p_rec.cpy_attribute15 :=
469 ben_cpy_shd.g_old_rec.cpy_attribute15;
470 End If;
471 If (p_rec.cpy_attribute16 = hr_api.g_varchar2) then
472 p_rec.cpy_attribute16 :=
473 ben_cpy_shd.g_old_rec.cpy_attribute16;
474 End If;
475 If (p_rec.cpy_attribute17 = hr_api.g_varchar2) then
476 p_rec.cpy_attribute17 :=
477 ben_cpy_shd.g_old_rec.cpy_attribute17;
478 End If;
479 If (p_rec.cpy_attribute18 = hr_api.g_varchar2) then
480 p_rec.cpy_attribute18 :=
481 ben_cpy_shd.g_old_rec.cpy_attribute18;
482 End If;
483 If (p_rec.cpy_attribute19 = hr_api.g_varchar2) then
484 p_rec.cpy_attribute19 :=
485 ben_cpy_shd.g_old_rec.cpy_attribute19;
486 End If;
487 If (p_rec.cpy_attribute20 = hr_api.g_varchar2) then
488 p_rec.cpy_attribute20 :=
489 ben_cpy_shd.g_old_rec.cpy_attribute20;
490 End If;
491 If (p_rec.cpy_attribute21 = hr_api.g_varchar2) then
492 p_rec.cpy_attribute21 :=
493 ben_cpy_shd.g_old_rec.cpy_attribute21;
494 End If;
495 If (p_rec.cpy_attribute22 = hr_api.g_varchar2) then
496 p_rec.cpy_attribute22 :=
497 ben_cpy_shd.g_old_rec.cpy_attribute22;
498 End If;
499 If (p_rec.cpy_attribute23 = hr_api.g_varchar2) then
500 p_rec.cpy_attribute23 :=
501 ben_cpy_shd.g_old_rec.cpy_attribute23;
502 End If;
503 If (p_rec.cpy_attribute24 = hr_api.g_varchar2) then
504 p_rec.cpy_attribute24 :=
505 ben_cpy_shd.g_old_rec.cpy_attribute24;
506 End If;
507 If (p_rec.cpy_attribute25 = hr_api.g_varchar2) then
508 p_rec.cpy_attribute25 :=
509 ben_cpy_shd.g_old_rec.cpy_attribute25;
510 End If;
511 If (p_rec.cpy_attribute26 = hr_api.g_varchar2) then
512 p_rec.cpy_attribute26 :=
513 ben_cpy_shd.g_old_rec.cpy_attribute26;
514 End If;
515 If (p_rec.cpy_attribute27 = hr_api.g_varchar2) then
516 p_rec.cpy_attribute27 :=
517 ben_cpy_shd.g_old_rec.cpy_attribute27;
518 End If;
519 If (p_rec.cpy_attribute28 = hr_api.g_varchar2) then
520 p_rec.cpy_attribute28 :=
521 ben_cpy_shd.g_old_rec.cpy_attribute28;
522 End If;
523 If (p_rec.cpy_attribute29 = hr_api.g_varchar2) then
524 p_rec.cpy_attribute29 :=
525 ben_cpy_shd.g_old_rec.cpy_attribute29;
526 End If;
527 If (p_rec.cpy_attribute30 = hr_api.g_varchar2) then
528 p_rec.cpy_attribute30 :=
529 ben_cpy_shd.g_old_rec.cpy_attribute30;
530 End If;
531 --
532 hr_utility.set_location(' Leaving:'||l_proc, 10);
533 --
534 End convert_defs;
535 --
536 -- ----------------------------------------------------------------------------
537 -- |---------------------------------< upd >----------------------------------|
538 -- ----------------------------------------------------------------------------
539 Procedure upd
540 (
541 p_rec in out nocopy ben_cpy_shd.g_rec_type
542 ) is
543 --
544 l_proc varchar2(72) := g_package||'upd';
545 --
546 Begin
547 hr_utility.set_location('Entering:'||l_proc, 5);
548 --
549 -- We must lock the row which we need to update.
550 --
551 ben_cpy_shd.lck
552 (
553 p_rec.popl_yr_perd_id,
554 p_rec.object_version_number
555 );
556 --
557 -- 1. During an update system defaults are used to determine if
558 -- arguments have been defaulted or not. We must therefore
559 -- derive the full record structure values to be updated.
560 --
561 -- 2. Call the supporting update validate operations.
562 --
563 convert_defs(p_rec);
564 ben_cpy_bus.update_validate(p_rec);
565 --
566 -- Call the supporting pre-update operation
567 --
568 pre_update(p_rec);
569 --
570 -- Update the row.
571 --
572 update_dml(p_rec);
573 --
574 -- Call the supporting post-update operation
575 --
576 post_update(p_rec);
577 End upd;
578 --
579 -- ----------------------------------------------------------------------------
580 -- |---------------------------------< upd >----------------------------------|
581 -- ----------------------------------------------------------------------------
582 Procedure upd
583 (
584 p_popl_yr_perd_id in number,
585 p_yr_perd_id in number default hr_api.g_number,
586 p_business_group_id in number default hr_api.g_number,
587 p_pl_id in number default hr_api.g_number,
588 p_pgm_id in number default hr_api.g_number,
589 p_ordr_num in number default hr_api.g_number,
590 p_acpt_clm_rqsts_thru_dt in date default hr_api.g_date,
591 p_py_clms_thru_dt in date default hr_api.g_date,
592 p_cpy_attribute_category in varchar2 default hr_api.g_varchar2,
593 p_cpy_attribute1 in varchar2 default hr_api.g_varchar2,
594 p_cpy_attribute2 in varchar2 default hr_api.g_varchar2,
595 p_cpy_attribute3 in varchar2 default hr_api.g_varchar2,
596 p_cpy_attribute4 in varchar2 default hr_api.g_varchar2,
597 p_cpy_attribute5 in varchar2 default hr_api.g_varchar2,
598 p_cpy_attribute6 in varchar2 default hr_api.g_varchar2,
599 p_cpy_attribute7 in varchar2 default hr_api.g_varchar2,
600 p_cpy_attribute8 in varchar2 default hr_api.g_varchar2,
601 p_cpy_attribute9 in varchar2 default hr_api.g_varchar2,
602 p_cpy_attribute10 in varchar2 default hr_api.g_varchar2,
603 p_cpy_attribute11 in varchar2 default hr_api.g_varchar2,
604 p_cpy_attribute12 in varchar2 default hr_api.g_varchar2,
605 p_cpy_attribute13 in varchar2 default hr_api.g_varchar2,
606 p_cpy_attribute14 in varchar2 default hr_api.g_varchar2,
607 p_cpy_attribute15 in varchar2 default hr_api.g_varchar2,
608 p_cpy_attribute16 in varchar2 default hr_api.g_varchar2,
609 p_cpy_attribute17 in varchar2 default hr_api.g_varchar2,
610 p_cpy_attribute18 in varchar2 default hr_api.g_varchar2,
611 p_cpy_attribute19 in varchar2 default hr_api.g_varchar2,
612 p_cpy_attribute20 in varchar2 default hr_api.g_varchar2,
613 p_cpy_attribute21 in varchar2 default hr_api.g_varchar2,
614 p_cpy_attribute22 in varchar2 default hr_api.g_varchar2,
615 p_cpy_attribute23 in varchar2 default hr_api.g_varchar2,
616 p_cpy_attribute24 in varchar2 default hr_api.g_varchar2,
617 p_cpy_attribute25 in varchar2 default hr_api.g_varchar2,
618 p_cpy_attribute26 in varchar2 default hr_api.g_varchar2,
619 p_cpy_attribute27 in varchar2 default hr_api.g_varchar2,
620 p_cpy_attribute28 in varchar2 default hr_api.g_varchar2,
621 p_cpy_attribute29 in varchar2 default hr_api.g_varchar2,
622 p_cpy_attribute30 in varchar2 default hr_api.g_varchar2,
623 p_object_version_number in out nocopy number
624 ) is
625 --
626 l_rec ben_cpy_shd.g_rec_type;
627 l_proc varchar2(72) := g_package||'upd';
628 --
629 Begin
630 hr_utility.set_location('Entering:'||l_proc, 5);
631 --
632 -- Call conversion function to turn arguments into the
633 -- l_rec structure.
634 --
635 l_rec :=
636 ben_cpy_shd.convert_args
637 (
638 p_popl_yr_perd_id,
639 p_yr_perd_id,
640 p_business_group_id,
641 p_pl_id,
642 p_pgm_id,
643 p_ordr_num,
644 p_acpt_clm_rqsts_thru_dt,
645 p_py_clms_thru_dt,
646 p_cpy_attribute_category,
647 p_cpy_attribute1,
648 p_cpy_attribute2,
649 p_cpy_attribute3,
650 p_cpy_attribute4,
651 p_cpy_attribute5,
652 p_cpy_attribute6,
653 p_cpy_attribute7,
654 p_cpy_attribute8,
655 p_cpy_attribute9,
656 p_cpy_attribute10,
657 p_cpy_attribute11,
658 p_cpy_attribute12,
659 p_cpy_attribute13,
660 p_cpy_attribute14,
661 p_cpy_attribute15,
662 p_cpy_attribute16,
663 p_cpy_attribute17,
664 p_cpy_attribute18,
665 p_cpy_attribute19,
666 p_cpy_attribute20,
667 p_cpy_attribute21,
668 p_cpy_attribute22,
669 p_cpy_attribute23,
670 p_cpy_attribute24,
671 p_cpy_attribute25,
672 p_cpy_attribute26,
673 p_cpy_attribute27,
674 p_cpy_attribute28,
675 p_cpy_attribute29,
676 p_cpy_attribute30,
677 p_object_version_number
678 );
679 --
680 -- Having converted the arguments into the
681 -- plsql record structure we call the corresponding record
682 -- business process.
683 --
684 upd(l_rec);
685 p_object_version_number := l_rec.object_version_number;
686 --
687 hr_utility.set_location(' Leaving:'||l_proc, 10);
688 End upd;
689 --
690 end ben_cpy_upd;