1 Package Body ben_erc_upd as
2 /* $Header: beercrhi.pkb 115.2 2002/12/11 11:16:15 hnarayan noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' ben_erc_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_erc_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_erc_shd.g_api_dml := true; -- Set the api dml status
66 --
67 -- Update the ben_enrt_rt_ctfn Row
68 --
69 update ben_enrt_rt_ctfn
70 set
71 enrt_rt_ctfn_id = p_rec.enrt_rt_ctfn_id,
72 enrt_ctfn_typ_cd = p_rec.enrt_ctfn_typ_cd,
73 rqd_flag = p_rec.rqd_flag,
74 enrt_rt_id = p_rec.enrt_rt_id,
75 business_group_id = p_rec.business_group_id,
76 erc_attribute_category = p_rec.erc_attribute_category,
77 erc_attribute1 = p_rec.erc_attribute1,
78 erc_attribute2 = p_rec.erc_attribute2,
79 erc_attribute3 = p_rec.erc_attribute3,
80 erc_attribute4 = p_rec.erc_attribute4,
81 erc_attribute5 = p_rec.erc_attribute5,
82 erc_attribute6 = p_rec.erc_attribute6,
83 erc_attribute7 = p_rec.erc_attribute7,
84 erc_attribute8 = p_rec.erc_attribute8,
85 erc_attribute9 = p_rec.erc_attribute9,
86 erc_attribute10 = p_rec.erc_attribute10,
87 erc_attribute11 = p_rec.erc_attribute11,
88 erc_attribute12 = p_rec.erc_attribute12,
89 erc_attribute13 = p_rec.erc_attribute13,
90 erc_attribute14 = p_rec.erc_attribute14,
91 erc_attribute15 = p_rec.erc_attribute15,
92 erc_attribute16 = p_rec.erc_attribute16,
93 erc_attribute17 = p_rec.erc_attribute17,
94 erc_attribute18 = p_rec.erc_attribute18,
95 erc_attribute19 = p_rec.erc_attribute19,
96 erc_attribute20 = p_rec.erc_attribute20,
97 erc_attribute21 = p_rec.erc_attribute21,
98 erc_attribute22 = p_rec.erc_attribute22,
99 erc_attribute23 = p_rec.erc_attribute23,
100 erc_attribute24 = p_rec.erc_attribute24,
101 erc_attribute25 = p_rec.erc_attribute25,
102 erc_attribute26 = p_rec.erc_attribute26,
103 erc_attribute27 = p_rec.erc_attribute27,
104 erc_attribute28 = p_rec.erc_attribute28,
105 erc_attribute29 = p_rec.erc_attribute29,
106 erc_attribute30 = p_rec.erc_attribute30,
107 request_id = p_rec.request_id,
108 program_application_id = p_rec.program_application_id,
109 program_id = p_rec.program_id,
110 program_update_date = p_rec.program_update_date,
111 object_version_number = p_rec.object_version_number
112 where enrt_rt_ctfn_id = p_rec.enrt_rt_ctfn_id;
113 --
114 ben_erc_shd.g_api_dml := false; -- Unset the api dml status
115 --
116 hr_utility.set_location(' Leaving:'||l_proc, 10);
117 --
118 Exception
119 When hr_api.check_integrity_violated Then
120 -- A check constraint has been violated
121 ben_erc_shd.g_api_dml := false; -- Unset the api dml status
122 ben_erc_shd.constraint_error
123 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
124 When hr_api.parent_integrity_violated Then
125 -- Parent integrity has been violated
126 ben_erc_shd.g_api_dml := false; -- Unset the api dml status
127 ben_erc_shd.constraint_error
128 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
129 When hr_api.unique_integrity_violated Then
130 -- Unique integrity has been violated
131 ben_erc_shd.g_api_dml := false; -- Unset the api dml status
132 ben_erc_shd.constraint_error
133 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
134 When Others Then
135 ben_erc_shd.g_api_dml := false; -- Unset the api dml status
136 Raise;
137 End update_dml;
138 --
139 -- ----------------------------------------------------------------------------
140 -- |------------------------------< pre_update >------------------------------|
141 -- ----------------------------------------------------------------------------
142 -- {Start Of Comments}
143 --
144 -- Description:
145 -- This private procedure contains any processing which is required before
146 -- the update dml.
147 --
148 -- Prerequisites:
149 -- This is an internal procedure which is called from the upd procedure.
150 --
151 -- In Parameters:
152 -- A Pl/Sql record structre.
153 --
154 -- Post Success:
155 -- Processing continues.
156 --
157 -- Post Failure:
158 -- If an error has occurred, an error message and exception will be raised
159 -- but not handled.
160 --
161 -- Developer Implementation Notes:
162 -- Any pre-processing required before the update dml is issued should be
163 -- coded within this procedure. It is important to note that any 3rd party
164 -- maintenance should be reviewed before placing in this procedure.
165 --
166 -- Access Status:
167 -- Internal Row Handler Use Only.
168 --
169 -- {End Of Comments}
170 -- ----------------------------------------------------------------------------
171 Procedure pre_update(p_rec in ben_erc_shd.g_rec_type) 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 the
188 -- 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 structre.
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,p_rec in ben_erc_shd.g_rec_type) is
215 --
216 l_proc varchar2(72) := g_package||'post_update';
217 --
218 Begin
219 hr_utility.set_location('Entering:'||l_proc, 5);
220 --
221 --
222 -- Start of API User Hook for post_update.
223 --
224 begin
225 --
226 ben_erc_rku.after_update
227 (
228 p_enrt_rt_ctfn_id =>p_rec.enrt_rt_ctfn_id
229 ,p_enrt_ctfn_typ_cd =>p_rec.enrt_ctfn_typ_cd
230 ,p_rqd_flag =>p_rec.rqd_flag
231 ,p_enrt_rt_id =>p_rec.enrt_rt_id
232 ,p_business_group_id =>p_rec.business_group_id
233 ,p_erc_attribute_category =>p_rec.erc_attribute_category
234 ,p_erc_attribute1 =>p_rec.erc_attribute1
235 ,p_erc_attribute2 =>p_rec.erc_attribute2
236 ,p_erc_attribute3 =>p_rec.erc_attribute3
237 ,p_erc_attribute4 =>p_rec.erc_attribute4
238 ,p_erc_attribute5 =>p_rec.erc_attribute5
239 ,p_erc_attribute6 =>p_rec.erc_attribute6
240 ,p_erc_attribute7 =>p_rec.erc_attribute7
241 ,p_erc_attribute8 =>p_rec.erc_attribute8
242 ,p_erc_attribute9 =>p_rec.erc_attribute9
243 ,p_erc_attribute10 =>p_rec.erc_attribute10
244 ,p_erc_attribute11 =>p_rec.erc_attribute11
245 ,p_erc_attribute12 =>p_rec.erc_attribute12
246 ,p_erc_attribute13 =>p_rec.erc_attribute13
247 ,p_erc_attribute14 =>p_rec.erc_attribute14
248 ,p_erc_attribute15 =>p_rec.erc_attribute15
249 ,p_erc_attribute16 =>p_rec.erc_attribute16
250 ,p_erc_attribute17 =>p_rec.erc_attribute17
251 ,p_erc_attribute18 =>p_rec.erc_attribute18
252 ,p_erc_attribute19 =>p_rec.erc_attribute19
253 ,p_erc_attribute20 =>p_rec.erc_attribute20
254 ,p_erc_attribute21 =>p_rec.erc_attribute21
255 ,p_erc_attribute22 =>p_rec.erc_attribute22
256 ,p_erc_attribute23 =>p_rec.erc_attribute23
257 ,p_erc_attribute24 =>p_rec.erc_attribute24
258 ,p_erc_attribute25 =>p_rec.erc_attribute25
259 ,p_erc_attribute26 =>p_rec.erc_attribute26
260 ,p_erc_attribute27 =>p_rec.erc_attribute27
261 ,p_erc_attribute28 =>p_rec.erc_attribute28
262 ,p_erc_attribute29 =>p_rec.erc_attribute29
263 ,p_erc_attribute30 =>p_rec.erc_attribute30
264 ,p_request_id =>p_rec.request_id
265 ,p_program_application_id =>p_rec.program_application_id
266 ,p_program_id =>p_rec.program_id
267 ,p_program_update_date =>p_rec.program_update_date
268 ,p_object_version_number =>p_rec.object_version_number
269 ,p_effective_date =>p_effective_date
270 ,p_enrt_ctfn_typ_cd_o =>ben_erc_shd.g_old_rec.enrt_ctfn_typ_cd
271 ,p_rqd_flag_o =>ben_erc_shd.g_old_rec.rqd_flag
272 ,p_enrt_rt_id_o =>ben_erc_shd.g_old_rec.enrt_rt_id
273 ,p_business_group_id_o =>ben_erc_shd.g_old_rec.business_group_id
274 ,p_erc_attribute_category_o =>ben_erc_shd.g_old_rec.erc_attribute_category
275 ,p_erc_attribute1_o =>ben_erc_shd.g_old_rec.erc_attribute1
276 ,p_erc_attribute2_o =>ben_erc_shd.g_old_rec.erc_attribute2
277 ,p_erc_attribute3_o =>ben_erc_shd.g_old_rec.erc_attribute3
278 ,p_erc_attribute4_o =>ben_erc_shd.g_old_rec.erc_attribute4
279 ,p_erc_attribute5_o =>ben_erc_shd.g_old_rec.erc_attribute5
280 ,p_erc_attribute6_o =>ben_erc_shd.g_old_rec.erc_attribute6
281 ,p_erc_attribute7_o =>ben_erc_shd.g_old_rec.erc_attribute7
282 ,p_erc_attribute8_o =>ben_erc_shd.g_old_rec.erc_attribute8
283 ,p_erc_attribute9_o =>ben_erc_shd.g_old_rec.erc_attribute9
284 ,p_erc_attribute10_o =>ben_erc_shd.g_old_rec.erc_attribute10
285 ,p_erc_attribute11_o =>ben_erc_shd.g_old_rec.erc_attribute11
286 ,p_erc_attribute12_o =>ben_erc_shd.g_old_rec.erc_attribute12
287 ,p_erc_attribute13_o =>ben_erc_shd.g_old_rec.erc_attribute13
288 ,p_erc_attribute14_o =>ben_erc_shd.g_old_rec.erc_attribute14
289 ,p_erc_attribute15_o =>ben_erc_shd.g_old_rec.erc_attribute15
290 ,p_erc_attribute16_o =>ben_erc_shd.g_old_rec.erc_attribute16
291 ,p_erc_attribute17_o =>ben_erc_shd.g_old_rec.erc_attribute17
292 ,p_erc_attribute18_o =>ben_erc_shd.g_old_rec.erc_attribute18
293 ,p_erc_attribute19_o =>ben_erc_shd.g_old_rec.erc_attribute19
294 ,p_erc_attribute20_o =>ben_erc_shd.g_old_rec.erc_attribute20
295 ,p_erc_attribute21_o =>ben_erc_shd.g_old_rec.erc_attribute21
296 ,p_erc_attribute22_o =>ben_erc_shd.g_old_rec.erc_attribute22
297 ,p_erc_attribute23_o =>ben_erc_shd.g_old_rec.erc_attribute23
298 ,p_erc_attribute24_o =>ben_erc_shd.g_old_rec.erc_attribute24
299 ,p_erc_attribute25_o =>ben_erc_shd.g_old_rec.erc_attribute25
300 ,p_erc_attribute26_o =>ben_erc_shd.g_old_rec.erc_attribute26
301 ,p_erc_attribute27_o =>ben_erc_shd.g_old_rec.erc_attribute27
302 ,p_erc_attribute28_o =>ben_erc_shd.g_old_rec.erc_attribute28
303 ,p_erc_attribute29_o =>ben_erc_shd.g_old_rec.erc_attribute29
304 ,p_erc_attribute30_o =>ben_erc_shd.g_old_rec.erc_attribute30
305 ,p_request_id_o =>ben_erc_shd.g_old_rec.request_id
306 ,p_program_application_id_o =>ben_erc_shd.g_old_rec.program_application_id
307 ,p_program_id_o =>ben_erc_shd.g_old_rec.program_id
308 ,p_program_update_date_o =>ben_erc_shd.g_old_rec.program_update_date
309 ,p_object_version_number_o =>ben_erc_shd.g_old_rec.object_version_number
310 );
311 --
312 exception
313 --
314 when hr_api.cannot_find_prog_unit then
315 --
316 hr_api.cannot_find_prog_unit_error
317 (p_module_name => 'ben_enrt_rt_ctfn'
318 ,p_hook_type => 'AU');
319 --
320 end;
321 --
322 -- End of API User Hook for post_update.
323 --
324 --
325 hr_utility.set_location(' Leaving:'||l_proc, 10);
326 End post_update;
327 --
328 -- ----------------------------------------------------------------------------
329 -- |-----------------------------< convert_defs >-----------------------------|
330 -- ----------------------------------------------------------------------------
331 -- {Start Of Comments}
332 --
333 -- Description:
334 -- The Convert_Defs procedure has one very important function:
335 -- It must return the record structure for the row with all system defaulted
336 -- values converted into its corresponding parameter value for update. When
337 -- we attempt to update a row through the Upd process , certain
338 -- parameters can be defaulted which enables flexibility in the calling of
339 -- the upd process (e.g. only attributes which need to be updated need to be
340 -- specified). For the upd process to determine which attributes
341 -- have NOT been specified we need to check if the parameter has a reserved
342 -- system default value. Therefore, for all parameters which have a
343 -- corresponding reserved system default mechanism specified we need to
344 -- check if a system default is being used. If a system default is being
345 -- used then we convert the defaulted value into its corresponding attribute
346 -- value held in the g_old_rec data structure.
347 --
348 -- Prerequisites:
349 -- This private function can only be called from the upd process.
350 --
351 -- In Parameters:
352 -- A Pl/Sql record structre.
353 --
354 -- Post Success:
355 -- The record structure will be returned with all system defaulted parameter
356 -- values converted into its current row attribute value.
357 --
358 -- Post Failure:
359 -- No direct error handling is required within this function. Any possible
360 -- errors within this procedure will be a PL/SQL value error due to conversion
361 -- of datatypes or data lengths.
362 --
363 -- Developer Implementation Notes:
364 -- None.
365 --
366 -- Access Status:
367 -- Internal Row Handler Use Only.
368 --
369 -- {End Of Comments}
370 -- ----------------------------------------------------------------------------
371 Procedure convert_defs(p_rec in out nocopy ben_erc_shd.g_rec_type) is
372 --
373 l_proc varchar2(72) := g_package||'convert_defs';
374 --
375 Begin
376 --
377 hr_utility.set_location('Entering:'||l_proc, 5);
378 --
379 -- We must now examine each argument value in the
380 -- p_rec plsql record structure
381 -- to see if a system default is being used. If a system default
382 -- is being used then we must set to the 'current' argument value.
383 --
384 If (p_rec.enrt_ctfn_typ_cd = hr_api.g_varchar2) then
385 p_rec.enrt_ctfn_typ_cd :=
386 ben_erc_shd.g_old_rec.enrt_ctfn_typ_cd;
387 End If;
388 If (p_rec.rqd_flag = hr_api.g_varchar2) then
389 p_rec.rqd_flag :=
390 ben_erc_shd.g_old_rec.rqd_flag;
391 End If;
392 If (p_rec.enrt_rt_id = hr_api.g_number) then
393 p_rec.enrt_rt_id :=
394 ben_erc_shd.g_old_rec.enrt_rt_id;
395 End If;
396 If (p_rec.business_group_id = hr_api.g_number) then
397 p_rec.business_group_id :=
398 ben_erc_shd.g_old_rec.business_group_id;
399 End If;
400 If (p_rec.erc_attribute_category = hr_api.g_varchar2) then
401 p_rec.erc_attribute_category :=
402 ben_erc_shd.g_old_rec.erc_attribute_category;
403 End If;
404 If (p_rec.erc_attribute1 = hr_api.g_varchar2) then
405 p_rec.erc_attribute1 :=
406 ben_erc_shd.g_old_rec.erc_attribute1;
407 End If;
408 If (p_rec.erc_attribute2 = hr_api.g_varchar2) then
409 p_rec.erc_attribute2 :=
410 ben_erc_shd.g_old_rec.erc_attribute2;
411 End If;
412 If (p_rec.erc_attribute3 = hr_api.g_varchar2) then
413 p_rec.erc_attribute3 :=
414 ben_erc_shd.g_old_rec.erc_attribute3;
415 End If;
416 If (p_rec.erc_attribute4 = hr_api.g_varchar2) then
417 p_rec.erc_attribute4 :=
418 ben_erc_shd.g_old_rec.erc_attribute4;
419 End If;
420 If (p_rec.erc_attribute5 = hr_api.g_varchar2) then
421 p_rec.erc_attribute5 :=
422 ben_erc_shd.g_old_rec.erc_attribute5;
423 End If;
424 If (p_rec.erc_attribute6 = hr_api.g_varchar2) then
425 p_rec.erc_attribute6 :=
426 ben_erc_shd.g_old_rec.erc_attribute6;
427 End If;
428 If (p_rec.erc_attribute7 = hr_api.g_varchar2) then
429 p_rec.erc_attribute7 :=
430 ben_erc_shd.g_old_rec.erc_attribute7;
431 End If;
432 If (p_rec.erc_attribute8 = hr_api.g_varchar2) then
433 p_rec.erc_attribute8 :=
434 ben_erc_shd.g_old_rec.erc_attribute8;
435 End If;
436 If (p_rec.erc_attribute9 = hr_api.g_varchar2) then
437 p_rec.erc_attribute9 :=
438 ben_erc_shd.g_old_rec.erc_attribute9;
439 End If;
440 If (p_rec.erc_attribute10 = hr_api.g_varchar2) then
441 p_rec.erc_attribute10 :=
442 ben_erc_shd.g_old_rec.erc_attribute10;
443 End If;
444 If (p_rec.erc_attribute11 = hr_api.g_varchar2) then
445 p_rec.erc_attribute11 :=
446 ben_erc_shd.g_old_rec.erc_attribute11;
447 End If;
448 If (p_rec.erc_attribute12 = hr_api.g_varchar2) then
449 p_rec.erc_attribute12 :=
450 ben_erc_shd.g_old_rec.erc_attribute12;
451 End If;
452 If (p_rec.erc_attribute13 = hr_api.g_varchar2) then
453 p_rec.erc_attribute13 :=
454 ben_erc_shd.g_old_rec.erc_attribute13;
455 End If;
456 If (p_rec.erc_attribute14 = hr_api.g_varchar2) then
457 p_rec.erc_attribute14 :=
458 ben_erc_shd.g_old_rec.erc_attribute14;
459 End If;
460 If (p_rec.erc_attribute15 = hr_api.g_varchar2) then
461 p_rec.erc_attribute15 :=
462 ben_erc_shd.g_old_rec.erc_attribute15;
463 End If;
464 If (p_rec.erc_attribute16 = hr_api.g_varchar2) then
465 p_rec.erc_attribute16 :=
466 ben_erc_shd.g_old_rec.erc_attribute16;
467 End If;
468 If (p_rec.erc_attribute17 = hr_api.g_varchar2) then
469 p_rec.erc_attribute17 :=
470 ben_erc_shd.g_old_rec.erc_attribute17;
471 End If;
472 If (p_rec.erc_attribute18 = hr_api.g_varchar2) then
473 p_rec.erc_attribute18 :=
474 ben_erc_shd.g_old_rec.erc_attribute18;
475 End If;
476 If (p_rec.erc_attribute19 = hr_api.g_varchar2) then
477 p_rec.erc_attribute19 :=
478 ben_erc_shd.g_old_rec.erc_attribute19;
479 End If;
480 If (p_rec.erc_attribute20 = hr_api.g_varchar2) then
481 p_rec.erc_attribute20 :=
482 ben_erc_shd.g_old_rec.erc_attribute20;
483 End If;
484 If (p_rec.erc_attribute21 = hr_api.g_varchar2) then
485 p_rec.erc_attribute21 :=
486 ben_erc_shd.g_old_rec.erc_attribute21;
487 End If;
488 If (p_rec.erc_attribute22 = hr_api.g_varchar2) then
489 p_rec.erc_attribute22 :=
490 ben_erc_shd.g_old_rec.erc_attribute22;
491 End If;
492 If (p_rec.erc_attribute23 = hr_api.g_varchar2) then
493 p_rec.erc_attribute23 :=
494 ben_erc_shd.g_old_rec.erc_attribute23;
495 End If;
496 If (p_rec.erc_attribute24 = hr_api.g_varchar2) then
497 p_rec.erc_attribute24 :=
498 ben_erc_shd.g_old_rec.erc_attribute24;
499 End If;
500 If (p_rec.erc_attribute25 = hr_api.g_varchar2) then
501 p_rec.erc_attribute25 :=
502 ben_erc_shd.g_old_rec.erc_attribute25;
503 End If;
504 If (p_rec.erc_attribute26 = hr_api.g_varchar2) then
505 p_rec.erc_attribute26 :=
506 ben_erc_shd.g_old_rec.erc_attribute26;
507 End If;
508 If (p_rec.erc_attribute27 = hr_api.g_varchar2) then
509 p_rec.erc_attribute27 :=
510 ben_erc_shd.g_old_rec.erc_attribute27;
511 End If;
512 If (p_rec.erc_attribute28 = hr_api.g_varchar2) then
513 p_rec.erc_attribute28 :=
514 ben_erc_shd.g_old_rec.erc_attribute28;
515 End If;
516 If (p_rec.erc_attribute29 = hr_api.g_varchar2) then
517 p_rec.erc_attribute29 :=
518 ben_erc_shd.g_old_rec.erc_attribute29;
519 End If;
520 If (p_rec.erc_attribute30 = hr_api.g_varchar2) then
521 p_rec.erc_attribute30 :=
522 ben_erc_shd.g_old_rec.erc_attribute30;
523 End If;
524 If (p_rec.request_id = hr_api.g_number) then
525 p_rec.request_id :=
526 ben_erc_shd.g_old_rec.request_id;
527 End If;
528 If (p_rec.program_application_id = hr_api.g_number) then
529 p_rec.program_application_id :=
530 ben_erc_shd.g_old_rec.program_application_id;
531 End If;
532 If (p_rec.program_id = hr_api.g_number) then
533 p_rec.program_id :=
534 ben_erc_shd.g_old_rec.program_id;
535 End If;
536 If (p_rec.program_update_date = hr_api.g_date) then
537 p_rec.program_update_date :=
538 ben_erc_shd.g_old_rec.program_update_date;
539 End If;
540
541 --
542 hr_utility.set_location(' Leaving:'||l_proc, 10);
543 --
544 End convert_defs;
545 --
546 -- ----------------------------------------------------------------------------
547 -- |---------------------------------< upd >----------------------------------|
548 -- ----------------------------------------------------------------------------
549 Procedure upd
550 (
551 p_effective_date in date,
552 p_rec in out nocopy ben_erc_shd.g_rec_type
553 ) is
554 --
555 l_proc varchar2(72) := g_package||'upd';
556 --
557 Begin
558 hr_utility.set_location('Entering:'||l_proc, 5);
559 --
560 -- We must lock the row which we need to update.
561 --
562 ben_erc_shd.lck
563 (
564 p_rec.enrt_rt_ctfn_id,
565 p_rec.object_version_number
566 );
567 --
568 -- 1. During an update system defaults are used to determine if
569 -- arguments have been defaulted or not. We must therefore
570 -- derive the full record structure values to be updated.
571 --
572 -- 2. Call the supporting update validate operations.
573 --
574 convert_defs(p_rec);
575 ben_erc_bus.update_validate(p_rec
576 ,p_effective_date);
577 --
578 -- Call the supporting pre-update operation
579 --
580 pre_update(p_rec);
581 --
582 -- Update the row.
583 --
584 update_dml(p_rec);
585 --
586 -- Call the supporting post-update operation
587 --
588 post_update(
589 p_effective_date,p_rec);
590 End upd;
591 --
592 -- ----------------------------------------------------------------------------
593 -- |---------------------------------< upd >----------------------------------|
594 -- ----------------------------------------------------------------------------
595 Procedure upd
596 (
597 p_effective_date in date,
598 p_enrt_rt_ctfn_id in number,
599 p_enrt_ctfn_typ_cd in varchar2 default hr_api.g_varchar2,
600 p_rqd_flag in varchar2 default hr_api.g_varchar2,
601 p_enrt_rt_id in number default hr_api.g_number,
602 p_business_group_id in number default hr_api.g_number,
603 p_erc_attribute_category in varchar2 default hr_api.g_varchar2,
604 p_erc_attribute1 in varchar2 default hr_api.g_varchar2,
605 p_erc_attribute2 in varchar2 default hr_api.g_varchar2,
606 p_erc_attribute3 in varchar2 default hr_api.g_varchar2,
607 p_erc_attribute4 in varchar2 default hr_api.g_varchar2,
608 p_erc_attribute5 in varchar2 default hr_api.g_varchar2,
609 p_erc_attribute6 in varchar2 default hr_api.g_varchar2,
610 p_erc_attribute7 in varchar2 default hr_api.g_varchar2,
611 p_erc_attribute8 in varchar2 default hr_api.g_varchar2,
612 p_erc_attribute9 in varchar2 default hr_api.g_varchar2,
613 p_erc_attribute10 in varchar2 default hr_api.g_varchar2,
614 p_erc_attribute11 in varchar2 default hr_api.g_varchar2,
615 p_erc_attribute12 in varchar2 default hr_api.g_varchar2,
616 p_erc_attribute13 in varchar2 default hr_api.g_varchar2,
617 p_erc_attribute14 in varchar2 default hr_api.g_varchar2,
618 p_erc_attribute15 in varchar2 default hr_api.g_varchar2,
619 p_erc_attribute16 in varchar2 default hr_api.g_varchar2,
620 p_erc_attribute17 in varchar2 default hr_api.g_varchar2,
621 p_erc_attribute18 in varchar2 default hr_api.g_varchar2,
622 p_erc_attribute19 in varchar2 default hr_api.g_varchar2,
623 p_erc_attribute20 in varchar2 default hr_api.g_varchar2,
624 p_erc_attribute21 in varchar2 default hr_api.g_varchar2,
625 p_erc_attribute22 in varchar2 default hr_api.g_varchar2,
626 p_erc_attribute23 in varchar2 default hr_api.g_varchar2,
627 p_erc_attribute24 in varchar2 default hr_api.g_varchar2,
628 p_erc_attribute25 in varchar2 default hr_api.g_varchar2,
629 p_erc_attribute26 in varchar2 default hr_api.g_varchar2,
630 p_erc_attribute27 in varchar2 default hr_api.g_varchar2,
631 p_erc_attribute28 in varchar2 default hr_api.g_varchar2,
632 p_erc_attribute29 in varchar2 default hr_api.g_varchar2,
633 p_erc_attribute30 in varchar2 default hr_api.g_varchar2,
634 p_request_id in number default hr_api.g_number,
635 p_program_application_id in number default hr_api.g_number,
636 p_program_id in number default hr_api.g_number,
637 p_program_update_date in date default hr_api.g_date,
638 p_object_version_number in out nocopy number
639 ) is
640 --
641 l_rec ben_erc_shd.g_rec_type;
642 l_proc varchar2(72) := g_package||'upd';
643 --
644 Begin
645 hr_utility.set_location('Entering:'||l_proc, 5);
646 --
647 -- Call conversion function to turn arguments into the
648 -- l_rec structure.
649 --
650 l_rec :=
651 ben_erc_shd.convert_args
652 (
653 p_enrt_rt_ctfn_id,
654 p_enrt_ctfn_typ_cd,
655 p_rqd_flag,
656 p_enrt_rt_id,
657 p_business_group_id,
658 p_erc_attribute_category,
659 p_erc_attribute1,
660 p_erc_attribute2,
661 p_erc_attribute3,
662 p_erc_attribute4,
663 p_erc_attribute5,
664 p_erc_attribute6,
665 p_erc_attribute7,
666 p_erc_attribute8,
667 p_erc_attribute9,
668 p_erc_attribute10,
669 p_erc_attribute11,
670 p_erc_attribute12,
671 p_erc_attribute13,
672 p_erc_attribute14,
673 p_erc_attribute15,
674 p_erc_attribute16,
675 p_erc_attribute17,
676 p_erc_attribute18,
677 p_erc_attribute19,
678 p_erc_attribute20,
679 p_erc_attribute21,
680 p_erc_attribute22,
681 p_erc_attribute23,
682 p_erc_attribute24,
683 p_erc_attribute25,
684 p_erc_attribute26,
685 p_erc_attribute27,
686 p_erc_attribute28,
687 p_erc_attribute29,
688 p_erc_attribute30,
689 p_request_id,
690 p_program_application_id,
691 p_program_id,
692 p_program_update_date,
693 p_object_version_number
694 );
695 --
696 -- Having converted the arguments into the
697 -- plsql record structure we call the corresponding record
698 -- business process.
699 --
700 upd(
701 p_effective_date,l_rec);
702 p_object_version_number := l_rec.object_version_number;
703 --
704 hr_utility.set_location(' Leaving:'||l_proc, 10);
705 End upd;
706 --
707 end ben_erc_upd;