1 Package Body ben_cqb_upd as
2 /* $Header: becqbrhi.pkb 115.7 2002/12/16 10:30:14 rpgupta ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' ben_cqb_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_cqb_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_cqb_shd.g_api_dml := true; -- Set the api dml status
66 --
67 -- Update the ben_cbr_quald_bnf Row
68 --
69 update ben_cbr_quald_bnf
70 set
71 cbr_quald_bnf_id = p_rec.cbr_quald_bnf_id,
72 quald_bnf_flag = p_rec.quald_bnf_flag,
73 cbr_elig_perd_strt_dt = p_rec.cbr_elig_perd_strt_dt,
74 cbr_elig_perd_end_dt = p_rec.cbr_elig_perd_end_dt,
75 quald_bnf_person_id = p_rec.quald_bnf_person_id,
76 pgm_id = p_rec.pgm_id,
77 ptip_id = p_rec.ptip_id,
78 pl_typ_id = p_rec.pl_typ_id,
79 cvrd_emp_person_id = p_rec.cvrd_emp_person_id,
80 cbr_inelg_rsn_cd = p_rec.cbr_inelg_rsn_cd,
81 business_group_id = p_rec.business_group_id,
82 cqb_attribute_category = p_rec.cqb_attribute_category,
83 cqb_attribute1 = p_rec.cqb_attribute1,
84 cqb_attribute2 = p_rec.cqb_attribute2,
85 cqb_attribute3 = p_rec.cqb_attribute3,
86 cqb_attribute4 = p_rec.cqb_attribute4,
87 cqb_attribute5 = p_rec.cqb_attribute5,
88 cqb_attribute6 = p_rec.cqb_attribute6,
89 cqb_attribute7 = p_rec.cqb_attribute7,
90 cqb_attribute8 = p_rec.cqb_attribute8,
91 cqb_attribute9 = p_rec.cqb_attribute9,
92 cqb_attribute10 = p_rec.cqb_attribute10,
93 cqb_attribute11 = p_rec.cqb_attribute11,
94 cqb_attribute12 = p_rec.cqb_attribute12,
95 cqb_attribute13 = p_rec.cqb_attribute13,
96 cqb_attribute14 = p_rec.cqb_attribute14,
97 cqb_attribute15 = p_rec.cqb_attribute15,
98 cqb_attribute16 = p_rec.cqb_attribute16,
99 cqb_attribute17 = p_rec.cqb_attribute17,
100 cqb_attribute18 = p_rec.cqb_attribute18,
101 cqb_attribute19 = p_rec.cqb_attribute19,
102 cqb_attribute20 = p_rec.cqb_attribute20,
103 cqb_attribute21 = p_rec.cqb_attribute21,
104 cqb_attribute22 = p_rec.cqb_attribute22,
105 cqb_attribute23 = p_rec.cqb_attribute23,
106 cqb_attribute24 = p_rec.cqb_attribute24,
107 cqb_attribute25 = p_rec.cqb_attribute25,
108 cqb_attribute26 = p_rec.cqb_attribute26,
109 cqb_attribute27 = p_rec.cqb_attribute27,
110 cqb_attribute28 = p_rec.cqb_attribute28,
111 cqb_attribute29 = p_rec.cqb_attribute29,
112 cqb_attribute30 = p_rec.cqb_attribute30,
113 object_version_number = p_rec.object_version_number
114 where cbr_quald_bnf_id = p_rec.cbr_quald_bnf_id;
115 --
116 ben_cqb_shd.g_api_dml := false; -- Unset the api dml status
117 --
118 hr_utility.set_location(' Leaving:'||l_proc, 10);
119 --
120 Exception
121 When hr_api.check_integrity_violated Then
122 -- A check constraint has been violated
123 ben_cqb_shd.g_api_dml := false; -- Unset the api dml status
124 ben_cqb_shd.constraint_error
125 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
126 When hr_api.parent_integrity_violated Then
127 -- Parent integrity has been violated
128 ben_cqb_shd.g_api_dml := false; -- Unset the api dml status
129 ben_cqb_shd.constraint_error
130 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
131 When hr_api.unique_integrity_violated Then
132 -- Unique integrity has been violated
133 ben_cqb_shd.g_api_dml := false; -- Unset the api dml status
134 ben_cqb_shd.constraint_error
135 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
136 When Others Then
137 ben_cqb_shd.g_api_dml := false; -- Unset the api dml status
138 Raise;
139 End update_dml;
140 --
141 -- ----------------------------------------------------------------------------
142 -- |------------------------------< pre_update >------------------------------|
143 -- ----------------------------------------------------------------------------
144 -- {Start Of Comments}
145 --
146 -- Description:
147 -- This private procedure contains any processing which is required before
148 -- the update dml.
149 --
150 -- Prerequisites:
151 -- This is an internal procedure which is called from the upd procedure.
152 --
153 -- In Parameters:
154 -- A Pl/Sql record structre.
155 --
156 -- Post Success:
157 -- Processing continues.
158 --
159 -- Post Failure:
160 -- If an error has occurred, an error message and exception will be raised
161 -- but not handled.
162 --
163 -- Developer Implementation Notes:
164 -- Any pre-processing required before the update dml is issued should be
165 -- coded within this procedure. It is important to note that any 3rd party
166 -- maintenance should be reviewed before placing in this procedure.
167 --
168 -- Access Status:
169 -- Internal Row Handler Use Only.
170 --
171 -- {End Of Comments}
172 -- ----------------------------------------------------------------------------
173 Procedure pre_update(p_rec in ben_cqb_shd.g_rec_type) is
174 --
175 l_proc varchar2(72) := g_package||'pre_update';
176 --
177 Begin
178 hr_utility.set_location('Entering:'||l_proc, 5);
179 --
180 hr_utility.set_location(' Leaving:'||l_proc, 10);
181 End pre_update;
182 --
183 -- ----------------------------------------------------------------------------
184 -- |-----------------------------< post_update >------------------------------|
185 -- ----------------------------------------------------------------------------
186 -- {Start Of Comments}
187 --
188 -- Description:
189 -- This private procedure contains any processing which is required after the
190 -- update dml.
191 --
192 -- Prerequisites:
193 -- This is an internal procedure which is called from the upd procedure.
194 --
195 -- In Parameters:
196 -- A Pl/Sql record structre.
197 --
198 -- Post Success:
199 -- Processing continues.
200 --
201 -- Post Failure:
202 -- If an error has occurred, an error message and exception will be raised
203 -- but not handled.
204 --
205 -- Developer Implementation Notes:
206 -- Any post-processing required after the update dml is issued should be
207 -- coded within this procedure. It is important to note that any 3rd party
208 -- maintenance should be reviewed before placing in this procedure.
209 --
210 -- Access Status:
211 -- Internal Row Handler Use Only.
212 --
213 -- {End Of Comments}
214 -- ----------------------------------------------------------------------------
215 Procedure post_update(
216 p_effective_date in date,p_rec in ben_cqb_shd.g_rec_type) is
217 --
218 l_proc varchar2(72) := g_package||'post_update';
219 --
220 Begin
221 hr_utility.set_location('Entering:'||l_proc, 5);
222 --
223 --
224 -- Start of API User Hook for post_update.
225 --
226 begin
227 --
228 ben_cqb_rku.after_update
229 (
230 p_cbr_quald_bnf_id =>p_rec.cbr_quald_bnf_id
231 ,p_quald_bnf_flag =>p_rec.quald_bnf_flag
232 ,p_cbr_elig_perd_strt_dt =>p_rec.cbr_elig_perd_strt_dt
233 ,p_cbr_elig_perd_end_dt =>p_rec.cbr_elig_perd_end_dt
234 ,p_quald_bnf_person_id =>p_rec.quald_bnf_person_id
235 ,p_pgm_id =>p_rec.pgm_id
236 ,p_ptip_id =>p_rec.ptip_id
237 ,p_pl_typ_id =>p_rec.pl_typ_id
238 ,p_cvrd_emp_person_id =>p_rec.cvrd_emp_person_id
239 ,p_cbr_inelg_rsn_cd =>p_rec.cbr_inelg_rsn_cd
240 ,p_business_group_id =>p_rec.business_group_id
241 ,p_cqb_attribute_category =>p_rec.cqb_attribute_category
242 ,p_cqb_attribute1 =>p_rec.cqb_attribute1
243 ,p_cqb_attribute2 =>p_rec.cqb_attribute2
244 ,p_cqb_attribute3 =>p_rec.cqb_attribute3
245 ,p_cqb_attribute4 =>p_rec.cqb_attribute4
246 ,p_cqb_attribute5 =>p_rec.cqb_attribute5
247 ,p_cqb_attribute6 =>p_rec.cqb_attribute6
248 ,p_cqb_attribute7 =>p_rec.cqb_attribute7
249 ,p_cqb_attribute8 =>p_rec.cqb_attribute8
250 ,p_cqb_attribute9 =>p_rec.cqb_attribute9
251 ,p_cqb_attribute10 =>p_rec.cqb_attribute10
252 ,p_cqb_attribute11 =>p_rec.cqb_attribute11
253 ,p_cqb_attribute12 =>p_rec.cqb_attribute12
254 ,p_cqb_attribute13 =>p_rec.cqb_attribute13
255 ,p_cqb_attribute14 =>p_rec.cqb_attribute14
256 ,p_cqb_attribute15 =>p_rec.cqb_attribute15
257 ,p_cqb_attribute16 =>p_rec.cqb_attribute16
258 ,p_cqb_attribute17 =>p_rec.cqb_attribute17
259 ,p_cqb_attribute18 =>p_rec.cqb_attribute18
260 ,p_cqb_attribute19 =>p_rec.cqb_attribute19
261 ,p_cqb_attribute20 =>p_rec.cqb_attribute20
262 ,p_cqb_attribute21 =>p_rec.cqb_attribute21
263 ,p_cqb_attribute22 =>p_rec.cqb_attribute22
264 ,p_cqb_attribute23 =>p_rec.cqb_attribute23
265 ,p_cqb_attribute24 =>p_rec.cqb_attribute24
266 ,p_cqb_attribute25 =>p_rec.cqb_attribute25
267 ,p_cqb_attribute26 =>p_rec.cqb_attribute26
268 ,p_cqb_attribute27 =>p_rec.cqb_attribute27
269 ,p_cqb_attribute28 =>p_rec.cqb_attribute28
270 ,p_cqb_attribute29 =>p_rec.cqb_attribute29
271 ,p_cqb_attribute30 =>p_rec.cqb_attribute30
272 ,p_object_version_number =>p_rec.object_version_number
273 ,p_effective_date =>p_effective_date
274 ,p_quald_bnf_flag_o =>ben_cqb_shd.g_old_rec.quald_bnf_flag
275 ,p_cbr_elig_perd_strt_dt_o =>ben_cqb_shd.g_old_rec.cbr_elig_perd_strt_dt
276 ,p_cbr_elig_perd_end_dt_o =>ben_cqb_shd.g_old_rec.cbr_elig_perd_end_dt
277 ,p_quald_bnf_person_id_o =>ben_cqb_shd.g_old_rec.quald_bnf_person_id
278 ,p_pgm_id_o =>ben_cqb_shd.g_old_rec.pgm_id
279 ,p_ptip_id_o =>ben_cqb_shd.g_old_rec.ptip_id
280 ,p_pl_typ_id_o =>ben_cqb_shd.g_old_rec.pl_typ_id
281 ,p_cvrd_emp_person_id_o =>ben_cqb_shd.g_old_rec.cvrd_emp_person_id
282 ,p_cbr_inelg_rsn_cd_o =>ben_cqb_shd.g_old_rec.cbr_inelg_rsn_cd
283 ,p_business_group_id_o =>ben_cqb_shd.g_old_rec.business_group_id
284 ,p_cqb_attribute_category_o =>ben_cqb_shd.g_old_rec.cqb_attribute_category
285 ,p_cqb_attribute1_o =>ben_cqb_shd.g_old_rec.cqb_attribute1
286 ,p_cqb_attribute2_o =>ben_cqb_shd.g_old_rec.cqb_attribute2
287 ,p_cqb_attribute3_o =>ben_cqb_shd.g_old_rec.cqb_attribute3
288 ,p_cqb_attribute4_o =>ben_cqb_shd.g_old_rec.cqb_attribute4
289 ,p_cqb_attribute5_o =>ben_cqb_shd.g_old_rec.cqb_attribute5
290 ,p_cqb_attribute6_o =>ben_cqb_shd.g_old_rec.cqb_attribute6
291 ,p_cqb_attribute7_o =>ben_cqb_shd.g_old_rec.cqb_attribute7
292 ,p_cqb_attribute8_o =>ben_cqb_shd.g_old_rec.cqb_attribute8
293 ,p_cqb_attribute9_o =>ben_cqb_shd.g_old_rec.cqb_attribute9
294 ,p_cqb_attribute10_o =>ben_cqb_shd.g_old_rec.cqb_attribute10
295 ,p_cqb_attribute11_o =>ben_cqb_shd.g_old_rec.cqb_attribute11
296 ,p_cqb_attribute12_o =>ben_cqb_shd.g_old_rec.cqb_attribute12
297 ,p_cqb_attribute13_o =>ben_cqb_shd.g_old_rec.cqb_attribute13
298 ,p_cqb_attribute14_o =>ben_cqb_shd.g_old_rec.cqb_attribute14
299 ,p_cqb_attribute15_o =>ben_cqb_shd.g_old_rec.cqb_attribute15
300 ,p_cqb_attribute16_o =>ben_cqb_shd.g_old_rec.cqb_attribute16
301 ,p_cqb_attribute17_o =>ben_cqb_shd.g_old_rec.cqb_attribute17
302 ,p_cqb_attribute18_o =>ben_cqb_shd.g_old_rec.cqb_attribute18
303 ,p_cqb_attribute19_o =>ben_cqb_shd.g_old_rec.cqb_attribute19
304 ,p_cqb_attribute20_o =>ben_cqb_shd.g_old_rec.cqb_attribute20
305 ,p_cqb_attribute21_o =>ben_cqb_shd.g_old_rec.cqb_attribute21
306 ,p_cqb_attribute22_o =>ben_cqb_shd.g_old_rec.cqb_attribute22
307 ,p_cqb_attribute23_o =>ben_cqb_shd.g_old_rec.cqb_attribute23
308 ,p_cqb_attribute24_o =>ben_cqb_shd.g_old_rec.cqb_attribute24
309 ,p_cqb_attribute25_o =>ben_cqb_shd.g_old_rec.cqb_attribute25
310 ,p_cqb_attribute26_o =>ben_cqb_shd.g_old_rec.cqb_attribute26
311 ,p_cqb_attribute27_o =>ben_cqb_shd.g_old_rec.cqb_attribute27
312 ,p_cqb_attribute28_o =>ben_cqb_shd.g_old_rec.cqb_attribute28
313 ,p_cqb_attribute29_o =>ben_cqb_shd.g_old_rec.cqb_attribute29
314 ,p_cqb_attribute30_o =>ben_cqb_shd.g_old_rec.cqb_attribute30
315 ,p_object_version_number_o =>ben_cqb_shd.g_old_rec.object_version_number
316 );
317 --
318 exception
319 --
320 when hr_api.cannot_find_prog_unit then
321 --
322 hr_api.cannot_find_prog_unit_error
323 (p_module_name => 'ben_cbr_quald_bnf'
324 ,p_hook_type => 'AU');
325 --
326 end;
327 --
328 -- End of API User Hook for post_update.
329 --
330 --
331 hr_utility.set_location(' Leaving:'||l_proc, 10);
332 End post_update;
333 --
334 -- ----------------------------------------------------------------------------
335 -- |-----------------------------< convert_defs >-----------------------------|
336 -- ----------------------------------------------------------------------------
337 -- {Start Of Comments}
338 --
339 -- Description:
340 -- The Convert_Defs procedure has one very important function:
341 -- It must return the record structure for the row with all system defaulted
342 -- values converted into its corresponding parameter value for update. When
343 -- we attempt to update a row through the Upd process , certain
344 -- parameters can be defaulted which enables flexibility in the calling of
345 -- the upd process (e.g. only attributes which need to be updated need to be
346 -- specified). For the upd process to determine which attributes
347 -- have NOT been specified we need to check if the parameter has a reserved
348 -- system default value. Therefore, for all parameters which have a
349 -- corresponding reserved system default mechanism specified we need to
350 -- check if a system default is being used. If a system default is being
351 -- used then we convert the defaulted value into its corresponding attribute
352 -- value held in the g_old_rec data structure.
353 --
354 -- Prerequisites:
355 -- This private function can only be called from the upd process.
356 --
357 -- In Parameters:
358 -- A Pl/Sql record structre.
359 --
360 -- Post Success:
361 -- The record structure will be returned with all system defaulted parameter
362 -- values converted into its current row attribute value.
363 --
364 -- Post Failure:
365 -- No direct error handling is required within this function. Any possible
366 -- errors within this procedure will be a PL/SQL value error due to conversion
367 -- of datatypes or data lengths.
368 --
369 -- Developer Implementation Notes:
370 -- None.
371 --
372 -- Access Status:
373 -- Internal Row Handler Use Only.
374 --
375 -- {End Of Comments}
376 -- ----------------------------------------------------------------------------
377 Procedure convert_defs(p_rec in out nocopy ben_cqb_shd.g_rec_type) is
378 --
379 l_proc varchar2(72) := g_package||'convert_defs';
380 --
381 Begin
382 --
383 hr_utility.set_location('Entering:'||l_proc, 5);
384 --
385 -- We must now examine each argument value in the
386 -- p_rec plsql record structure
387 -- to see if a system default is being used. If a system default
388 -- is being used then we must set to the 'current' argument value.
389 --
390 If (p_rec.quald_bnf_flag = hr_api.g_varchar2) then
391 p_rec.quald_bnf_flag :=
392 ben_cqb_shd.g_old_rec.quald_bnf_flag;
393 End If;
394 If (p_rec.cbr_elig_perd_strt_dt = hr_api.g_date) then
395 p_rec.cbr_elig_perd_strt_dt :=
396 ben_cqb_shd.g_old_rec.cbr_elig_perd_strt_dt;
397 End If;
398 If (p_rec.cbr_elig_perd_end_dt = hr_api.g_date) then
399 p_rec.cbr_elig_perd_end_dt :=
400 ben_cqb_shd.g_old_rec.cbr_elig_perd_end_dt;
401 End If;
402 If (p_rec.quald_bnf_person_id = hr_api.g_number) then
403 p_rec.quald_bnf_person_id :=
404 ben_cqb_shd.g_old_rec.quald_bnf_person_id;
405 End If;
406 If (p_rec.pgm_id = hr_api.g_number) then
407 p_rec.pgm_id :=
408 ben_cqb_shd.g_old_rec.pgm_id;
409 End If;
410 If (p_rec.ptip_id = hr_api.g_number) then
411 p_rec.ptip_id :=
412 ben_cqb_shd.g_old_rec.ptip_id;
413 End If;
414 If (p_rec.pl_typ_id = hr_api.g_number) then
415 p_rec.pl_typ_id :=
416 ben_cqb_shd.g_old_rec.pl_typ_id;
417 End If;
418 If (p_rec.cvrd_emp_person_id = hr_api.g_number) then
419 p_rec.cvrd_emp_person_id :=
420 ben_cqb_shd.g_old_rec.cvrd_emp_person_id;
421 End If;
422 If (p_rec.cbr_inelg_rsn_cd = hr_api.g_varchar2) then
423 p_rec.cbr_inelg_rsn_cd :=
424 ben_cqb_shd.g_old_rec.cbr_inelg_rsn_cd;
425 End If;
426 If (p_rec.business_group_id = hr_api.g_number) then
427 p_rec.business_group_id :=
428 ben_cqb_shd.g_old_rec.business_group_id;
429 End If;
430 If (p_rec.cqb_attribute_category = hr_api.g_varchar2) then
431 p_rec.cqb_attribute_category :=
432 ben_cqb_shd.g_old_rec.cqb_attribute_category;
433 End If;
434 If (p_rec.cqb_attribute1 = hr_api.g_varchar2) then
435 p_rec.cqb_attribute1 :=
436 ben_cqb_shd.g_old_rec.cqb_attribute1;
437 End If;
438 If (p_rec.cqb_attribute2 = hr_api.g_varchar2) then
439 p_rec.cqb_attribute2 :=
440 ben_cqb_shd.g_old_rec.cqb_attribute2;
441 End If;
442 If (p_rec.cqb_attribute3 = hr_api.g_varchar2) then
443 p_rec.cqb_attribute3 :=
444 ben_cqb_shd.g_old_rec.cqb_attribute3;
445 End If;
446 If (p_rec.cqb_attribute4 = hr_api.g_varchar2) then
447 p_rec.cqb_attribute4 :=
448 ben_cqb_shd.g_old_rec.cqb_attribute4;
449 End If;
450 If (p_rec.cqb_attribute5 = hr_api.g_varchar2) then
451 p_rec.cqb_attribute5 :=
452 ben_cqb_shd.g_old_rec.cqb_attribute5;
453 End If;
454 If (p_rec.cqb_attribute6 = hr_api.g_varchar2) then
455 p_rec.cqb_attribute6 :=
456 ben_cqb_shd.g_old_rec.cqb_attribute6;
457 End If;
458 If (p_rec.cqb_attribute7 = hr_api.g_varchar2) then
459 p_rec.cqb_attribute7 :=
460 ben_cqb_shd.g_old_rec.cqb_attribute7;
461 End If;
462 If (p_rec.cqb_attribute8 = hr_api.g_varchar2) then
463 p_rec.cqb_attribute8 :=
464 ben_cqb_shd.g_old_rec.cqb_attribute8;
465 End If;
466 If (p_rec.cqb_attribute9 = hr_api.g_varchar2) then
467 p_rec.cqb_attribute9 :=
468 ben_cqb_shd.g_old_rec.cqb_attribute9;
469 End If;
470 If (p_rec.cqb_attribute10 = hr_api.g_varchar2) then
471 p_rec.cqb_attribute10 :=
472 ben_cqb_shd.g_old_rec.cqb_attribute10;
473 End If;
474 If (p_rec.cqb_attribute11 = hr_api.g_varchar2) then
475 p_rec.cqb_attribute11 :=
476 ben_cqb_shd.g_old_rec.cqb_attribute11;
477 End If;
478 If (p_rec.cqb_attribute12 = hr_api.g_varchar2) then
479 p_rec.cqb_attribute12 :=
480 ben_cqb_shd.g_old_rec.cqb_attribute12;
481 End If;
482 If (p_rec.cqb_attribute13 = hr_api.g_varchar2) then
483 p_rec.cqb_attribute13 :=
484 ben_cqb_shd.g_old_rec.cqb_attribute13;
485 End If;
486 If (p_rec.cqb_attribute14 = hr_api.g_varchar2) then
487 p_rec.cqb_attribute14 :=
488 ben_cqb_shd.g_old_rec.cqb_attribute14;
489 End If;
490 If (p_rec.cqb_attribute15 = hr_api.g_varchar2) then
491 p_rec.cqb_attribute15 :=
492 ben_cqb_shd.g_old_rec.cqb_attribute15;
493 End If;
494 If (p_rec.cqb_attribute16 = hr_api.g_varchar2) then
495 p_rec.cqb_attribute16 :=
496 ben_cqb_shd.g_old_rec.cqb_attribute16;
497 End If;
498 If (p_rec.cqb_attribute17 = hr_api.g_varchar2) then
499 p_rec.cqb_attribute17 :=
500 ben_cqb_shd.g_old_rec.cqb_attribute17;
501 End If;
502 If (p_rec.cqb_attribute18 = hr_api.g_varchar2) then
503 p_rec.cqb_attribute18 :=
504 ben_cqb_shd.g_old_rec.cqb_attribute18;
505 End If;
506 If (p_rec.cqb_attribute19 = hr_api.g_varchar2) then
507 p_rec.cqb_attribute19 :=
508 ben_cqb_shd.g_old_rec.cqb_attribute19;
509 End If;
510 If (p_rec.cqb_attribute20 = hr_api.g_varchar2) then
511 p_rec.cqb_attribute20 :=
512 ben_cqb_shd.g_old_rec.cqb_attribute20;
513 End If;
514 If (p_rec.cqb_attribute21 = hr_api.g_varchar2) then
515 p_rec.cqb_attribute21 :=
516 ben_cqb_shd.g_old_rec.cqb_attribute21;
517 End If;
518 If (p_rec.cqb_attribute22 = hr_api.g_varchar2) then
519 p_rec.cqb_attribute22 :=
520 ben_cqb_shd.g_old_rec.cqb_attribute22;
521 End If;
522 If (p_rec.cqb_attribute23 = hr_api.g_varchar2) then
523 p_rec.cqb_attribute23 :=
524 ben_cqb_shd.g_old_rec.cqb_attribute23;
525 End If;
526 If (p_rec.cqb_attribute24 = hr_api.g_varchar2) then
527 p_rec.cqb_attribute24 :=
528 ben_cqb_shd.g_old_rec.cqb_attribute24;
529 End If;
530 If (p_rec.cqb_attribute25 = hr_api.g_varchar2) then
531 p_rec.cqb_attribute25 :=
532 ben_cqb_shd.g_old_rec.cqb_attribute25;
533 End If;
534 If (p_rec.cqb_attribute26 = hr_api.g_varchar2) then
535 p_rec.cqb_attribute26 :=
536 ben_cqb_shd.g_old_rec.cqb_attribute26;
537 End If;
538 If (p_rec.cqb_attribute27 = hr_api.g_varchar2) then
539 p_rec.cqb_attribute27 :=
540 ben_cqb_shd.g_old_rec.cqb_attribute27;
541 End If;
542 If (p_rec.cqb_attribute28 = hr_api.g_varchar2) then
543 p_rec.cqb_attribute28 :=
544 ben_cqb_shd.g_old_rec.cqb_attribute28;
545 End If;
546 If (p_rec.cqb_attribute29 = hr_api.g_varchar2) then
547 p_rec.cqb_attribute29 :=
548 ben_cqb_shd.g_old_rec.cqb_attribute29;
549 End If;
550 If (p_rec.cqb_attribute30 = hr_api.g_varchar2) then
551 p_rec.cqb_attribute30 :=
552 ben_cqb_shd.g_old_rec.cqb_attribute30;
553 End If;
554
555 --
556 hr_utility.set_location(' Leaving:'||l_proc, 10);
557 --
558 End convert_defs;
559 --
560 -- ----------------------------------------------------------------------------
561 -- |---------------------------------< upd >----------------------------------|
562 -- ----------------------------------------------------------------------------
563 Procedure upd
564 (
565 p_effective_date in date,
566 p_rec in out nocopy ben_cqb_shd.g_rec_type
567 ) is
568 --
569 l_proc varchar2(72) := g_package||'upd';
570 --
571 Begin
572 hr_utility.set_location('Entering:'||l_proc, 5);
573 --
574 -- We must lock the row which we need to update.
575 --
576 ben_cqb_shd.lck
577 (
578 p_rec.cbr_quald_bnf_id,
579 p_rec.object_version_number
580 );
581 --
582 -- 1. During an update system defaults are used to determine if
583 -- arguments have been defaulted or not. We must therefore
584 -- derive the full record structure values to be updated.
585 --
586 -- 2. Call the supporting update validate operations.
587 --
588 convert_defs(p_rec);
589 ben_cqb_bus.update_validate(p_rec
590 ,p_effective_date);
591 --
592 -- Call the supporting pre-update operation
593 --
594 pre_update(p_rec);
595 --
596 -- Update the row.
597 --
598 update_dml(p_rec);
599 --
600 -- Call the supporting post-update operation
601 --
602 post_update(
603 p_effective_date,p_rec);
604 End upd;
605 --
606 -- ----------------------------------------------------------------------------
607 -- |---------------------------------< upd >----------------------------------|
608 -- ----------------------------------------------------------------------------
609 Procedure upd
610 (
611 p_effective_date in date,
612 p_cbr_quald_bnf_id in number,
613 p_quald_bnf_flag in varchar2 default hr_api.g_varchar2,
614 p_cbr_elig_perd_strt_dt in date default hr_api.g_date,
615 p_cbr_elig_perd_end_dt in date default hr_api.g_date,
616 p_quald_bnf_person_id in number default hr_api.g_number,
617 p_pgm_id in number default hr_api.g_number,
618 p_ptip_id in number default hr_api.g_number,
619 p_pl_typ_id in number default hr_api.g_number,
620 p_cvrd_emp_person_id in number default hr_api.g_number,
621 p_cbr_inelg_rsn_cd in varchar2 default hr_api.g_varchar2,
622 p_business_group_id in number default hr_api.g_number,
623 p_cqb_attribute_category in varchar2 default hr_api.g_varchar2,
624 p_cqb_attribute1 in varchar2 default hr_api.g_varchar2,
625 p_cqb_attribute2 in varchar2 default hr_api.g_varchar2,
626 p_cqb_attribute3 in varchar2 default hr_api.g_varchar2,
627 p_cqb_attribute4 in varchar2 default hr_api.g_varchar2,
628 p_cqb_attribute5 in varchar2 default hr_api.g_varchar2,
629 p_cqb_attribute6 in varchar2 default hr_api.g_varchar2,
630 p_cqb_attribute7 in varchar2 default hr_api.g_varchar2,
631 p_cqb_attribute8 in varchar2 default hr_api.g_varchar2,
632 p_cqb_attribute9 in varchar2 default hr_api.g_varchar2,
633 p_cqb_attribute10 in varchar2 default hr_api.g_varchar2,
634 p_cqb_attribute11 in varchar2 default hr_api.g_varchar2,
635 p_cqb_attribute12 in varchar2 default hr_api.g_varchar2,
636 p_cqb_attribute13 in varchar2 default hr_api.g_varchar2,
637 p_cqb_attribute14 in varchar2 default hr_api.g_varchar2,
638 p_cqb_attribute15 in varchar2 default hr_api.g_varchar2,
639 p_cqb_attribute16 in varchar2 default hr_api.g_varchar2,
640 p_cqb_attribute17 in varchar2 default hr_api.g_varchar2,
641 p_cqb_attribute18 in varchar2 default hr_api.g_varchar2,
642 p_cqb_attribute19 in varchar2 default hr_api.g_varchar2,
643 p_cqb_attribute20 in varchar2 default hr_api.g_varchar2,
644 p_cqb_attribute21 in varchar2 default hr_api.g_varchar2,
645 p_cqb_attribute22 in varchar2 default hr_api.g_varchar2,
646 p_cqb_attribute23 in varchar2 default hr_api.g_varchar2,
647 p_cqb_attribute24 in varchar2 default hr_api.g_varchar2,
648 p_cqb_attribute25 in varchar2 default hr_api.g_varchar2,
649 p_cqb_attribute26 in varchar2 default hr_api.g_varchar2,
650 p_cqb_attribute27 in varchar2 default hr_api.g_varchar2,
651 p_cqb_attribute28 in varchar2 default hr_api.g_varchar2,
652 p_cqb_attribute29 in varchar2 default hr_api.g_varchar2,
653 p_cqb_attribute30 in varchar2 default hr_api.g_varchar2,
654 p_object_version_number in out nocopy number
655 ) is
656 --
657 l_rec ben_cqb_shd.g_rec_type;
658 l_proc varchar2(72) := g_package||'upd';
659 --
660 Begin
661 hr_utility.set_location('Entering:'||l_proc, 5);
662 --
663 -- Call conversion function to turn arguments into the
664 -- l_rec structure.
665 --
666 l_rec :=
667 ben_cqb_shd.convert_args
668 (
669 p_cbr_quald_bnf_id,
670 p_quald_bnf_flag,
671 p_cbr_elig_perd_strt_dt,
672 p_cbr_elig_perd_end_dt,
673 p_quald_bnf_person_id,
674 p_pgm_id,
675 p_ptip_id,
676 p_pl_typ_id,
677 p_cvrd_emp_person_id,
678 p_cbr_inelg_rsn_cd,
679 p_business_group_id,
680 p_cqb_attribute_category,
681 p_cqb_attribute1,
682 p_cqb_attribute2,
683 p_cqb_attribute3,
684 p_cqb_attribute4,
685 p_cqb_attribute5,
686 p_cqb_attribute6,
687 p_cqb_attribute7,
688 p_cqb_attribute8,
689 p_cqb_attribute9,
690 p_cqb_attribute10,
691 p_cqb_attribute11,
692 p_cqb_attribute12,
693 p_cqb_attribute13,
694 p_cqb_attribute14,
695 p_cqb_attribute15,
696 p_cqb_attribute16,
697 p_cqb_attribute17,
698 p_cqb_attribute18,
699 p_cqb_attribute19,
700 p_cqb_attribute20,
701 p_cqb_attribute21,
702 p_cqb_attribute22,
703 p_cqb_attribute23,
704 p_cqb_attribute24,
705 p_cqb_attribute25,
706 p_cqb_attribute26,
707 p_cqb_attribute27,
708 p_cqb_attribute28,
709 p_cqb_attribute29,
710 p_cqb_attribute30,
711 p_object_version_number
712 );
713 --
714 -- Having converted the arguments into the
715 -- plsql record structure we call the corresponding record
716 -- business process.
717 --
718 upd(
719 p_effective_date,l_rec);
720 p_object_version_number := l_rec.object_version_number;
721 --
722 hr_utility.set_location(' Leaving:'||l_proc, 10);
723 End upd;
724 --
725 end ben_cqb_upd;