DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_DCE_UPD

Source


1 Package Body ben_dce_upd as
2 /* $Header: bedcerhi.pkb 115.10 2003/10/21 01:32:58 hmani ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ben_dce_upd.';  -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |----------------------------< dt_update_dml >-----------------------------|
12 -- ----------------------------------------------------------------------------
13 -- {Start Of Comments}
14 --
15 -- Description:
16 --   This procedure controls the execution of dml from the datetrack mode
17 --   of CORRECTION only. It is important to note that the object version
18 --   number is only increment by 1 because the datetrack correction is
19 --   soley for one datetracked row.
20 --   This procedure controls the actual dml update logic. The functions of this
21 --   procedure are as follows:
22 --   1) Get the next object_version_number.
23 --   2) To set and unset the g_api_dml status as required (as we are about to
24 --      perform dml).
25 --   3) To update the specified row in the schema using the primary key in
26 --      the predicates.
27 --   4) To trap any constraint violations that may have occurred.
28 --   5) To raise any other errors.
29 --
30 -- Prerequisites:
31 --   This is an internal private procedure which must be called from the
32 --   update_dml procedure.
33 --
34 -- In Parameters:
35 --   A Pl/Sql record structre.
36 --
37 -- Post Success:
38 --   The specified row will be updated in the schema.
39 --
40 -- Post Failure:
41 --   On the update dml failure it is important to note that we always reset the
42 --   g_api_dml status to false.
43 --   If a check or unique integrity constraint violation is raised the
44 --   constraint_error procedure will be called.
45 --   If any other error is reported, the error will be raised after the
46 --   g_api_dml status is reset.
47 --
48 -- Developer Implementation Notes:
49 --   The update 'set' arguments list should be modified if any of your
50 --   attributes are not updateable.
51 --
52 -- Access Status:
53 --   Internal Row Handler Use Only.
54 --
55 -- {End Of Comments}
56 -- ----------------------------------------------------------------------------
57 Procedure dt_update_dml
58 	(p_rec 			 in out nocopy ben_dce_shd.g_rec_type,
59 	 p_effective_date	 in	date,
60 	 p_datetrack_mode	 in	varchar2,
61 	 p_validation_start_date in	date,
62 	 p_validation_end_date	 in	date) is
63 --
64   l_proc	varchar2(72) := g_package||'dt_update_dml';
65 --
66 Begin
67   hr_utility.set_location('Entering:'||l_proc, 5);
68   --
69   If (p_datetrack_mode = 'CORRECTION') then
70     hr_utility.set_location(l_proc, 10);
71     --
72     -- Because we are updating a row we must get the next object
73     -- version number.
74     --
75     p_rec.object_version_number :=
76       dt_api.get_object_version_number
77 	  (p_base_table_name	=> 'ben_dpnt_cvg_eligy_prfl_f',
78 	   p_base_key_column	=> 'dpnt_cvg_eligy_prfl_id',
79 	   p_base_key_value	=> p_rec.dpnt_cvg_eligy_prfl_id);
80     --
81     ben_dce_shd.g_api_dml := true;  -- Set the api dml status
82     --
83     -- Update the ben_dpnt_cvg_eligy_prfl_f Row
84     --
85     update  ben_dpnt_cvg_eligy_prfl_f
86     set
87         dpnt_cvg_eligy_prfl_id          = p_rec.dpnt_cvg_eligy_prfl_id,
88     business_group_id               = p_rec.business_group_id,
89     regn_id                         = p_rec.regn_id,
90     name                            = p_rec.name,
91     dpnt_cvg_eligy_prfl_stat_cd     = p_rec.dpnt_cvg_eligy_prfl_stat_cd,
92     dce_desc                        = p_rec.dce_desc,
93 --    military_status_rqmt_ind        = p_rec.military_status_rqmt_ind,
94     dpnt_cvg_elig_det_rl            = p_rec.dpnt_cvg_elig_det_rl,
95     dce_attribute_category          = p_rec.dce_attribute_category,
96     dce_attribute1                  = p_rec.dce_attribute1,
97     dce_attribute2                  = p_rec.dce_attribute2,
98     dce_attribute3                  = p_rec.dce_attribute3,
99     dce_attribute4                  = p_rec.dce_attribute4,
100     dce_attribute5                  = p_rec.dce_attribute5,
101     dce_attribute6                  = p_rec.dce_attribute6,
102     dce_attribute7                  = p_rec.dce_attribute7,
103     dce_attribute8                  = p_rec.dce_attribute8,
104     dce_attribute9                  = p_rec.dce_attribute9,
105     dce_attribute10                 = p_rec.dce_attribute10,
106     dce_attribute11                 = p_rec.dce_attribute11,
107     dce_attribute12                 = p_rec.dce_attribute12,
108     dce_attribute13                 = p_rec.dce_attribute13,
109     dce_attribute14                 = p_rec.dce_attribute14,
110     dce_attribute15                 = p_rec.dce_attribute15,
111     dce_attribute16                 = p_rec.dce_attribute16,
112     dce_attribute17                 = p_rec.dce_attribute17,
113     dce_attribute18                 = p_rec.dce_attribute18,
114     dce_attribute19                 = p_rec.dce_attribute19,
115     dce_attribute20                 = p_rec.dce_attribute20,
116     dce_attribute21                 = p_rec.dce_attribute21,
117     dce_attribute22                 = p_rec.dce_attribute22,
118     dce_attribute23                 = p_rec.dce_attribute23,
119     dce_attribute24                 = p_rec.dce_attribute24,
120     dce_attribute25                 = p_rec.dce_attribute25,
121     dce_attribute26                 = p_rec.dce_attribute26,
122     dce_attribute27                 = p_rec.dce_attribute27,
123     dce_attribute28                 = p_rec.dce_attribute28,
124     dce_attribute29                 = p_rec.dce_attribute29,
125     dce_attribute30                 = p_rec.dce_attribute30,
126     object_version_number           = p_rec.object_version_number,
127     dpnt_rlshp_flag                 = p_rec.dpnt_rlshp_flag,
128     dpnt_age_flag                   = p_rec.dpnt_age_flag,
129     dpnt_stud_flag                  = p_rec.dpnt_stud_flag,
130     dpnt_dsbld_flag                 = p_rec.dpnt_dsbld_flag,
131     dpnt_mrtl_flag                  = p_rec.dpnt_mrtl_flag,
132     dpnt_mltry_flag                 = p_rec.dpnt_mltry_flag,
133     dpnt_pstl_flag                  = p_rec.dpnt_pstl_flag,
134     dpnt_cvrd_in_anthr_pl_flag      = p_rec.dpnt_cvrd_in_anthr_pl_flag,
135     dpnt_dsgnt_crntly_enrld_flag    = p_rec.dpnt_dsgnt_crntly_enrld_flag
136     where   dpnt_cvg_eligy_prfl_id = p_rec.dpnt_cvg_eligy_prfl_id
137     and     effective_start_date = p_validation_start_date
138     and     effective_end_date   = p_validation_end_date;
139     --
140     ben_dce_shd.g_api_dml := false;   -- Unset the api dml status
141     --
142     -- Set the effective start and end dates
143     --
144     p_rec.effective_start_date := p_validation_start_date;
145     p_rec.effective_end_date   := p_validation_end_date;
146   End If;
147 --
148 hr_utility.set_location(' Leaving:'||l_proc, 15);
149 Exception
150   When hr_api.check_integrity_violated Then
151     -- A check constraint has been violated
152     ben_dce_shd.g_api_dml := false;   -- Unset the api dml status
153     ben_dce_shd.constraint_error
154       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
155   When hr_api.unique_integrity_violated Then
156     -- Unique integrity has been violated
157     ben_dce_shd.g_api_dml := false;   -- Unset the api dml status
158     ben_dce_shd.constraint_error
159       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
160   When Others Then
161     ben_dce_shd.g_api_dml := false;   -- Unset the api dml status
162     Raise;
163 End dt_update_dml;
164 --
165 -- ----------------------------------------------------------------------------
166 -- |------------------------------< update_dml >------------------------------|
167 -- ----------------------------------------------------------------------------
168 -- {Start Of Comments}
169 --
170 -- Description:
171 --   This procedure calls the dt_update_dml control logic which handles
172 --   the actual datetrack dml.
173 --
174 -- Prerequisites:
175 --   This is an internal private procedure which must be called from the upd
176 --   procedure.
177 --
178 -- In Parameters:
179 --   A Pl/Sql record structre.
180 --
181 -- Post Success:
182 --   Processing contines.
183 --
184 -- Post Failure:
185 --   No specific error handling is required within this procedure.
186 --
187 -- Developer Implementation Notes:
188 --   The update 'set' arguments list should be modified if any of your
189 --   attributes are not updateable.
190 --
191 -- Access Status:
192 --   Internal Row Handler Use Only.
193 --
194 -- {End Of Comments}
195 -- ----------------------------------------------------------------------------
196 Procedure update_dml
197 	(p_rec 			 in out nocopy ben_dce_shd.g_rec_type,
198 	 p_effective_date	 in	date,
199 	 p_datetrack_mode	 in	varchar2,
200 	 p_validation_start_date in	date,
201 	 p_validation_end_date	 in	date) is
202 --
203   l_proc	varchar2(72) := g_package||'update_dml';
204 --
205 Begin
206   hr_utility.set_location('Entering:'||l_proc, 5);
207   --
208   dt_update_dml(p_rec			=> p_rec,
209 		p_effective_date	=> p_effective_date,
210 		p_datetrack_mode	=> p_datetrack_mode,
211        		p_validation_start_date	=> p_validation_start_date,
212 		p_validation_end_date	=> p_validation_end_date);
213   --
214   hr_utility.set_location(' Leaving:'||l_proc, 10);
215 End update_dml;
216 --
217 -- ----------------------------------------------------------------------------
218 -- |----------------------------< dt_pre_update >-----------------------------|
219 -- ----------------------------------------------------------------------------
220 -- {Start Of Comments}
221 --
222 -- Description:
223 --   The dt_pre_update procedure controls the execution
224 --   of dml for the datetrack modes of: UPDATE, UPDATE_OVERRIDE
225 --   and UPDATE_CHANGE_INSERT only. The execution required is as
226 --   follows:
227 --
228 --   1) Providing the datetrack update mode is not 'CORRECTION'
229 --      then set the effective end date of the current row (this
230 --      will be the validation_start_date - 1).
231 --   2) If the datetrack mode is 'UPDATE_OVERRIDE' then call the
232 --      corresponding delete_dml process to delete any future rows
233 --      where the effective_start_date is greater than or equal to
234 --	the validation_start_date.
235 --   3) Call the insert_dml process to insert the new updated row
236 --      details..
237 --
238 -- Prerequisites:
239 --   This is an internal procedure which is called from the
240 --   pre_update procedure.
241 --
242 -- In Parameters:
243 --
244 -- Post Success:
245 --   Processing continues.
246 --
247 -- Post Failure:
248 --   If an error has occurred, an error message and exception will be raised
249 --   but not handled.
250 --
251 -- Developer Implementation Notes:
252 --   This is an internal procedure which is required by Datetrack. Don't
253 --   remove or modify.
254 --
255 -- Access Status:
256 --   Internal Row Handler Use Only.
257 --
258 -- {End Of Comments}
259 -- ----------------------------------------------------------------------------
260 Procedure dt_pre_update
261 	(p_rec 			 in out nocopy ben_dce_shd.g_rec_type,
262 	 p_effective_date	 in	date,
263 	 p_datetrack_mode	 in	varchar2,
264 	 p_validation_start_date in	date,
265 	 p_validation_end_date	 in	date) is
266 --
267   l_proc	         varchar2(72) := g_package||'dt_pre_update';
268   l_dummy_version_number number;
269 --
270 Begin
271   hr_utility.set_location('Entering:'||l_proc, 5);
272   If (p_datetrack_mode <> 'CORRECTION') then
273     hr_utility.set_location(l_proc, 10);
274     --
275     -- Update the current effective end date
276     --
277     ben_dce_shd.upd_effective_end_date
278      (p_effective_date	       => p_effective_date,
279       p_base_key_value	       => p_rec.dpnt_cvg_eligy_prfl_id,
280       p_new_effective_end_date => (p_validation_start_date - 1),
281       p_validation_start_date  => p_validation_start_date,
282       p_validation_end_date    => p_validation_end_date,
283       p_object_version_number  => l_dummy_version_number);
284     --
285     If (p_datetrack_mode = 'UPDATE_OVERRIDE') then
286       hr_utility.set_location(l_proc, 15);
287       --
288       -- As the datetrack mode is 'UPDATE_OVERRIDE' then we must
289       -- delete any future rows
290       --
291       ben_dce_del.delete_dml
292         (p_rec			 => p_rec,
293 	 p_effective_date	 => p_effective_date,
294 	 p_datetrack_mode	 => p_datetrack_mode,
295 	 p_validation_start_date => p_validation_start_date,
296 	 p_validation_end_date   => p_validation_end_date);
297     End If;
298     hr_utility.set_location(l_proc, 20);
299     --
300     -- We must now insert the updated row
301     --
302     ben_dce_ins.insert_dml
303       (p_rec			=> p_rec,
304        p_effective_date		=> p_effective_date,
305        p_datetrack_mode		=> p_datetrack_mode,
306        p_validation_start_date	=> p_validation_start_date,
307        p_validation_end_date	=> p_validation_end_date);
308   End If;
309   hr_utility.set_location(' Leaving:'||l_proc, 20);
310 End dt_pre_update;
311 --
312 -- ----------------------------------------------------------------------------
313 -- |------------------------------< pre_update >------------------------------|
314 -- ----------------------------------------------------------------------------
315 -- {Start Of Comments}
316 --
317 -- Description:
318 --   This private procedure contains any processing which is required before
319 --   the update dml.
320 --
321 -- Prerequisites:
322 --   This is an internal procedure which is called from the upd procedure.
323 --
324 -- In Parameters:
325 --   A Pl/Sql record structre.
326 --
327 -- Post Success:
328 --   Processing continues.
329 --
330 -- Post Failure:
331 --   If an error has occurred, an error message and exception will be raised
332 --   but not handled.
333 --
334 -- Developer Implementation Notes:
335 --   Any pre-processing required before the update dml is issued should be
336 --   coded within this procedure. It is important to note that any 3rd party
337 --   maintenance should be reviewed before placing in this procedure. The call
338 --   to the dt_update_dml procedure should NOT be removed.
339 --
340 -- Access Status:
341 --   Internal Row Handler Use Only.
342 --
343 -- {End Of Comments}
344 -- ----------------------------------------------------------------------------
345 Procedure pre_update
346 	(p_rec 			 in out nocopy ben_dce_shd.g_rec_type,
347 	 p_effective_date	 in	date,
348 	 p_datetrack_mode	 in	varchar2,
349 	 p_validation_start_date in	date,
350 	 p_validation_end_date	 in	date) is
351 --
352   l_proc	varchar2(72) := g_package||'pre_update';
353 --
354 Begin
355   hr_utility.set_location('Entering:'||l_proc, 5);
356   --
357   --
358   --
359   dt_pre_update
360     (p_rec 		     => p_rec,
361      p_effective_date	     => p_effective_date,
362      p_datetrack_mode	     => p_datetrack_mode,
363      p_validation_start_date => p_validation_start_date,
364      p_validation_end_date   => p_validation_end_date);
365   --
366   hr_utility.set_location(' Leaving:'||l_proc, 10);
367 End pre_update;
368 --
369 -- ----------------------------------------------------------------------------
370 -- |-----------------------------< post_update >------------------------------|
371 -- ----------------------------------------------------------------------------
372 -- {Start Of Comments}
373 --
374 -- Description:
375 --   This private procedure contains any processing which is required after the
376 --   update dml.
377 --
378 -- Prerequisites:
379 --   This is an internal procedure which is called from the upd procedure.
380 --
381 -- In Parameters:
382 --   A Pl/Sql record structre.
383 --
384 -- Post Success:
385 --   Processing continues.
386 --
387 -- Post Failure:
388 --   If an error has occurred, an error message and exception will be raised
389 --   but not handled.
390 --
391 -- Developer Implementation Notes:
392 --   Any post-processing required after the update dml is issued should be
393 --   coded within this procedure. It is important to note that any 3rd party
394 --   maintenance should be reviewed before placing in this procedure.
395 --
396 -- Access Status:
397 --   Internal Row Handler Use Only.
398 --
399 -- {End Of Comments}
400 -- ----------------------------------------------------------------------------
401 Procedure post_update
402 	(p_rec 			 in ben_dce_shd.g_rec_type,
403 	 p_effective_date	 in date,
404 	 p_datetrack_mode	 in varchar2,
405 	 p_validation_start_date in date,
406 	 p_validation_end_date	 in date) is
407 --
408   l_proc	varchar2(72) := g_package||'post_update';
409 --
410 Begin
411   hr_utility.set_location('Entering:'||l_proc, 5);
412 --
413   --
414   -- Start of API User Hook for post_update.
415   --
416   begin
417     --
418     ben_dce_rku.after_update
419       (
420   p_dpnt_cvg_eligy_prfl_id        =>p_rec.dpnt_cvg_eligy_prfl_id
421  ,p_effective_end_date            =>p_rec.effective_end_date
422  ,p_effective_start_date          =>p_rec.effective_start_date
423  ,p_business_group_id             =>p_rec.business_group_id
424  ,p_regn_id                       =>p_rec.regn_id
425  ,p_name                          =>p_rec.name
426  ,p_dpnt_cvg_eligy_prfl_stat_cd   =>p_rec.dpnt_cvg_eligy_prfl_stat_cd
427  ,p_dce_desc                      =>p_rec.dce_desc
428 -- ,p_military_status_rqmt_ind      =>p_rec.military_status_rqmt_ind
429  ,p_dpnt_cvg_elig_det_rl          =>p_rec.dpnt_cvg_elig_det_rl
430  ,p_dce_attribute_category        =>p_rec.dce_attribute_category
431  ,p_dce_attribute1                =>p_rec.dce_attribute1
432  ,p_dce_attribute2                =>p_rec.dce_attribute2
433  ,p_dce_attribute3                =>p_rec.dce_attribute3
434  ,p_dce_attribute4                =>p_rec.dce_attribute4
435  ,p_dce_attribute5                =>p_rec.dce_attribute5
436  ,p_dce_attribute6                =>p_rec.dce_attribute6
437  ,p_dce_attribute7                =>p_rec.dce_attribute7
438  ,p_dce_attribute8                =>p_rec.dce_attribute8
439  ,p_dce_attribute9                =>p_rec.dce_attribute9
440  ,p_dce_attribute10               =>p_rec.dce_attribute10
441  ,p_dce_attribute11               =>p_rec.dce_attribute11
442  ,p_dce_attribute12               =>p_rec.dce_attribute12
443  ,p_dce_attribute13               =>p_rec.dce_attribute13
444  ,p_dce_attribute14               =>p_rec.dce_attribute14
445  ,p_dce_attribute15               =>p_rec.dce_attribute15
446  ,p_dce_attribute16               =>p_rec.dce_attribute16
447  ,p_dce_attribute17               =>p_rec.dce_attribute17
448  ,p_dce_attribute18               =>p_rec.dce_attribute18
449  ,p_dce_attribute19               =>p_rec.dce_attribute19
450  ,p_dce_attribute20               =>p_rec.dce_attribute20
451  ,p_dce_attribute21               =>p_rec.dce_attribute21
452  ,p_dce_attribute22               =>p_rec.dce_attribute22
453  ,p_dce_attribute23               =>p_rec.dce_attribute23
454  ,p_dce_attribute24               =>p_rec.dce_attribute24
455  ,p_dce_attribute25               =>p_rec.dce_attribute25
456  ,p_dce_attribute26               =>p_rec.dce_attribute26
457  ,p_dce_attribute27               =>p_rec.dce_attribute27
458  ,p_dce_attribute28               =>p_rec.dce_attribute28
459  ,p_dce_attribute29               =>p_rec.dce_attribute29
460  ,p_dce_attribute30               =>p_rec.dce_attribute30
461  ,p_object_version_number         =>p_rec.object_version_number
462  ,p_effective_date                =>p_effective_date
463  ,p_datetrack_mode                =>p_datetrack_mode
464  ,p_validation_start_date         =>p_validation_start_date
465  ,p_validation_end_date           =>p_validation_end_date
466  ,p_dpnt_rlshp_flag               =>p_rec.dpnt_rlshp_flag
467  ,p_dpnt_age_flag                 =>p_rec.dpnt_age_flag
468  ,p_dpnt_stud_flag                =>p_rec.dpnt_stud_flag
469  ,p_dpnt_dsbld_flag               =>p_rec.dpnt_dsbld_flag
470  ,p_dpnt_mrtl_flag                =>p_rec.dpnt_mrtl_flag
471  ,p_dpnt_mltry_flag               =>p_rec.dpnt_mltry_flag
472  ,p_dpnt_pstl_flag                =>p_rec.dpnt_pstl_flag
473  ,p_dpnt_cvrd_in_anthr_pl_flag    =>p_rec.dpnt_cvrd_in_anthr_pl_flag
474  ,p_dpnt_dsgnt_crntly_enrld_flag  =>p_rec.dpnt_dsgnt_crntly_enrld_flag
475  ,p_effective_end_date_o          =>ben_dce_shd.g_old_rec.effective_end_date
476  ,p_effective_start_date_o        =>ben_dce_shd.g_old_rec.effective_start_date
477  ,p_business_group_id_o           =>ben_dce_shd.g_old_rec.business_group_id
478  ,p_regn_id_o                     =>ben_dce_shd.g_old_rec.regn_id
479  ,p_name_o                        =>ben_dce_shd.g_old_rec.name
480  ,p_dpnt_cvg_eligy_prfl_stat_c_o =>ben_dce_shd.g_old_rec.dpnt_cvg_eligy_prfl_stat_cd
481  ,p_dce_desc_o                    =>ben_dce_shd.g_old_rec.dce_desc
482 -- ,p_military_status_rqmt_ind_o    =>ben_dce_shd.g_old_rec.military_status_rqmt_ind
483  ,p_dpnt_cvg_elig_det_rl_o        =>ben_dce_shd.g_old_rec.dpnt_cvg_elig_det_rl
484  ,p_dce_attribute_category_o      =>ben_dce_shd.g_old_rec.dce_attribute_category
485  ,p_dce_attribute1_o              =>ben_dce_shd.g_old_rec.dce_attribute1
486  ,p_dce_attribute2_o              =>ben_dce_shd.g_old_rec.dce_attribute2
487  ,p_dce_attribute3_o              =>ben_dce_shd.g_old_rec.dce_attribute3
488  ,p_dce_attribute4_o              =>ben_dce_shd.g_old_rec.dce_attribute4
489  ,p_dce_attribute5_o              =>ben_dce_shd.g_old_rec.dce_attribute5
490  ,p_dce_attribute6_o              =>ben_dce_shd.g_old_rec.dce_attribute6
491  ,p_dce_attribute7_o              =>ben_dce_shd.g_old_rec.dce_attribute7
492  ,p_dce_attribute8_o              =>ben_dce_shd.g_old_rec.dce_attribute8
493  ,p_dce_attribute9_o              =>ben_dce_shd.g_old_rec.dce_attribute9
494  ,p_dce_attribute10_o             =>ben_dce_shd.g_old_rec.dce_attribute10
495  ,p_dce_attribute11_o             =>ben_dce_shd.g_old_rec.dce_attribute11
496  ,p_dce_attribute12_o             =>ben_dce_shd.g_old_rec.dce_attribute12
497  ,p_dce_attribute13_o             =>ben_dce_shd.g_old_rec.dce_attribute13
498  ,p_dce_attribute14_o             =>ben_dce_shd.g_old_rec.dce_attribute14
499  ,p_dce_attribute15_o             =>ben_dce_shd.g_old_rec.dce_attribute15
500  ,p_dce_attribute16_o             =>ben_dce_shd.g_old_rec.dce_attribute16
501  ,p_dce_attribute17_o             =>ben_dce_shd.g_old_rec.dce_attribute17
502  ,p_dce_attribute18_o             =>ben_dce_shd.g_old_rec.dce_attribute18
503  ,p_dce_attribute19_o             =>ben_dce_shd.g_old_rec.dce_attribute19
504  ,p_dce_attribute20_o             =>ben_dce_shd.g_old_rec.dce_attribute20
505  ,p_dce_attribute21_o             =>ben_dce_shd.g_old_rec.dce_attribute21
506  ,p_dce_attribute22_o             =>ben_dce_shd.g_old_rec.dce_attribute22
507  ,p_dce_attribute23_o             =>ben_dce_shd.g_old_rec.dce_attribute23
508  ,p_dce_attribute24_o             =>ben_dce_shd.g_old_rec.dce_attribute24
509  ,p_dce_attribute25_o             =>ben_dce_shd.g_old_rec.dce_attribute25
510  ,p_dce_attribute26_o             =>ben_dce_shd.g_old_rec.dce_attribute26
511  ,p_dce_attribute27_o             =>ben_dce_shd.g_old_rec.dce_attribute27
512  ,p_dce_attribute28_o             =>ben_dce_shd.g_old_rec.dce_attribute28
513  ,p_dce_attribute29_o             =>ben_dce_shd.g_old_rec.dce_attribute29
514  ,p_dce_attribute30_o             =>ben_dce_shd.g_old_rec.dce_attribute30
515  ,p_object_version_number_o       =>ben_dce_shd.g_old_rec.object_version_number
516  ,p_dpnt_rlshp_flag_o             =>ben_dce_shd.g_old_rec.dpnt_rlshp_flag
517  ,p_dpnt_age_flag_o               =>ben_dce_shd.g_old_rec.dpnt_age_flag
518  ,p_dpnt_stud_flag_o              =>ben_dce_shd.g_old_rec.dpnt_stud_flag
519  ,p_dpnt_dsbld_flag_o             =>ben_dce_shd.g_old_rec.dpnt_dsbld_flag
520  ,p_dpnt_mrtl_flag_o              =>ben_dce_shd.g_old_rec.dpnt_mrtl_flag
521  ,p_dpnt_mltry_flag_o             =>ben_dce_shd.g_old_rec.dpnt_mltry_flag
522  ,p_dpnt_pstl_flag_o              =>ben_dce_shd.g_old_rec.dpnt_pstl_flag
523  ,p_dpnt_cvrd_in_anthr_pl_flag_o  =>ben_dce_shd.g_old_rec.dpnt_cvrd_in_anthr_pl_flag
524  ,p_dpnt_dsgnt_crntly_enrld_fl_o  =>ben_dce_shd.g_old_rec.dpnt_dsgnt_crntly_enrld_flag
525       );
526     --
527   exception
528     --
529     when hr_api.cannot_find_prog_unit then
530       --
531       hr_api.cannot_find_prog_unit_error
532         (p_module_name => 'ben_dpnt_cvg_eligy_prfl_f'
533         ,p_hook_type   => 'AU');
534       --
535   end;
536   --
537   -- End of API User Hook for post_update.
538   --
539   --
540   hr_utility.set_location(' Leaving:'||l_proc, 10);
541 End post_update;
542 --
543 -- ----------------------------------------------------------------------------
544 -- |-----------------------------< convert_defs >-----------------------------|
545 -- ----------------------------------------------------------------------------
546 -- {Start Of Comments}
547 --
548 -- Description:
549 --   The Convert_Defs procedure has one very important function:
550 --   It must return the record structure for the row with all system defaulted
551 --   values converted into its corresponding parameter value for update. When
552 --   we attempt to update a row through the Upd process , certain
553 --   parameters can be defaulted which enables flexibility in the calling of
554 --   the upd process (e.g. only attributes which need to be updated need to be
555 --   specified). For the upd process to determine which attributes
556 --   have NOT been specified we need to check if the parameter has a reserved
557 --   system default value. Therefore, for all parameters which have a
558 --   corresponding reserved system default mechanism specified we need to
559 --   check if a system default is being used. If a system default is being
560 --   used then we convert the defaulted value into its corresponding attribute
561 --   value held in the g_old_rec data structure.
562 --
563 -- Prerequisites:
564 --   This private function can only be called from the upd process.
565 --
566 -- In Parameters:
567 --   A Pl/Sql record structre.
568 --
569 -- Post Success:
570 --   The record structure will be returned with all system defaulted parameter
571 --   values converted into its current row attribute value.
572 --
573 -- Post Failure:
574 --   No direct error handling is required within this function. Any possible
575 --   errors within this procedure will be a PL/SQL value error due to conversion
576 --   of datatypes or data lengths.
577 --
578 -- Developer Implementation Notes:
579 --   None.
580 --
581 -- Access Status:
582 --   Internal Row Handler Use Only.
583 --
584 -- {End Of Comments}
585 -- ----------------------------------------------------------------------------
586 Procedure convert_defs(p_rec in out nocopy ben_dce_shd.g_rec_type) is
587 --
588   l_proc  varchar2(72) := g_package||'convert_defs';
589 --
590 Begin
591   --
592   hr_utility.set_location('Entering:'||l_proc, 5);
593   --
594   -- We must now examine each argument value in the
595   -- p_rec plsql record structure
596   -- to see if a system default is being used. If a system default
597   -- is being used then we must set to the 'current' argument value.
598   --
599   If (p_rec.business_group_id = hr_api.g_number) then
600     p_rec.business_group_id :=
601     ben_dce_shd.g_old_rec.business_group_id;
602   End If;
603   If (p_rec.regn_id = hr_api.g_number) then
604     p_rec.regn_id :=
605     ben_dce_shd.g_old_rec.regn_id;
606   End If;
607   If (p_rec.name = hr_api.g_varchar2) then
608     p_rec.name :=
609     ben_dce_shd.g_old_rec.name;
610   End If;
611   If (p_rec.dpnt_cvg_eligy_prfl_stat_cd = hr_api.g_varchar2) then
612     p_rec.dpnt_cvg_eligy_prfl_stat_cd :=
613     ben_dce_shd.g_old_rec.dpnt_cvg_eligy_prfl_stat_cd;
614   End If;
615   If (p_rec.dce_desc = hr_api.g_varchar2) then
616     p_rec.dce_desc :=
617     ben_dce_shd.g_old_rec.dce_desc;
618   End If;
619 --  If (p_rec.military_status_rqmt_ind = hr_api.g_varchar2) then
620 --    p_rec.military_status_rqmt_ind :=
621 --    ben_dce_shd.g_old_rec.military_status_rqmt_ind;
622 --  End If;
623   If (p_rec.dpnt_cvg_elig_det_rl = hr_api.g_number) then
624     p_rec.dpnt_cvg_elig_det_rl :=
625     ben_dce_shd.g_old_rec.dpnt_cvg_elig_det_rl;
626   End If;
627   If (p_rec.dce_attribute_category = hr_api.g_varchar2) then
628     p_rec.dce_attribute_category :=
629     ben_dce_shd.g_old_rec.dce_attribute_category;
630   End If;
631   If (p_rec.dce_attribute1 = hr_api.g_varchar2) then
632     p_rec.dce_attribute1 :=
633     ben_dce_shd.g_old_rec.dce_attribute1;
634   End If;
635   If (p_rec.dce_attribute2 = hr_api.g_varchar2) then
636     p_rec.dce_attribute2 :=
637     ben_dce_shd.g_old_rec.dce_attribute2;
638   End If;
639   If (p_rec.dce_attribute3 = hr_api.g_varchar2) then
640     p_rec.dce_attribute3 :=
641     ben_dce_shd.g_old_rec.dce_attribute3;
642   End If;
643   If (p_rec.dce_attribute4 = hr_api.g_varchar2) then
644     p_rec.dce_attribute4 :=
645     ben_dce_shd.g_old_rec.dce_attribute4;
646   End If;
647   If (p_rec.dce_attribute5 = hr_api.g_varchar2) then
648     p_rec.dce_attribute5 :=
649     ben_dce_shd.g_old_rec.dce_attribute5;
650   End If;
651   If (p_rec.dce_attribute6 = hr_api.g_varchar2) then
652     p_rec.dce_attribute6 :=
653     ben_dce_shd.g_old_rec.dce_attribute6;
654   End If;
655   If (p_rec.dce_attribute7 = hr_api.g_varchar2) then
656     p_rec.dce_attribute7 :=
657     ben_dce_shd.g_old_rec.dce_attribute7;
658   End If;
659   If (p_rec.dce_attribute8 = hr_api.g_varchar2) then
660     p_rec.dce_attribute8 :=
661     ben_dce_shd.g_old_rec.dce_attribute8;
662   End If;
663   If (p_rec.dce_attribute9 = hr_api.g_varchar2) then
664     p_rec.dce_attribute9 :=
665     ben_dce_shd.g_old_rec.dce_attribute9;
666   End If;
667   If (p_rec.dce_attribute10 = hr_api.g_varchar2) then
668     p_rec.dce_attribute10 :=
669     ben_dce_shd.g_old_rec.dce_attribute10;
670   End If;
671   If (p_rec.dce_attribute11 = hr_api.g_varchar2) then
672     p_rec.dce_attribute11 :=
673     ben_dce_shd.g_old_rec.dce_attribute11;
674   End If;
675   If (p_rec.dce_attribute12 = hr_api.g_varchar2) then
676     p_rec.dce_attribute12 :=
677     ben_dce_shd.g_old_rec.dce_attribute12;
678   End If;
679   If (p_rec.dce_attribute13 = hr_api.g_varchar2) then
680     p_rec.dce_attribute13 :=
681     ben_dce_shd.g_old_rec.dce_attribute13;
682   End If;
683   If (p_rec.dce_attribute14 = hr_api.g_varchar2) then
684     p_rec.dce_attribute14 :=
685     ben_dce_shd.g_old_rec.dce_attribute14;
686   End If;
687   If (p_rec.dce_attribute15 = hr_api.g_varchar2) then
688     p_rec.dce_attribute15 :=
689     ben_dce_shd.g_old_rec.dce_attribute15;
690   End If;
691   If (p_rec.dce_attribute16 = hr_api.g_varchar2) then
692     p_rec.dce_attribute16 :=
693     ben_dce_shd.g_old_rec.dce_attribute16;
694   End If;
695   If (p_rec.dce_attribute17 = hr_api.g_varchar2) then
696     p_rec.dce_attribute17 :=
697     ben_dce_shd.g_old_rec.dce_attribute17;
698   End If;
699   If (p_rec.dce_attribute18 = hr_api.g_varchar2) then
700     p_rec.dce_attribute18 :=
701     ben_dce_shd.g_old_rec.dce_attribute18;
702   End If;
703   If (p_rec.dce_attribute19 = hr_api.g_varchar2) then
704     p_rec.dce_attribute19 :=
705     ben_dce_shd.g_old_rec.dce_attribute19;
706   End If;
707   If (p_rec.dce_attribute20 = hr_api.g_varchar2) then
708     p_rec.dce_attribute20 :=
709     ben_dce_shd.g_old_rec.dce_attribute20;
710   End If;
711   If (p_rec.dce_attribute21 = hr_api.g_varchar2) then
712     p_rec.dce_attribute21 :=
713     ben_dce_shd.g_old_rec.dce_attribute21;
714   End If;
715   If (p_rec.dce_attribute22 = hr_api.g_varchar2) then
716     p_rec.dce_attribute22 :=
717     ben_dce_shd.g_old_rec.dce_attribute22;
718   End If;
719   If (p_rec.dce_attribute23 = hr_api.g_varchar2) then
720     p_rec.dce_attribute23 :=
721     ben_dce_shd.g_old_rec.dce_attribute23;
722   End If;
723   If (p_rec.dce_attribute24 = hr_api.g_varchar2) then
724     p_rec.dce_attribute24 :=
725     ben_dce_shd.g_old_rec.dce_attribute24;
726   End If;
727   If (p_rec.dce_attribute25 = hr_api.g_varchar2) then
728     p_rec.dce_attribute25 :=
729     ben_dce_shd.g_old_rec.dce_attribute25;
730   End If;
731   If (p_rec.dce_attribute26 = hr_api.g_varchar2) then
732     p_rec.dce_attribute26 :=
733     ben_dce_shd.g_old_rec.dce_attribute26;
734   End If;
735   If (p_rec.dce_attribute27 = hr_api.g_varchar2) then
736     p_rec.dce_attribute27 :=
737     ben_dce_shd.g_old_rec.dce_attribute27;
738   End If;
739   If (p_rec.dce_attribute28 = hr_api.g_varchar2) then
740     p_rec.dce_attribute28 :=
741     ben_dce_shd.g_old_rec.dce_attribute28;
742   End If;
743   If (p_rec.dce_attribute29 = hr_api.g_varchar2) then
744     p_rec.dce_attribute29 :=
745     ben_dce_shd.g_old_rec.dce_attribute29;
746   End If;
747   If (p_rec.dce_attribute30 = hr_api.g_varchar2) then
748     p_rec.dce_attribute30 :=
749     ben_dce_shd.g_old_rec.dce_attribute30;
750   End If;
751   If (p_rec.dpnt_rlshp_flag = hr_api.g_varchar2) then
752     p_rec.dpnt_rlshp_flag :=
753     ben_dce_shd.g_old_rec.dpnt_rlshp_flag;
754   End If;
755   If (p_rec.dpnt_age_flag  = hr_api.g_varchar2) then
756     p_rec.dpnt_age_flag :=
757     ben_dce_shd.g_old_rec.dpnt_age_flag;
758   End If;
759   If (p_rec.dpnt_stud_flag = hr_api.g_varchar2) then
760     p_rec.dpnt_stud_flag :=
761     ben_dce_shd.g_old_rec.dpnt_stud_flag;
762   End If;
763   If (p_rec.dpnt_dsbld_flag = hr_api.g_varchar2) then
764     p_rec.dpnt_dsbld_flag :=
765     ben_dce_shd.g_old_rec.dpnt_dsbld_flag;
766   End If;
767   If (p_rec.dpnt_mrtl_flag = hr_api.g_varchar2) then
768     p_rec.dpnt_mrtl_flag :=
769     ben_dce_shd.g_old_rec.dpnt_mrtl_flag;
770   End If;
771   If (p_rec.dpnt_mltry_flag = hr_api.g_varchar2) then
772     p_rec.dpnt_mltry_flag :=
773     ben_dce_shd.g_old_rec.dpnt_mltry_flag;
774   End If;
775   If (p_rec.dpnt_pstl_flag = hr_api.g_varchar2) then
776     p_rec.dpnt_pstl_flag :=
777     ben_dce_shd.g_old_rec.dpnt_pstl_flag;
778   End If;
779   If (p_rec.dpnt_cvrd_in_anthr_pl_flag = hr_api.g_varchar2) then
780     p_rec.dpnt_cvrd_in_anthr_pl_flag :=
781     ben_dce_shd.g_old_rec.dpnt_cvrd_in_anthr_pl_flag;
782   End If;
783   If (p_rec.dpnt_dsgnt_crntly_enrld_flag = hr_api.g_varchar2) then
784     p_rec.dpnt_dsgnt_crntly_enrld_flag :=
785     ben_dce_shd.g_old_rec.dpnt_dsgnt_crntly_enrld_flag;
786   End If;
787   --
788   hr_utility.set_location(' Leaving:'||l_proc, 10);
789 --
790 End convert_defs;
791 --
792 -- ----------------------------------------------------------------------------
793 -- |---------------------------------< upd >----------------------------------|
794 -- ----------------------------------------------------------------------------
795 Procedure upd
796   (
797   p_rec			in out nocopy 	ben_dce_shd.g_rec_type,
798   p_effective_date	in 	date,
799   p_datetrack_mode	in 	varchar2
800   ) is
801 --
802   l_proc			varchar2(72) := g_package||'upd';
803   l_validation_start_date	date;
804   l_validation_end_date		date;
805 --
806 Begin
807   hr_utility.set_location('Entering:'||l_proc, 5);
808   --
809   -- Ensure that the DateTrack update mode is valid
810   --
811   dt_api.validate_dt_upd_mode(p_datetrack_mode => p_datetrack_mode);
812   --
813   -- We must lock the row which we need to update.
814   --
815   ben_dce_shd.lck
816 	(p_effective_date	 => p_effective_date,
817       	 p_datetrack_mode	 => p_datetrack_mode,
818       	 p_dpnt_cvg_eligy_prfl_id	 => p_rec.dpnt_cvg_eligy_prfl_id,
819       	 p_object_version_number => p_rec.object_version_number,
820       	 p_validation_start_date => l_validation_start_date,
821       	 p_validation_end_date	 => l_validation_end_date);
822   --
823   -- 1. During an update system defaults are used to determine if
824   --    arguments have been defaulted or not. We must therefore
825   --    derive the full record structure values to be updated.
826   --
827   -- 2. Call the supporting update validate operations.
828   --
829   convert_defs(p_rec);
830   ben_dce_bus.update_validate
831 	(p_rec			 => p_rec,
832 	 p_effective_date	 => p_effective_date,
833 	 p_datetrack_mode  	 => p_datetrack_mode,
834 	 p_validation_start_date => l_validation_start_date,
835 	 p_validation_end_date	 => l_validation_end_date);
836   --
837   -- Call the supporting pre-update operation
838   --
839   pre_update
840 	(p_rec			 => p_rec,
841 	 p_effective_date	 => p_effective_date,
842 	 p_datetrack_mode	 => p_datetrack_mode,
843 	 p_validation_start_date => l_validation_start_date,
844 	 p_validation_end_date	 => l_validation_end_date);
845   --
846   -- Update the row.
847   --
848   update_dml
849 	(p_rec			 => p_rec,
850 	 p_effective_date	 => p_effective_date,
851 	 p_datetrack_mode	 => p_datetrack_mode,
852 	 p_validation_start_date => l_validation_start_date,
853 	 p_validation_end_date	 => l_validation_end_date);
854   --
855   -- Call the supporting post-update operation
856   --
857   post_update
858 	(p_rec			 => p_rec,
859 	 p_effective_date	 => p_effective_date,
860 	 p_datetrack_mode	 => p_datetrack_mode,
861 	 p_validation_start_date => l_validation_start_date,
862 	 p_validation_end_date	 => l_validation_end_date);
863 End upd;
864 --
865 -- ----------------------------------------------------------------------------
866 -- |---------------------------------< upd >----------------------------------|
867 -- ----------------------------------------------------------------------------
868 Procedure upd
869   (
870   p_dpnt_cvg_eligy_prfl_id       in number,
871   p_effective_end_date           out nocopy date,
872   p_effective_start_date         out nocopy date,
873   p_business_group_id            in number           default hr_api.g_number,
874   p_regn_id                      in number           default hr_api.g_number,
875   p_name                         in varchar2         default hr_api.g_varchar2,
876   p_dpnt_cvg_eligy_prfl_stat_cd  in varchar2         default hr_api.g_varchar2,
877   p_dce_desc                     in varchar2         default hr_api.g_varchar2,
878 --  p_military_status_rqmt_ind     in varchar2         default hr_api.g_varchar2,
879   p_dpnt_cvg_elig_det_rl         in number           default hr_api.g_number,
880   p_dce_attribute_category       in varchar2         default hr_api.g_varchar2,
881   p_dce_attribute1               in varchar2         default hr_api.g_varchar2,
882   p_dce_attribute2               in varchar2         default hr_api.g_varchar2,
883   p_dce_attribute3               in varchar2         default hr_api.g_varchar2,
884   p_dce_attribute4               in varchar2         default hr_api.g_varchar2,
885   p_dce_attribute5               in varchar2         default hr_api.g_varchar2,
886   p_dce_attribute6               in varchar2         default hr_api.g_varchar2,
887   p_dce_attribute7               in varchar2         default hr_api.g_varchar2,
888   p_dce_attribute8               in varchar2         default hr_api.g_varchar2,
889   p_dce_attribute9               in varchar2         default hr_api.g_varchar2,
890   p_dce_attribute10              in varchar2         default hr_api.g_varchar2,
891   p_dce_attribute11              in varchar2         default hr_api.g_varchar2,
892   p_dce_attribute12              in varchar2         default hr_api.g_varchar2,
893   p_dce_attribute13              in varchar2         default hr_api.g_varchar2,
894   p_dce_attribute14              in varchar2         default hr_api.g_varchar2,
895   p_dce_attribute15              in varchar2         default hr_api.g_varchar2,
896   p_dce_attribute16              in varchar2         default hr_api.g_varchar2,
897   p_dce_attribute17              in varchar2         default hr_api.g_varchar2,
898   p_dce_attribute18              in varchar2         default hr_api.g_varchar2,
899   p_dce_attribute19              in varchar2         default hr_api.g_varchar2,
900   p_dce_attribute20              in varchar2         default hr_api.g_varchar2,
901   p_dce_attribute21              in varchar2         default hr_api.g_varchar2,
902   p_dce_attribute22              in varchar2         default hr_api.g_varchar2,
903   p_dce_attribute23              in varchar2         default hr_api.g_varchar2,
904   p_dce_attribute24              in varchar2         default hr_api.g_varchar2,
905   p_dce_attribute25              in varchar2         default hr_api.g_varchar2,
906   p_dce_attribute26              in varchar2         default hr_api.g_varchar2,
907   p_dce_attribute27              in varchar2         default hr_api.g_varchar2,
908   p_dce_attribute28              in varchar2         default hr_api.g_varchar2,
909   p_dce_attribute29              in varchar2         default hr_api.g_varchar2,
910   p_dce_attribute30              in varchar2         default hr_api.g_varchar2,
911   p_object_version_number        in out nocopy number,
912   p_effective_date		 in date,
913   p_datetrack_mode		 in varchar2,
914   p_dpnt_rlshp_flag                in  varchar2  default hr_api.g_varchar2,
915   p_dpnt_age_flag                  in  varchar2  default hr_api.g_varchar2,
916   p_dpnt_stud_flag                 in  varchar2  default hr_api.g_varchar2,
917   p_dpnt_dsbld_flag                in  varchar2  default hr_api.g_varchar2,
918   p_dpnt_mrtl_flag                 in  varchar2  default hr_api.g_varchar2,
919   p_dpnt_mltry_flag                in  varchar2  default hr_api.g_varchar2,
920   p_dpnt_pstl_flag                 in  varchar2  default hr_api.g_varchar2,
921   p_dpnt_cvrd_in_anthr_pl_flag     in  varchar2  default hr_api.g_varchar2,
922   p_dpnt_dsgnt_crntly_enrld_flag   in  varchar2  default hr_api.g_varchar2
923   ) is
924 --
925   l_rec		ben_dce_shd.g_rec_type;
926   l_proc	varchar2(72) := g_package||'upd';
927 --
928 Begin
929   hr_utility.set_location('Entering:'||l_proc, 5);
930   --
931   -- Call conversion function to turn arguments into the
932   -- l_rec structure.
933   --
934   l_rec :=
935   ben_dce_shd.convert_args
936   (
937   p_dpnt_cvg_eligy_prfl_id,
938   null,
939   null,
940   p_business_group_id,
941   p_regn_id,
942   p_name,
943   p_dpnt_cvg_eligy_prfl_stat_cd,
944   p_dce_desc,
945 --  p_military_status_rqmt_ind,
946   p_dpnt_cvg_elig_det_rl,
947   p_dce_attribute_category,
948   p_dce_attribute1,
949   p_dce_attribute2,
950   p_dce_attribute3,
951   p_dce_attribute4,
952   p_dce_attribute5,
953   p_dce_attribute6,
954   p_dce_attribute7,
955   p_dce_attribute8,
956   p_dce_attribute9,
957   p_dce_attribute10,
958   p_dce_attribute11,
959   p_dce_attribute12,
960   p_dce_attribute13,
961   p_dce_attribute14,
962   p_dce_attribute15,
963   p_dce_attribute16,
964   p_dce_attribute17,
965   p_dce_attribute18,
966   p_dce_attribute19,
967   p_dce_attribute20,
968   p_dce_attribute21,
969   p_dce_attribute22,
970   p_dce_attribute23,
971   p_dce_attribute24,
972   p_dce_attribute25,
973   p_dce_attribute26,
974   p_dce_attribute27,
975   p_dce_attribute28,
976   p_dce_attribute29,
977   p_dce_attribute30,
978   p_object_version_number,
979   p_dpnt_rlshp_flag,
980   p_dpnt_age_flag,
981   p_dpnt_stud_flag,
982   p_dpnt_dsbld_flag,
983   p_dpnt_mrtl_flag,
984   p_dpnt_mltry_flag,
985   p_dpnt_pstl_flag,
986   p_dpnt_cvrd_in_anthr_pl_flag,
987   p_dpnt_dsgnt_crntly_enrld_flag
988   );
989   --
990   -- Having converted the arguments into the
991   -- plsql record structure we call the corresponding record
992   -- business process.
993   --
994   upd(l_rec, p_effective_date, p_datetrack_mode);
995   p_object_version_number       := l_rec.object_version_number;
996   p_effective_start_date        := l_rec.effective_start_date;
997   p_effective_end_date          := l_rec.effective_end_date;
998   --
999   --
1000   hr_utility.set_location(' Leaving:'||l_proc, 10);
1001 End upd;
1002 --
1003 end ben_dce_upd;