[Home] [Help]
PACKAGE BODY: APPS.PER_REI_INS
Source
1 Package Body per_rei_ins as
2 /* $Header: pereirhi.pkb 115.6 2003/10/07 19:01:25 ttagawa noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' per_rei_ins.'; -- Global package name
9 --
10 -- The following global variables are only to be used by
11 -- the set_base_key_value and pre_insert procedures.
12 --
13 g_contact_extra_info_id_i number default null;
14 --
15 -- ----------------------------------------------------------------------------
16 -- |------------------------< set_base_key_value >----------------------------|
17 -- ----------------------------------------------------------------------------
18 procedure set_base_key_value
19 (p_contact_extra_info_id in number) is
20 --
21 l_proc varchar2(72) := g_package||'set_base_key_value';
22 --
23 Begin
24 hr_utility.set_location('Entering:'||l_proc, 10);
25 --
26 per_rei_ins.g_contact_extra_info_id_i := p_contact_extra_info_id;
27 --
28 hr_utility.set_location(' Leaving:'||l_proc, 20);
29 End set_base_key_value;
30 --
31 --
32 -- ----------------------------------------------------------------------------
33 -- |----------------------------< dt_insert_dml >-----------------------------|
34 -- ----------------------------------------------------------------------------
35 -- {Start Of Comments}
36 --
37 -- Description:
38 -- This procedure controls the actual dml insert logic for datetrack. The
39 -- functions of this procedure are as follows:
40 -- 1) Get the object_version_number.
41 -- 2) To set the effective start and end dates to the corresponding
42 -- validation start and end dates. Also, the object version number
43 -- record attribute is set.
44 -- 3) To set and unset the g_api_dml status as required (as we are about to
45 -- perform dml).
49 -- 6) To raise any other errors.
46 -- 4) To insert the row into the schema with the derived effective start
47 -- and end dates and the object version number.
48 -- 5) To trap any constraint violations that may have occurred.
50 --
51 -- Prerequisites:
52 -- This is an internal private procedure which must be called from the
53 -- insert_dml and pre_update (logic permitting) procedure and must have
54 -- all mandatory arguments set.
55 --
56 -- In Parameters:
57 -- A Pl/Sql record structure.
58 --
59 -- Post Success:
60 -- The specified row will be inserted into the schema.
61 --
62 -- Post Failure:
63 -- On the insert dml failure it is important to note that we always reset the
64 -- g_api_dml status to false.
65 -- If a check or unique integrity constraint violation is raised the
66 -- constraint_error procedure will be called.
67 -- If any other error is reported, the error will be raised after the
68 -- g_api_dml status is reset.
69 --
70 -- Developer Implementation Notes:
71 -- This is an internal datetrack maintenance procedure which should
72 -- not be modified in anyway.
73 --
74 -- Access Status:
75 -- Internal Row Handler Use Only.
76 --
77 -- {End Of Comments}
78 -- ----------------------------------------------------------------------------
79 Procedure dt_insert_dml
80 (p_rec in out nocopy per_rei_shd.g_rec_type
81 ,p_effective_date in date
82 ,p_datetrack_mode in varchar2
83 ,p_validation_start_date in date
84 ,p_validation_end_date in date
85 ) is
86 -- Cursor to select 'old' created AOL who column values
87 --
88 Cursor C_Sel1 Is
89 select t.created_by,
90 t.creation_date
91 from per_contact_extra_info_f t
92 where t.contact_extra_info_id = p_rec.contact_extra_info_id
93 and t.effective_start_date =
94 per_rei_shd.g_old_rec.effective_start_date
95 and t.effective_end_date = (p_validation_start_date - 1);
96 --
97 l_proc varchar2(72) := g_package||'dt_insert_dml';
98 l_created_by per_contact_extra_info_f.created_by%TYPE;
99 l_creation_date per_contact_extra_info_f.creation_date%TYPE;
100 l_last_update_date per_contact_extra_info_f.last_update_date%TYPE;
101 l_last_updated_by per_contact_extra_info_f.last_updated_by%TYPE;
102 l_last_update_login per_contact_extra_info_f.last_update_login%TYPE;
103 --
104 Begin
105 hr_utility.set_location('Entering:'||l_proc, 5);
106 --
107 -- Get the object version number for the insert
108 --
109 p_rec.object_version_number :=
110 dt_api.get_object_version_number
111 (p_base_table_name => 'per_contact_extra_info_f'
112 ,p_base_key_column => 'contact_extra_info_id'
113 ,p_base_key_value => p_rec.contact_extra_info_id
114 );
115 --
116 -- Set the effective start and end dates to the corresponding
117 -- validation start and end dates
118 --
119 p_rec.effective_start_date := p_validation_start_date;
120 p_rec.effective_end_date := p_validation_end_date;
121 --
122 -- If the datetrack_mode is not INSERT then we must populate the WHO
123 -- columns with the 'old' creation values and 'new' updated values.
124 --
125 If (p_datetrack_mode <> hr_api.g_insert) then
126 hr_utility.set_location(l_proc, 10);
127 --
128 -- Select the 'old' created values
129 --
130 Open C_Sel1;
131 Fetch C_Sel1 Into l_created_by, l_creation_date;
132 If C_Sel1%notfound Then
133 --
134 -- The previous 'old' created row has not been found. We need
135 -- to error as an internal datetrack problem exists.
136 --
137 Close C_Sel1;
138 fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
139 fnd_message.set_token('PROCEDURE', l_proc);
140 fnd_message.set_token('STEP','10');
141 fnd_message.raise_error;
142 End If;
143 Close C_Sel1;
144 --
145 -- Set the AOL updated WHO values
146 --
147 l_last_update_date := sysdate;
148 l_last_updated_by := fnd_global.user_id;
149 l_last_update_login := fnd_global.login_id;
150 End If;
151 --
152 per_rei_shd.g_api_dml := true; -- Set the api dml status
153 --
154 -- Insert the row into: per_contact_extra_info_f
155 --
156 insert into per_contact_extra_info_f
157 (contact_extra_info_id
158 ,effective_start_date
159 ,effective_end_date
160 ,contact_relationship_id
161 ,information_type
162 ,cei_information_category
163 ,cei_information1
164 ,cei_information2
165 ,cei_information3
166 ,cei_information4
167 ,cei_information5
168 ,cei_information6
169 ,cei_information7
170 ,cei_information8
171 ,cei_information9
172 ,cei_information10
173 ,cei_information11
174 ,cei_information12
175 ,cei_information13
176 ,cei_information14
177 ,cei_information15
178 ,cei_information16
179 ,cei_information17
180 ,cei_information18
181 ,cei_information19
182 ,cei_information20
183 ,cei_information21
184 ,cei_information22
185 ,cei_information23
186 ,cei_information24
187 ,cei_information25
188 ,cei_information26
192 ,cei_information30
189 ,cei_information27
190 ,cei_information28
191 ,cei_information29
193 ,cei_attribute_category
194 ,cei_attribute1
195 ,cei_attribute2
196 ,cei_attribute3
197 ,cei_attribute4
198 ,cei_attribute5
199 ,cei_attribute6
200 ,cei_attribute7
201 ,cei_attribute8
202 ,cei_attribute9
203 ,cei_attribute10
204 ,cei_attribute11
205 ,cei_attribute12
206 ,cei_attribute13
207 ,cei_attribute14
208 ,cei_attribute15
209 ,cei_attribute16
210 ,cei_attribute17
211 ,cei_attribute18
212 ,cei_attribute19
213 ,cei_attribute20
214 ,object_version_number
215 ,request_id
216 ,program_application_id
217 ,program_id
218 ,program_update_date
219 ,created_by
220 ,creation_date
221 ,last_update_date
222 ,last_updated_by
223 ,last_update_login
224 )
225 Values
226 (p_rec.contact_extra_info_id
227 ,p_rec.effective_start_date
228 ,p_rec.effective_end_date
229 ,p_rec.contact_relationship_id
230 ,p_rec.information_type
231 ,p_rec.cei_information_category
232 ,p_rec.cei_information1
233 ,p_rec.cei_information2
234 ,p_rec.cei_information3
235 ,p_rec.cei_information4
236 ,p_rec.cei_information5
237 ,p_rec.cei_information6
238 ,p_rec.cei_information7
239 ,p_rec.cei_information8
240 ,p_rec.cei_information9
241 ,p_rec.cei_information10
242 ,p_rec.cei_information11
243 ,p_rec.cei_information12
244 ,p_rec.cei_information13
245 ,p_rec.cei_information14
246 ,p_rec.cei_information15
247 ,p_rec.cei_information16
248 ,p_rec.cei_information17
249 ,p_rec.cei_information18
250 ,p_rec.cei_information19
251 ,p_rec.cei_information20
252 ,p_rec.cei_information21
253 ,p_rec.cei_information22
254 ,p_rec.cei_information23
255 ,p_rec.cei_information24
256 ,p_rec.cei_information25
257 ,p_rec.cei_information26
258 ,p_rec.cei_information27
259 ,p_rec.cei_information28
260 ,p_rec.cei_information29
261 ,p_rec.cei_information30
262 ,p_rec.cei_attribute_category
263 ,p_rec.cei_attribute1
264 ,p_rec.cei_attribute2
265 ,p_rec.cei_attribute3
266 ,p_rec.cei_attribute4
267 ,p_rec.cei_attribute5
268 ,p_rec.cei_attribute6
269 ,p_rec.cei_attribute7
270 ,p_rec.cei_attribute8
271 ,p_rec.cei_attribute9
272 ,p_rec.cei_attribute10
273 ,p_rec.cei_attribute11
274 ,p_rec.cei_attribute12
275 ,p_rec.cei_attribute13
276 ,p_rec.cei_attribute14
277 ,p_rec.cei_attribute15
278 ,p_rec.cei_attribute16
279 ,p_rec.cei_attribute17
280 ,p_rec.cei_attribute18
281 ,p_rec.cei_attribute19
282 ,p_rec.cei_attribute20
283 ,p_rec.object_version_number
284 ,p_rec.request_id
285 ,p_rec.program_application_id
286 ,p_rec.program_id
287 ,p_rec.program_update_date
288 ,l_created_by
289 ,l_creation_date
290 ,l_last_update_date
291 ,l_last_updated_by
292 ,l_last_update_login
293 );
294 --
295 per_rei_shd.g_api_dml := false; -- Unset the api dml status
296 hr_utility.set_location(' Leaving:'||l_proc, 15);
297 --
298 Exception
299 When hr_api.check_integrity_violated Then
300 -- A check constraint has been violated
301 per_rei_shd.g_api_dml := false; -- Unset the api dml status
302 per_rei_shd.constraint_error
303 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
304 When hr_api.unique_integrity_violated Then
305 -- Unique integrity has been violated
306 per_rei_shd.g_api_dml := false; -- Unset the api dml status
307 per_rei_shd.constraint_error
308 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
309 When Others Then
310 per_rei_shd.g_api_dml := false; -- Unset the api dml status
311 Raise;
312 End dt_insert_dml;
313 --
314 -- ----------------------------------------------------------------------------
315 -- |------------------------------< insert_dml >------------------------------|
316 -- ----------------------------------------------------------------------------
317 Procedure insert_dml
318 (p_rec in out nocopy per_rei_shd.g_rec_type
319 ,p_effective_date in date
320 ,p_datetrack_mode in varchar2
321 ,p_validation_start_date in date
322 ,p_validation_end_date in date
323 ) is
324 --
325 l_proc varchar2(72) := g_package||'insert_dml';
326 --
327 Begin
328 hr_utility.set_location('Entering:'||l_proc, 5);
329 --
330 per_rei_ins.dt_insert_dml
331 (p_rec => p_rec
332 ,p_effective_date => p_effective_date
333 ,p_datetrack_mode => p_datetrack_mode
334 ,p_validation_start_date => p_validation_start_date
335 ,p_validation_end_date => p_validation_end_date
336 );
337 --
338 hr_utility.set_location(' Leaving:'||l_proc, 10);
339 End insert_dml;
340 --
341 -- ----------------------------------------------------------------------------
342 -- |------------------------------< pre_insert >------------------------------|
343 -- ----------------------------------------------------------------------------
344 -- {Start Of Comments}
345 --
346 -- Description:
347 -- This private procedure contains any processing which is required before
348 -- the insert dml. Presently, if the entity has a corresponding primary
349 -- key which is maintained by an associating sequence, the primary key for
350 -- the entity will be populated with the next sequence value in
351 -- preparation for the insert dml.
352 -- Also, if comments are defined for this entity, the comments insert
353 -- logic will also be called, generating a comment_id if required.
354 --
355 -- Prerequisites:
356 -- This is an internal procedure which is called from the ins procedure.
357 --
358 -- In Parameters:
359 -- A Pl/Sql record structure.
360 --
361 -- Post Success:
362 -- Processing continues.
363 --
364 -- Post Failure:
365 -- If an error has occurred, an error message and exception will be raised
366 -- but not handled.
367 --
368 -- Developer Implementation Notes:
369 -- Any pre-processing required before the insert dml is issued should be
370 -- coded within this procedure. As stated above, a good example is the
371 -- generation of a primary key number via a corresponding sequence.
372 -- It is important to note that any 3rd party maintenance should be reviewed
373 -- before placing in this procedure.
374 --
375 -- Access Status:
376 -- Internal Row Handler Use Only.
377 --
378 -- {End Of Comments}
379 -- ----------------------------------------------------------------------------
380 Procedure pre_insert
381 (p_rec in out nocopy per_rei_shd.g_rec_type
382 ,p_effective_date in date
383 ,p_datetrack_mode in varchar2
384 ,p_validation_start_date in date
385 ,p_validation_end_date in date
386 ) is
387 --
388 Cursor C_Sel1 is select per_contact_extra_info_s.nextval from sys.dual;
389 --
390 Cursor C_Sel2 is
391 Select null
392 from per_contact_extra_info_f
393 where contact_extra_info_id =
394 per_rei_ins.g_contact_extra_info_id_i;
395 --
396 l_proc varchar2(72) := g_package||'pre_insert';
397 l_exists varchar2(1);
398 --
399 Begin
400 hr_utility.set_location('Entering:'||l_proc, 5);
401 --
402 If (per_rei_ins.g_contact_extra_info_id_i is not null) Then
403 --
404 -- Verify registered primary key values not already in use
405 --
406 Open C_Sel2;
407 Fetch C_Sel2 into l_exists;
408 If C_Sel2%found Then
409 Close C_Sel2;
410 --
411 -- The primary key values are already in use.
412 --
413 fnd_message.set_name('PER','PER_289391_KEY_ALREADY_USED');
414 fnd_message.set_token('TABLE_NAME','per_contact_extra_info_f');
415 fnd_message.raise_error;
416 End If;
417 Close C_Sel2;
418 --
419 -- Use registered key values and clear globals
420 --
421 p_rec.contact_extra_info_id :=
422 per_rei_ins.g_contact_extra_info_id_i;
423 per_rei_ins.g_contact_extra_info_id_i := null;
424 Else
425 --
426 -- No registerd key values, so select the next sequence number
427 --
428 --
429 -- Select the next sequence number
430 --
431 Open C_Sel1;
432 Fetch C_Sel1 Into p_rec.contact_extra_info_id;
433 Close C_Sel1;
434 End If;
435 --
436 --
437 hr_utility.set_location(' Leaving:'||l_proc, 10);
438 End pre_insert;
439 --
440 -- ----------------------------------------------------------------------------
441 -- |----------------------------< post_insert >-------------------------------|
442 -- ----------------------------------------------------------------------------
443 -- {Start Of Comments}
444 --
445 -- Description:
446 -- This private procedure contains any processing which is required after
447 -- the insert dml.
448 --
449 -- Prerequisites:
450 -- This is an internal procedure which is called from the ins procedure.
451 --
452 -- In Parameters:
453 -- A Pl/Sql record structure.
454 --
455 -- Post Success:
456 -- Processing continues.
457 --
458 -- Post Failure:
459 -- If an error has occurred, an error message and exception will be raised
460 -- but not handled.
461 --
462 -- Developer Implementation Notes:
463 -- Any post-processing required after the insert dml is issued should be
464 -- coded within this procedure. It is important to note that any 3rd party
465 -- maintenance should be reviewed before placing in this procedure.
466 --
467 -- Access Status:
468 -- Internal Row Handler Use Only.
469 --
470 -- {End Of Comments}
471 -- ----------------------------------------------------------------------------
472 Procedure post_insert
473 (p_rec in per_rei_shd.g_rec_type
474 ,p_effective_date in date
475 ,p_datetrack_mode in varchar2
476 ,p_validation_start_date in date
477 ,p_validation_end_date in date
478 ) is
479 --
480 l_proc varchar2(72) := g_package||'post_insert';
481 --
482 Begin
483 hr_utility.set_location('Entering:'||l_proc, 5);
484 begin
485 --
486 per_rei_rki.after_insert
487 (p_effective_date
488 => p_effective_date
489 ,p_validation_start_date
490 => p_validation_start_date
491 ,p_validation_end_date
492 => p_validation_end_date
493 ,p_contact_extra_info_id
494 => p_rec.contact_extra_info_id
495 ,p_effective_start_date
496 => p_rec.effective_start_date
497 ,p_effective_end_date
498 => p_rec.effective_end_date
499 ,p_contact_relationship_id
500 => p_rec.contact_relationship_id
501 ,p_information_type
502 => p_rec.information_type
503 ,p_cei_information_category
504 => p_rec.cei_information_category
505 ,p_cei_information1
506 => p_rec.cei_information1
507 ,p_cei_information2
508 => p_rec.cei_information2
509 ,p_cei_information3
510 => p_rec.cei_information3
511 ,p_cei_information4
512 => p_rec.cei_information4
513 ,p_cei_information5
514 => p_rec.cei_information5
515 ,p_cei_information6
516 => p_rec.cei_information6
517 ,p_cei_information7
518 => p_rec.cei_information7
519 ,p_cei_information8
520 => p_rec.cei_information8
521 ,p_cei_information9
522 => p_rec.cei_information9
523 ,p_cei_information10
524 => p_rec.cei_information10
525 ,p_cei_information11
526 => p_rec.cei_information11
527 ,p_cei_information12
528 => p_rec.cei_information12
529 ,p_cei_information13
530 => p_rec.cei_information13
531 ,p_cei_information14
532 => p_rec.cei_information14
533 ,p_cei_information15
534 => p_rec.cei_information15
535 ,p_cei_information16
536 => p_rec.cei_information16
537 ,p_cei_information17
538 => p_rec.cei_information17
539 ,p_cei_information18
540 => p_rec.cei_information18
541 ,p_cei_information19
542 => p_rec.cei_information19
543 ,p_cei_information20
544 => p_rec.cei_information20
545 ,p_cei_information21
546 => p_rec.cei_information21
547 ,p_cei_information22
548 => p_rec.cei_information22
549 ,p_cei_information23
550 => p_rec.cei_information23
551 ,p_cei_information24
552 => p_rec.cei_information24
553 ,p_cei_information25
554 => p_rec.cei_information25
555 ,p_cei_information26
556 => p_rec.cei_information26
557 ,p_cei_information27
558 => p_rec.cei_information27
559 ,p_cei_information28
560 => p_rec.cei_information28
561 ,p_cei_information29
562 => p_rec.cei_information29
563 ,p_cei_information30
564 => p_rec.cei_information30
565 ,p_cei_attribute_category
566 => p_rec.cei_attribute_category
567 ,p_cei_attribute1
568 => p_rec.cei_attribute1
569 ,p_cei_attribute2
570 => p_rec.cei_attribute2
571 ,p_cei_attribute3
572 => p_rec.cei_attribute3
573 ,p_cei_attribute4
574 => p_rec.cei_attribute4
575 ,p_cei_attribute5
576 => p_rec.cei_attribute5
577 ,p_cei_attribute6
578 => p_rec.cei_attribute6
579 ,p_cei_attribute7
580 => p_rec.cei_attribute7
581 ,p_cei_attribute8
582 => p_rec.cei_attribute8
583 ,p_cei_attribute9
584 => p_rec.cei_attribute9
585 ,p_cei_attribute10
586 => p_rec.cei_attribute10
587 ,p_cei_attribute11
588 => p_rec.cei_attribute11
589 ,p_cei_attribute12
590 => p_rec.cei_attribute12
591 ,p_cei_attribute13
592 => p_rec.cei_attribute13
593 ,p_cei_attribute14
594 => p_rec.cei_attribute14
595 ,p_cei_attribute15
596 => p_rec.cei_attribute15
597 ,p_cei_attribute16
598 => p_rec.cei_attribute16
599 ,p_cei_attribute17
600 => p_rec.cei_attribute17
601 ,p_cei_attribute18
602 => p_rec.cei_attribute18
603 ,p_cei_attribute19
604 => p_rec.cei_attribute19
605 ,p_cei_attribute20
606 => p_rec.cei_attribute20
607 ,p_object_version_number
608 => p_rec.object_version_number
609 ,p_request_id
610 => p_rec.request_id
611 ,p_program_application_id
612 => p_rec.program_application_id
613 ,p_program_id
614 => p_rec.program_id
615 ,p_program_update_date
616 => p_rec.program_update_date
617 );
618 --
619 exception
620 --
621 when hr_api.cannot_find_prog_unit then
622 --
623 hr_api.cannot_find_prog_unit_error
624 (p_module_name => 'PER_CONTACT_EXTRA_INFO_F'
625 ,p_hook_type => 'AI');
626 --
627 end;
628 --
629 hr_utility.set_location(' Leaving:'||l_proc, 10);
630 End post_insert;
631 --
632 -- ----------------------------------------------------------------------------
633 -- |-------------------------------< ins_lck >--------------------------------|
634 -- ----------------------------------------------------------------------------
635 -- {Start Of Comments}
636 --
637 -- Description:
638 -- The ins_lck process has one main function to perform. When inserting
639 -- a datetracked row, we must validate the DT mode.
640 --
641 -- Prerequisites:
642 -- This procedure can only be called for the datetrack mode of INSERT.
643 --
644 -- In Parameters:
645 --
646 -- Post Success:
647 -- On successful completion of the ins_lck process the parental
648 -- datetracked rows will be locked providing the p_enforce_foreign_locking
649 -- argument value is TRUE.
650 -- If the p_enforce_foreign_locking argument value is FALSE then the
651 -- parential rows are not locked.
652 --
653 -- Post Failure:
654 -- The Lck process can fail for:
655 -- 1) When attempting to lock the row the row could already be locked by
656 -- another user. This will raise the HR_Api.Object_Locked exception.
657 -- 2) When attempting to the lock the parent which doesn't exist.
658 -- For the entity to be locked the parent must exist!
659 --
660 -- Developer Implementation Notes:
661 -- None.
662 --
663 -- Access Status:
664 -- Internal Row Handler Use Only.
665 --
666 -- {End Of Comments}
667 -- ----------------------------------------------------------------------------
668 Procedure ins_lck
669 (p_effective_date in date
670 ,p_datetrack_mode in varchar2
671 ,p_rec in per_rei_shd.g_rec_type
672 ,p_validation_start_date out nocopy date
673 ,p_validation_end_date out nocopy date
674 ) is
675 --
676 l_proc varchar2(72) := g_package||'ins_lck';
677 l_validation_start_date date;
678 l_validation_end_date date;
679 l_person_id number;
680 --
681 Begin
682 hr_utility.set_location('Entering:'||l_proc, 5);
683 --
684 select person_id
685 into l_person_id
686 from per_contact_relationships
687 where contact_relationship_id = p_rec.contact_relationship_id;
688 --
689 -- Validate the datetrack mode getting the validation start
690 -- and end dates for the specified datetrack operation.
691 --
692 dt_api.validate_dt_mode
693 (p_effective_date => p_effective_date
694 ,p_datetrack_mode => p_datetrack_mode
695 ,p_base_table_name => 'per_contact_extra_info_f'
696 ,p_base_key_column => 'contact_extra_info_id'
697 ,p_base_key_value => p_rec.contact_extra_info_id
698 ,p_parent_table_name1 => 'per_all_people_f'
699 ,p_parent_key_column1 => 'person_id'
700 ,p_parent_key_value1 => l_person_id
701 ,p_enforce_foreign_locking => true
702 ,p_validation_start_date => l_validation_start_date
703 ,p_validation_end_date => l_validation_end_date
704 );
705 --
706 -- Set the validation start and end date OUT arguments
707 --
708 p_validation_start_date := l_validation_start_date;
709 p_validation_end_date := l_validation_end_date;
710 --
711 hr_utility.set_location(' Leaving:'||l_proc, 10);
712 --
713 End ins_lck;
714 --
715 -- ----------------------------------------------------------------------------
716 -- |---------------------------------< ins >----------------------------------|
717 -- ----------------------------------------------------------------------------
718 Procedure ins
719 (p_effective_date in date
720 ,p_rec in out nocopy per_rei_shd.g_rec_type
721 ) is
722 --
723 l_proc varchar2(72) := g_package||'ins';
724 l_datetrack_mode varchar2(30) := hr_api.g_insert;
725 l_validation_start_date date;
726 l_validation_end_date date;
727 --
728 Begin
729 hr_utility.set_location('Entering:'||l_proc, 5);
730 --
731 -- Call the lock operation
732 --
733 per_rei_ins.ins_lck
734 (p_effective_date => p_effective_date
735 ,p_datetrack_mode => l_datetrack_mode
736 ,p_rec => p_rec
737 ,p_validation_start_date => l_validation_start_date
738 ,p_validation_end_date => l_validation_end_date
739 );
740 --
741 -- Call the supporting insert validate operations
742 --
743 per_rei_bus.insert_validate
744 (p_rec => p_rec
745 ,p_effective_date => p_effective_date
746 ,p_datetrack_mode => l_datetrack_mode
747 ,p_validation_start_date => l_validation_start_date
748 ,p_validation_end_date => l_validation_end_date
749 );
750 --
751 -- Call to raise any errors on multi-message list
752 hr_multi_message.end_validation_set;
753 --
754 -- Call the supporting pre-insert operation
755 --
756 per_rei_ins.pre_insert
757 (p_rec => p_rec
758 ,p_effective_date => p_effective_date
759 ,p_datetrack_mode => l_datetrack_mode
760 ,p_validation_start_date => l_validation_start_date
761 ,p_validation_end_date => l_validation_end_date
762 );
763 --
764 -- Insert the row
765 --
766 per_rei_ins.insert_dml
767 (p_rec => p_rec
768 ,p_effective_date => p_effective_date
769 ,p_datetrack_mode => l_datetrack_mode
770 ,p_validation_start_date => l_validation_start_date
771 ,p_validation_end_date => l_validation_end_date
772 );
773 --
774 -- Call the supporting post-insert operation
775 --
776 per_rei_ins.post_insert
777 (p_rec => p_rec
778 ,p_effective_date => p_effective_date
779 ,p_datetrack_mode => l_datetrack_mode
780 ,p_validation_start_date => l_validation_start_date
781 ,p_validation_end_date => l_validation_end_date
782 );
783 --
784 -- Call to raise any errors on multi-message list
785 hr_multi_message.end_validation_set;
786 --
787 hr_utility.set_location(' Leaving:'||l_proc,10);
788 end ins;
789 --
790 -- ----------------------------------------------------------------------------
791 -- |---------------------------------< ins >----------------------------------|
792 -- ----------------------------------------------------------------------------
793 Procedure ins
794 (p_effective_date in date
795 ,p_contact_relationship_id in number
796 ,p_information_type in varchar2
797 ,p_cei_information_category in varchar2 default null
798 ,p_cei_information1 in varchar2 default null
799 ,p_cei_information2 in varchar2 default null
800 ,p_cei_information3 in varchar2 default null
801 ,p_cei_information4 in varchar2 default null
802 ,p_cei_information5 in varchar2 default null
803 ,p_cei_information6 in varchar2 default null
804 ,p_cei_information7 in varchar2 default null
805 ,p_cei_information8 in varchar2 default null
806 ,p_cei_information9 in varchar2 default null
807 ,p_cei_information10 in varchar2 default null
808 ,p_cei_information11 in varchar2 default null
809 ,p_cei_information12 in varchar2 default null
810 ,p_cei_information13 in varchar2 default null
811 ,p_cei_information14 in varchar2 default null
812 ,p_cei_information15 in varchar2 default null
813 ,p_cei_information16 in varchar2 default null
814 ,p_cei_information17 in varchar2 default null
815 ,p_cei_information18 in varchar2 default null
816 ,p_cei_information19 in varchar2 default null
817 ,p_cei_information20 in varchar2 default null
818 ,p_cei_information21 in varchar2 default null
819 ,p_cei_information22 in varchar2 default null
820 ,p_cei_information23 in varchar2 default null
821 ,p_cei_information24 in varchar2 default null
822 ,p_cei_information25 in varchar2 default null
823 ,p_cei_information26 in varchar2 default null
824 ,p_cei_information27 in varchar2 default null
825 ,p_cei_information28 in varchar2 default null
826 ,p_cei_information29 in varchar2 default null
827 ,p_cei_information30 in varchar2 default null
828 ,p_cei_attribute_category in varchar2 default null
829 ,p_cei_attribute1 in varchar2 default null
830 ,p_cei_attribute2 in varchar2 default null
831 ,p_cei_attribute3 in varchar2 default null
832 ,p_cei_attribute4 in varchar2 default null
833 ,p_cei_attribute5 in varchar2 default null
834 ,p_cei_attribute6 in varchar2 default null
835 ,p_cei_attribute7 in varchar2 default null
836 ,p_cei_attribute8 in varchar2 default null
837 ,p_cei_attribute9 in varchar2 default null
838 ,p_cei_attribute10 in varchar2 default null
839 ,p_cei_attribute11 in varchar2 default null
840 ,p_cei_attribute12 in varchar2 default null
841 ,p_cei_attribute13 in varchar2 default null
842 ,p_cei_attribute14 in varchar2 default null
843 ,p_cei_attribute15 in varchar2 default null
844 ,p_cei_attribute16 in varchar2 default null
845 ,p_cei_attribute17 in varchar2 default null
846 ,p_cei_attribute18 in varchar2 default null
847 ,p_cei_attribute19 in varchar2 default null
848 ,p_cei_attribute20 in varchar2 default null
849 ,p_request_id in number default null
850 ,p_program_application_id in number default null
851 ,p_program_id in number default null
852 ,p_program_update_date in date default null
853 ,p_contact_extra_info_id out nocopy number
854 ,p_object_version_number out nocopy number
855 ,p_effective_start_date out nocopy date
856 ,p_effective_end_date out nocopy date
857 ) is
858 --
859 l_rec per_rei_shd.g_rec_type;
860 l_proc varchar2(72) := g_package||'ins';
861 --
862 Begin
863 hr_utility.set_location('Entering:'||l_proc, 5);
864 --
865 -- Call conversion function to turn arguments into the
866 -- p_rec structure.
867 --
868 l_rec :=
869 per_rei_shd.convert_args
870 (null
871 ,null
872 ,null
873 ,p_contact_relationship_id
874 ,p_information_type
875 ,p_cei_information_category
876 ,p_cei_information1
877 ,p_cei_information2
878 ,p_cei_information3
879 ,p_cei_information4
880 ,p_cei_information5
881 ,p_cei_information6
882 ,p_cei_information7
883 ,p_cei_information8
884 ,p_cei_information9
885 ,p_cei_information10
886 ,p_cei_information11
887 ,p_cei_information12
888 ,p_cei_information13
889 ,p_cei_information14
890 ,p_cei_information15
891 ,p_cei_information16
892 ,p_cei_information17
893 ,p_cei_information18
894 ,p_cei_information19
895 ,p_cei_information20
896 ,p_cei_information21
897 ,p_cei_information22
898 ,p_cei_information23
899 ,p_cei_information24
900 ,p_cei_information25
901 ,p_cei_information26
902 ,p_cei_information27
903 ,p_cei_information28
904 ,p_cei_information29
905 ,p_cei_information30
906 ,p_cei_attribute_category
907 ,p_cei_attribute1
908 ,p_cei_attribute2
909 ,p_cei_attribute3
910 ,p_cei_attribute4
911 ,p_cei_attribute5
912 ,p_cei_attribute6
913 ,p_cei_attribute7
914 ,p_cei_attribute8
915 ,p_cei_attribute9
916 ,p_cei_attribute10
917 ,p_cei_attribute11
918 ,p_cei_attribute12
919 ,p_cei_attribute13
920 ,p_cei_attribute14
921 ,p_cei_attribute15
922 ,p_cei_attribute16
923 ,p_cei_attribute17
924 ,p_cei_attribute18
925 ,p_cei_attribute19
926 ,p_cei_attribute20
927 ,null
928 ,p_request_id
929 ,p_program_application_id
930 ,p_program_id
931 ,p_program_update_date
932 );
933 --
934 -- Having converted the arguments into the per_rei_rec
935 -- plsql record structure we call the corresponding record
936 -- business process.
937 --
938 per_rei_ins.ins
939 (p_effective_date
940 ,l_rec
941 );
942 --
943 -- Set the OUT arguments.
944 --
945 p_contact_extra_info_id := l_rec.contact_extra_info_id;
946 p_effective_start_date := l_rec.effective_start_date;
947 p_effective_end_date := l_rec.effective_end_date;
948 p_object_version_number := l_rec.object_version_number;
949 --
950 --
951 hr_utility.set_location(' Leaving:'||l_proc, 10);
952 End ins;
953 --
954 end per_rei_ins;