DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_DCE_INS

Source


1 Package Body ben_dce_ins 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_ins.';  -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |----------------------------< dt_insert_dml >-----------------------------|
12 -- ----------------------------------------------------------------------------
13 -- {Start Of Comments}
14 --
15 -- Description:
16 --   This procedure controls the actual dml insert logic for datetrack. The
17 --   functions of this procedure are as follows:
18 --   1) Get the object_version_number.
19 --   2) To set the effective start and end dates to the corresponding
20 --      validation start and end dates. Also, the object version number
21 --      record attribute is set.
22 --   3) To set and unset the g_api_dml status as required (as we are about to
23 --      perform dml).
24 --   4) To insert the row into the schema with the derived effective start
25 --      and end dates and the object version number.
26 --   5) To trap any constraint violations that may have occurred.
27 --   6) To raise any other errors.
28 --
29 -- Prerequisites:
30 --   This is an internal private procedure which must be called from the
31 --   insert_dml and pre_update (logic permitting) procedure and must have
32 --   all mandatory arguments set.
33 --
34 -- In Parameters:
35 --   A Pl/Sql record structre.
36 --
37 -- Post Success:
38 --   The specified row will be inserted into the schema.
39 --
40 -- Post Failure:
41 --   On the insert 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 --   This is an internal datetrack maintenance procedure which should
50 --   not be modified in anyway.
51 --
52 -- Access Status:
53 --   Internal Row Handler Use Only.
54 --
55 -- {End Of Comments}
56 -- ----------------------------------------------------------------------------
57 Procedure dt_insert_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 -- Cursor to select 'old' created AOL who column values
65 --
66   Cursor C_Sel1 Is
67     select t.created_by,
68            t.creation_date
69     from   ben_dpnt_cvg_eligy_prfl_f t
70     where  t.dpnt_cvg_eligy_prfl_id       = p_rec.dpnt_cvg_eligy_prfl_id
71     and    t.effective_start_date =
72              ben_dce_shd.g_old_rec.effective_start_date
73     and    t.effective_end_date   = (p_validation_start_date - 1);
74 --
75   l_proc		varchar2(72) := g_package||'dt_insert_dml';
76   l_created_by          ben_dpnt_cvg_eligy_prfl_f.created_by%TYPE;
77   l_creation_date       ben_dpnt_cvg_eligy_prfl_f.creation_date%TYPE;
78   l_last_update_date   	ben_dpnt_cvg_eligy_prfl_f.last_update_date%TYPE;
79   l_last_updated_by     ben_dpnt_cvg_eligy_prfl_f.last_updated_by%TYPE;
80   l_last_update_login   ben_dpnt_cvg_eligy_prfl_f.last_update_login%TYPE;
81 --
82 Begin
83   hr_utility.set_location('Entering:'||l_proc, 5);
84   --
85   -- Get the object version number for the insert
86   --
87   p_rec.object_version_number :=
88     dt_api.get_object_version_number
89 	(p_base_table_name => 'ben_dpnt_cvg_eligy_prfl_f',
90 	 p_base_key_column => 'dpnt_cvg_eligy_prfl_id',
91 	 p_base_key_value  => p_rec.dpnt_cvg_eligy_prfl_id);
92   --
93   -- Set the effective start and end dates to the corresponding
94   -- validation start and end dates
95   --
96   p_rec.effective_start_date := p_validation_start_date;
97   p_rec.effective_end_date   := p_validation_end_date;
98   --
99   -- If the datetrack_mode is not INSERT then we must populate the WHO
100   -- columns with the 'old' creation values and 'new' updated values.
101   --
102   If (p_datetrack_mode <> 'INSERT') then
103     hr_utility.set_location(l_proc, 10);
104     --
105     -- Select the 'old' created values
106     --
107     Open C_Sel1;
108     Fetch C_Sel1 Into l_created_by, l_creation_date;
109     If C_Sel1%notfound Then
110       --
111       -- The previous 'old' created row has not been found. We need
112       -- to error as an internal datetrack problem exists.
113       --
114       Close C_Sel1;
115       fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
116       fnd_message.set_token('PROCEDURE', l_proc);
117       fnd_message.set_token('STEP','10');
118       fnd_message.raise_error;
119     End If;
120     Close C_Sel1;
121     --
122     -- Set the AOL updated WHO values
123     --
124     l_last_update_date   := sysdate;
125     l_last_updated_by    := fnd_global.user_id;
126     l_last_update_login  := fnd_global.login_id;
127   End If;
128   --
129   ben_dce_shd.g_api_dml := true;  -- Set the api dml status
130   --
131   -- Insert the row into: ben_dpnt_cvg_eligy_prfl_f
132   --
133   insert into ben_dpnt_cvg_eligy_prfl_f
134   (	dpnt_cvg_eligy_prfl_id,
135 	effective_end_date,
136 	effective_start_date,
137 	business_group_id,
138 	regn_id,
139 	name,
140 	dpnt_cvg_eligy_prfl_stat_cd,
141 	dce_desc,
142 --	military_status_rqmt_ind,
143 	dpnt_cvg_elig_det_rl,
144 	dce_attribute_category,
145 	dce_attribute1,
146 	dce_attribute2,
147 	dce_attribute3,
148 	dce_attribute4,
149 	dce_attribute5,
150 	dce_attribute6,
151 	dce_attribute7,
152 	dce_attribute8,
153 	dce_attribute9,
154 	dce_attribute10,
155 	dce_attribute11,
156 	dce_attribute12,
157 	dce_attribute13,
158 	dce_attribute14,
159 	dce_attribute15,
160 	dce_attribute16,
161 	dce_attribute17,
162 	dce_attribute18,
163 	dce_attribute19,
164 	dce_attribute20,
165 	dce_attribute21,
166 	dce_attribute22,
167 	dce_attribute23,
168 	dce_attribute24,
169 	dce_attribute25,
170 	dce_attribute26,
171 	dce_attribute27,
172 	dce_attribute28,
173 	dce_attribute29,
174 	dce_attribute30,
175 	object_version_number
176    	, created_by,
177    	creation_date,
178    	last_update_date,
179    	last_updated_by,
180    	last_update_login,
181         dpnt_rlshp_flag,
182         dpnt_age_flag,
183         dpnt_stud_flag,
184         dpnt_dsbld_flag,
185         dpnt_mrtl_flag,
186         dpnt_mltry_flag,
187         dpnt_pstl_flag,
188         dpnt_cvrd_in_anthr_pl_flag,
189         dpnt_dsgnt_crntly_enrld_flag
190   )
191   Values
192   (	p_rec.dpnt_cvg_eligy_prfl_id,
193 	p_rec.effective_end_date,
194 	p_rec.effective_start_date,
195 	p_rec.business_group_id,
196 	p_rec.regn_id,
197 	p_rec.name,
198 	p_rec.dpnt_cvg_eligy_prfl_stat_cd,
199 	p_rec.dce_desc,
200 --	p_rec.military_status_rqmt_ind,
201 	p_rec.dpnt_cvg_elig_det_rl,
202 	p_rec.dce_attribute_category,
203 	p_rec.dce_attribute1,
204 	p_rec.dce_attribute2,
205 	p_rec.dce_attribute3,
206 	p_rec.dce_attribute4,
207 	p_rec.dce_attribute5,
208 	p_rec.dce_attribute6,
209 	p_rec.dce_attribute7,
210 	p_rec.dce_attribute8,
211 	p_rec.dce_attribute9,
212 	p_rec.dce_attribute10,
213 	p_rec.dce_attribute11,
214 	p_rec.dce_attribute12,
215 	p_rec.dce_attribute13,
216 	p_rec.dce_attribute14,
217 	p_rec.dce_attribute15,
218 	p_rec.dce_attribute16,
219 	p_rec.dce_attribute17,
220 	p_rec.dce_attribute18,
221 	p_rec.dce_attribute19,
222 	p_rec.dce_attribute20,
223 	p_rec.dce_attribute21,
224 	p_rec.dce_attribute22,
225 	p_rec.dce_attribute23,
226 	p_rec.dce_attribute24,
227 	p_rec.dce_attribute25,
228 	p_rec.dce_attribute26,
229 	p_rec.dce_attribute27,
230 	p_rec.dce_attribute28,
231 	p_rec.dce_attribute29,
232 	p_rec.dce_attribute30,
233 	p_rec.object_version_number
234 	, l_created_by,
235    	l_creation_date,
236    	l_last_update_date,
237    	l_last_updated_by,
238    	l_last_update_login,
239         p_rec.dpnt_rlshp_flag,
240         p_rec.dpnt_age_flag,
241         p_rec.dpnt_stud_flag,
242         p_rec.dpnt_dsbld_flag,
243         p_rec.dpnt_mrtl_flag,
244         p_rec.dpnt_mltry_flag,
245         p_rec.dpnt_pstl_flag,
246         p_rec.dpnt_cvrd_in_anthr_pl_flag,
247         p_rec.dpnt_dsgnt_crntly_enrld_flag
248   );
249   --
250   ben_dce_shd.g_api_dml := false;   -- Unset the api dml status
251   hr_utility.set_location(' Leaving:'||l_proc, 15);
252 --
253 Exception
254   When hr_api.check_integrity_violated Then
255     -- A check constraint has been violated
256     ben_dce_shd.g_api_dml := false;   -- Unset the api dml status
257     ben_dce_shd.constraint_error
258       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
259   When hr_api.unique_integrity_violated Then
260     -- Unique integrity has been violated
261     ben_dce_shd.g_api_dml := false;   -- Unset the api dml status
262     ben_dce_shd.constraint_error
263       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
264   When Others Then
265     ben_dce_shd.g_api_dml := false;   -- Unset the api dml status
266     Raise;
267 End dt_insert_dml;
268 --
269 -- ----------------------------------------------------------------------------
270 -- |------------------------------< insert_dml >------------------------------|
271 -- ----------------------------------------------------------------------------
272 Procedure insert_dml
273 	(p_rec 			 in out nocopy ben_dce_shd.g_rec_type,
274 	 p_effective_date	 in	date,
275 	 p_datetrack_mode	 in	varchar2,
276 	 p_validation_start_date in	date,
277 	 p_validation_end_date	 in	date) is
278 --
279   l_proc	varchar2(72) := g_package||'insert_dml';
280 --
281 Begin
282   hr_utility.set_location('Entering:'||l_proc, 5);
283   --
284   dt_insert_dml(p_rec			=> p_rec,
285 		p_effective_date	=> p_effective_date,
286 		p_datetrack_mode	=> p_datetrack_mode,
287        		p_validation_start_date	=> p_validation_start_date,
288 		p_validation_end_date	=> p_validation_end_date);
289   --
290   hr_utility.set_location(' Leaving:'||l_proc, 10);
291 End insert_dml;
292 --
293 -- ----------------------------------------------------------------------------
294 -- |------------------------------< pre_insert >------------------------------|
295 -- ----------------------------------------------------------------------------
296 -- {Start Of Comments}
297 --
298 -- Description:
299 --   This private procedure contains any processing which is required before
300 --   the insert dml. Presently, if the entity has a corresponding primary
301 --   key which is maintained by an associating sequence, the primary key for
302 --   the entity will be populated with the next sequence value in
303 --   preparation for the insert dml.
304 --   Also, if comments are defined for this entity, the comments insert
305 --   logic will also be called, generating a comment_id if required.
306 --
307 -- Prerequisites:
308 --   This is an internal procedure which is called from the ins procedure.
309 --
310 -- In Parameters:
311 --   A Pl/Sql record structre.
312 --
313 -- Post Success:
314 --   Processing continues.
315 --
316 -- Post Failure:
317 --   If an error has occurred, an error message and exception will be raised
318 --   but not handled.
319 --
320 -- Developer Implementation Notes:
321 --   Any pre-processing required before the insert dml is issued should be
322 --   coded within this procedure. As stated above, a good example is the
323 --   generation of a primary key number via a corresponding sequence.
324 --   It is important to note that any 3rd party maintenance should be reviewed
325 --   before placing in this procedure.
326 --
327 -- Access Status:
328 --   Internal Row Handler Use Only.
329 --
330 -- {End Of Comments}
331 -- ----------------------------------------------------------------------------
332 Procedure pre_insert
333 	(p_rec  			in out nocopy ben_dce_shd.g_rec_type,
334 	 p_effective_date		in date,
335 	 p_datetrack_mode		in varchar2,
336 	 p_validation_start_date	in date,
337 	 p_validation_end_date		in date) is
338 --
339   l_proc	varchar2(72) := g_package||'pre_insert';
340   cursor c1 is
341 	select BEN_DPNT_CVG_ELIGY_PRFL_F_S.nextval
342 		from sys.dual;
343 --
344 --
345 Begin
346   hr_utility.set_location('Entering:'||l_proc, 5);
347 
348   -- *
349   -- * Fetch next sequence number from DB sequence, and assign to primary key,
350   -- *
351   open c1;
352   fetch c1 into p_rec.DPNT_CVG_ELIGY_PRFL_ID;
353   close c1;
354 
355   hr_utility.set_location(' Leaving:'||l_proc, 10);
356 
357 End pre_insert;
358 --
359 -- ----------------------------------------------------------------------------
360 -- |-----------------------------< post_insert >------------------------------|
361 -- ----------------------------------------------------------------------------
362 -- {Start Of Comments}
363 --
364 -- Description:
365 --   This private procedure contains any processing which is required after the
366 --   insert dml.
367 --
368 -- Prerequisites:
369 --   This is an internal procedure which is called from the ins procedure.
370 --
371 -- In Parameters:
372 --   A Pl/Sql record structre.
373 --
374 -- Post Success:
375 --   Processing continues.
376 --
377 -- Post Failure:
378 --   If an error has occurred, an error message and exception will be raised
379 --   but not handled.
380 --
381 -- Developer Implementation Notes:
382 --   Any post-processing required after the insert dml is issued should be
383 --   coded within this procedure. It is important to note that any 3rd party
384 --   maintenance should be reviewed before placing in this procedure.
385 --
386 -- Access Status:
387 --   Internal Row Handler Use Only.
388 --
389 -- {End Of Comments}
390 -- ----------------------------------------------------------------------------
391 Procedure post_insert
392 	(p_rec 			 in ben_dce_shd.g_rec_type,
393 	 p_effective_date	 in date,
394 	 p_datetrack_mode	 in varchar2,
395 	 p_validation_start_date in date,
396 	 p_validation_end_date	 in date) is
397 --
398   l_proc	varchar2(72) := g_package||'post_insert';
399 --
400 Begin
401   hr_utility.set_location('Entering:'||l_proc, 5);
402 --
403   --
404   -- Start of API User Hook for post_insert.
405   --
406   begin
407     --
408     ben_dce_rki.after_insert
409       (
410   p_dpnt_cvg_eligy_prfl_id        =>p_rec.dpnt_cvg_eligy_prfl_id
411  ,p_effective_end_date            =>p_rec.effective_end_date
412  ,p_effective_start_date          =>p_rec.effective_start_date
413  ,p_business_group_id             =>p_rec.business_group_id
414  ,p_regn_id                       =>p_rec.regn_id
415  ,p_name                          =>p_rec.name
416  ,p_dpnt_cvg_eligy_prfl_stat_cd   =>p_rec.dpnt_cvg_eligy_prfl_stat_cd
417  ,p_dce_desc                      =>p_rec.dce_desc
418 -- ,p_military_status_rqmt_ind      =>p_rec.military_status_rqmt_ind
419  ,p_dpnt_cvg_elig_det_rl          =>p_rec.dpnt_cvg_elig_det_rl
420  ,p_dce_attribute_category        =>p_rec.dce_attribute_category
421  ,p_dce_attribute1                =>p_rec.dce_attribute1
422  ,p_dce_attribute2                =>p_rec.dce_attribute2
423  ,p_dce_attribute3                =>p_rec.dce_attribute3
424  ,p_dce_attribute4                =>p_rec.dce_attribute4
425  ,p_dce_attribute5                =>p_rec.dce_attribute5
426  ,p_dce_attribute6                =>p_rec.dce_attribute6
427  ,p_dce_attribute7                =>p_rec.dce_attribute7
428  ,p_dce_attribute8                =>p_rec.dce_attribute8
429  ,p_dce_attribute9                =>p_rec.dce_attribute9
430  ,p_dce_attribute10               =>p_rec.dce_attribute10
431  ,p_dce_attribute11               =>p_rec.dce_attribute11
432  ,p_dce_attribute12               =>p_rec.dce_attribute12
433  ,p_dce_attribute13               =>p_rec.dce_attribute13
434  ,p_dce_attribute14               =>p_rec.dce_attribute14
435  ,p_dce_attribute15               =>p_rec.dce_attribute15
436  ,p_dce_attribute16               =>p_rec.dce_attribute16
437  ,p_dce_attribute17               =>p_rec.dce_attribute17
438  ,p_dce_attribute18               =>p_rec.dce_attribute18
439  ,p_dce_attribute19               =>p_rec.dce_attribute19
440  ,p_dce_attribute20               =>p_rec.dce_attribute20
441  ,p_dce_attribute21               =>p_rec.dce_attribute21
442  ,p_dce_attribute22               =>p_rec.dce_attribute22
443  ,p_dce_attribute23               =>p_rec.dce_attribute23
444  ,p_dce_attribute24               =>p_rec.dce_attribute24
445  ,p_dce_attribute25               =>p_rec.dce_attribute25
446  ,p_dce_attribute26               =>p_rec.dce_attribute26
447  ,p_dce_attribute27               =>p_rec.dce_attribute27
448  ,p_dce_attribute28               =>p_rec.dce_attribute28
449  ,p_dce_attribute29               =>p_rec.dce_attribute29
450  ,p_dce_attribute30               =>p_rec.dce_attribute30
451  ,p_object_version_number         =>p_rec.object_version_number
452  ,p_effective_date                =>p_effective_date
453  ,p_validation_start_date         =>p_validation_start_date
454  ,p_validation_end_date           =>p_validation_end_date
455  ,p_dpnt_rlshp_flag                => p_rec.dpnt_rlshp_flag
456  ,p_dpnt_age_flag                  => p_rec.dpnt_age_flag
457  ,p_dpnt_stud_flag                 => p_rec.dpnt_stud_flag
458  ,p_dpnt_dsbld_flag                => p_rec.dpnt_dsbld_flag
459  ,p_dpnt_mrtl_flag                 => p_rec.dpnt_mrtl_flag
460  ,p_dpnt_mltry_flag                => p_rec.dpnt_mltry_flag
461  ,p_dpnt_pstl_flag                 => p_rec.dpnt_pstl_flag
462  ,p_dpnt_cvrd_in_anthr_pl_flag     => p_rec.dpnt_cvrd_in_anthr_pl_flag
463  ,p_dpnt_dsgnt_crntly_enrld_flag   => p_rec.dpnt_dsgnt_crntly_enrld_flag
464  );
465     --
466   exception
467     --
468     when hr_api.cannot_find_prog_unit then
469       --
470       hr_api.cannot_find_prog_unit_error
471         (p_module_name => 'ben_dpnt_cvg_eligy_prfl_f'
472         ,p_hook_type   => 'AI');
473       --
474   end;
475   --
476   -- End of API User Hook for post_insert.
477   --
478   --
479   hr_utility.set_location(' Leaving:'||l_proc, 10);
480 End post_insert;
481 --
482 -- ----------------------------------------------------------------------------
483 -- |-------------------------------< ins_lck >--------------------------------|
484 -- ----------------------------------------------------------------------------
485 -- {Start Of Comments}
486 --
487 -- Description:
488 --   The ins_lck process has one main function to perform. When inserting
489 --   a datetracked row, we must validate the DT mode.
490 --   be manipulated.
491 --
492 -- Prerequisites:
493 --   This procedure can only be called for the datetrack mode of INSERT.
494 --
495 -- In Parameters:
496 --
497 -- Post Success:
498 --   On successful completion of the ins_lck process the parental
499 --   datetracked rows will be locked providing the p_enforce_foreign_locking
500 --   argument value is TRUE.
501 --   If the p_enforce_foreign_locking argument value is FALSE then the
502 --   parential rows are not locked.
503 --
504 -- Post Failure:
505 --   The Lck process can fail for:
506 --   1) When attempting to lock the row the row could already be locked by
507 --      another user. This will raise the HR_Api.Object_Locked exception.
508 --   2) When attempting to the lock the parent which doesn't exist.
509 --      For the entity to be locked the parent must exist!
510 --
511 -- Developer Implementation Notes:
512 --   None.
513 --
514 -- Access Status:
515 --   Internal Row Handler Use Only.
516 --
517 -- {End Of Comments}
518 -- ----------------------------------------------------------------------------
519 Procedure ins_lck
520 	(p_effective_date	 in  date,
521 	 p_datetrack_mode	 in  varchar2,
522 	 p_rec	 		 in  ben_dce_shd.g_rec_type,
523 	 p_validation_start_date out nocopy date,
524 	 p_validation_end_date	 out nocopy date) is
525 --
526   l_proc		  varchar2(72) := g_package||'ins_lck';
527   l_validation_start_date date;
528   l_validation_end_date	  date;
529 --
530 Begin
531   hr_utility.set_location('Entering:'||l_proc, 5);
532   --
533   -- Validate the datetrack mode mode getting the validation start
534   -- and end dates for the specified datetrack operation.
535   --
536   dt_api.validate_dt_mode
537 	(p_effective_date	   => p_effective_date,
538 	 p_datetrack_mode	   => p_datetrack_mode,
539 	 p_base_table_name	   => 'ben_dpnt_cvg_eligy_prfl_f',
540 	 p_base_key_column	   => 'dpnt_cvg_eligy_prfl_id',
541 	 p_base_key_value 	   => p_rec.dpnt_cvg_eligy_prfl_id,
542 	 p_parent_table_name1      => 'ben_regn_f',
543 	 p_parent_key_column1      => 'regn_id',
544 	 p_parent_key_value1       => p_rec.regn_id,
545          p_enforce_foreign_locking => true,
546 	 p_validation_start_date   => l_validation_start_date,
547  	 p_validation_end_date	   => l_validation_end_date);
548   --
549   -- Set the validation start and end date OUT arguments
550   --
551   p_validation_start_date := l_validation_start_date;
552   p_validation_end_date   := l_validation_end_date;
553   --
554   hr_utility.set_location(' Leaving:'||l_proc, 10);
555 --
556 End ins_lck;
557 --
558 -- ----------------------------------------------------------------------------
559 -- |---------------------------------< ins >----------------------------------|
560 -- ----------------------------------------------------------------------------
561 Procedure ins
562   (
563   p_rec		   in out nocopy ben_dce_shd.g_rec_type,
564   p_effective_date in     date
565   ) is
566 --
567   l_proc			varchar2(72) := g_package||'ins';
568   l_datetrack_mode		varchar2(30) := 'INSERT';
569   l_validation_start_date	date;
570   l_validation_end_date		date;
571 --
572 Begin
573   hr_utility.set_location('Entering:'||l_proc, 5);
574   --
575   -- Call the lock operation
576   --
577   ins_lck
578 	(p_effective_date	 => p_effective_date,
579 	 p_datetrack_mode	 => l_datetrack_mode,
580 	 p_rec	 		 => p_rec,
581 	 p_validation_start_date => l_validation_start_date,
582 	 p_validation_end_date	 => l_validation_end_date);
583   --
584   -- Call the supporting insert validate operations
585   --
586   ben_dce_bus.insert_validate
587 	(p_rec			 => p_rec,
588 	 p_effective_date	 => p_effective_date,
589 	 p_datetrack_mode	 => l_datetrack_mode,
590 	 p_validation_start_date => l_validation_start_date,
591 	 p_validation_end_date	 => l_validation_end_date);
592   --
593   -- Call the supporting pre-insert operation
594   --
595   pre_insert
596  	(p_rec			 => p_rec,
597 	 p_effective_date	 => p_effective_date,
598 	 p_datetrack_mode	 => l_datetrack_mode,
599 	 p_validation_start_date => l_validation_start_date,
600 	 p_validation_end_date	 => l_validation_end_date);
601   --
602   -- Insert the row
603   --
604   insert_dml
605  	(p_rec			 => p_rec,
606 	 p_effective_date	 => p_effective_date,
607 	 p_datetrack_mode	 => l_datetrack_mode,
608 	 p_validation_start_date => l_validation_start_date,
609 	 p_validation_end_date	 => l_validation_end_date);
610   --
611   -- Call the supporting post-insert operation
612   --
613   post_insert
614  	(p_rec			 => p_rec,
615 	 p_effective_date	 => p_effective_date,
616 	 p_datetrack_mode	 => l_datetrack_mode,
617 	 p_validation_start_date => l_validation_start_date,
618 	 p_validation_end_date	 => l_validation_end_date);
619 end ins;
620 --
621 -- ----------------------------------------------------------------------------
622 -- |---------------------------------< ins >----------------------------------|
623 -- ----------------------------------------------------------------------------
624 Procedure ins
625   (
626   p_dpnt_cvg_eligy_prfl_id       out nocopy number,
627   p_effective_end_date           out nocopy date,
628   p_effective_start_date         out nocopy date,
629   p_business_group_id            in number,
630   p_regn_id                      in number           default null,
631   p_name                         in varchar2,
632   p_dpnt_cvg_eligy_prfl_stat_cd  in varchar2         default null,
633   p_dce_desc                     in varchar2         default null,
634 --  p_military_status_rqmt_ind     in varchar2         default null,
635   p_dpnt_cvg_elig_det_rl         in number           default null,
636   p_dce_attribute_category       in varchar2         default null,
637   p_dce_attribute1               in varchar2         default null,
638   p_dce_attribute2               in varchar2         default null,
639   p_dce_attribute3               in varchar2         default null,
640   p_dce_attribute4               in varchar2         default null,
641   p_dce_attribute5               in varchar2         default null,
642   p_dce_attribute6               in varchar2         default null,
643   p_dce_attribute7               in varchar2         default null,
644   p_dce_attribute8               in varchar2         default null,
645   p_dce_attribute9               in varchar2         default null,
646   p_dce_attribute10              in varchar2         default null,
647   p_dce_attribute11              in varchar2         default null,
648   p_dce_attribute12              in varchar2         default null,
649   p_dce_attribute13              in varchar2         default null,
650   p_dce_attribute14              in varchar2         default null,
651   p_dce_attribute15              in varchar2         default null,
652   p_dce_attribute16              in varchar2         default null,
653   p_dce_attribute17              in varchar2         default null,
654   p_dce_attribute18              in varchar2         default null,
655   p_dce_attribute19              in varchar2         default null,
656   p_dce_attribute20              in varchar2         default null,
657   p_dce_attribute21              in varchar2         default null,
658   p_dce_attribute22              in varchar2         default null,
659   p_dce_attribute23              in varchar2         default null,
660   p_dce_attribute24              in varchar2         default null,
661   p_dce_attribute25              in varchar2         default null,
662   p_dce_attribute26              in varchar2         default null,
663   p_dce_attribute27              in varchar2         default null,
664   p_dce_attribute28              in varchar2         default null,
665   p_dce_attribute29              in varchar2         default null,
666   p_dce_attribute30              in varchar2         default null,
667   p_object_version_number        out nocopy number,
668   p_effective_date		 in date,
669   p_dpnt_rlshp_flag                in  varchar2  default 'N',
670   p_dpnt_age_flag                  in  varchar2  default 'N',
671   p_dpnt_stud_flag                 in  varchar2  default 'N',
672   p_dpnt_dsbld_flag                in  varchar2  default 'N',
673   p_dpnt_mrtl_flag                 in  varchar2  default 'N',
674   p_dpnt_mltry_flag                in  varchar2  default 'N',
675   p_dpnt_pstl_flag                 in  varchar2  default 'N',
676   p_dpnt_cvrd_in_anthr_pl_flag     in  varchar2  default 'N',
677   p_dpnt_dsgnt_crntly_enrld_flag   in  varchar2  default 'N'
678   ) is
679 --
680   l_rec		ben_dce_shd.g_rec_type;
681   l_proc	varchar2(72) := g_package||'ins';
682 --
683 Begin
684   hr_utility.set_location('Entering:'||l_proc, 5);
685   --
686   -- Call conversion function to turn arguments into the
687   -- p_rec structure.
688   --
689   l_rec :=
690   ben_dce_shd.convert_args
691   (
692   null,
693   null,
694   null,
695   p_business_group_id,
696   p_regn_id,
697   p_name,
698   p_dpnt_cvg_eligy_prfl_stat_cd,
699   p_dce_desc,
700 --  p_military_status_rqmt_ind,
701   p_dpnt_cvg_elig_det_rl,
702   p_dce_attribute_category,
703   p_dce_attribute1,
704   p_dce_attribute2,
705   p_dce_attribute3,
706   p_dce_attribute4,
707   p_dce_attribute5,
708   p_dce_attribute6,
709   p_dce_attribute7,
710   p_dce_attribute8,
711   p_dce_attribute9,
712   p_dce_attribute10,
713   p_dce_attribute11,
714   p_dce_attribute12,
715   p_dce_attribute13,
716   p_dce_attribute14,
717   p_dce_attribute15,
718   p_dce_attribute16,
719   p_dce_attribute17,
720   p_dce_attribute18,
721   p_dce_attribute19,
722   p_dce_attribute20,
723   p_dce_attribute21,
724   p_dce_attribute22,
725   p_dce_attribute23,
726   p_dce_attribute24,
727   p_dce_attribute25,
728   p_dce_attribute26,
729   p_dce_attribute27,
730   p_dce_attribute28,
731   p_dce_attribute29,
732   p_dce_attribute30,
733   null,
734   p_dpnt_rlshp_flag,
735   p_dpnt_age_flag,
736   p_dpnt_stud_flag,
737   p_dpnt_dsbld_flag,
738   p_dpnt_mrtl_flag,
739   p_dpnt_mltry_flag,
740   p_dpnt_pstl_flag ,
741   p_dpnt_cvrd_in_anthr_pl_flag,
742   p_dpnt_dsgnt_crntly_enrld_flag
743   );
744   --
745   -- Having converted the arguments into the ben_dce_rec
746   -- plsql record structure we call the corresponding record
747   -- business process.
748   --
749   ins(l_rec, p_effective_date);
750   --
751   -- Set the OUT arguments.
752   --
753   p_dpnt_cvg_eligy_prfl_id        	:= l_rec.dpnt_cvg_eligy_prfl_id;
754   p_effective_start_date  	:= l_rec.effective_start_date;
755   p_effective_end_date    	:= l_rec.effective_end_date;
756   p_object_version_number 	:= l_rec.object_version_number;
757   --
758   --
759   hr_utility.set_location(' Leaving:'||l_proc, 10);
760 End ins;
761 --
762 end ben_dce_ins;