DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_CTR_INS

Source


4 -- ----------------------------------------------------------------------------
1 Package Body per_ctr_ins as
2 /* $Header: pectrrhi.pkb 120.5.12020000.3 2013/02/04 11:16:16 srannama ship $ */
3 --
8 g_package  varchar2(33) := '  per_ctr_ins.';  -- Global package name
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
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_relationship_id  number default null;
14 --
15 -- ----------------------------------------------------------------------------
16 -- |------------------------< set_base_key_value >----------------------------|
17 -- ----------------------------------------------------------------------------
18 procedure set_base_key_value (p_contact_relationship_id  in  number) is
19     --
20     l_proc       varchar2(72) := g_package||'set_base_key_value';
21     --
22 Begin
23   hr_utility.set_location('Entering:'||l_proc, 10);
24   --
25   per_ctr_ins.g_contact_relationship_id := p_contact_relationship_id;
26   --
27   hr_utility.set_location(' Leaving:'||l_proc, 20);
28 End set_base_key_value;
29 
30 --
31 -- ----------------------------------------------------------------------------
32 -- |------------------------------< insert_dml >------------------------------|
33 -- ----------------------------------------------------------------------------
34 -- {Start Of Comments}
35 --
36 -- Description:
37 --   This procedure controls the actual dml insert logic. The processing of
38 --   this procedure are as follows:
39 --   1) Initialise the object_version_number to 1 if the object_version_number
40 --      is defined as an attribute for this entity.
41 --   2) To set and unset the g_api_dml status as required (as we are about to
42 --      perform dml).
43 --   3) To insert the row into the schema.
44 --   4) To trap any constraint violations that may have occurred.
45 --   5) To raise any other errors.
46 --
47 -- Pre Conditions:
48 --   This is an internal private procedure which must be called from the ins
49 --   procedure and must have all mandatory attributes set (except the
50 --   object_version_number which is initialised within this procedure).
51 --
52 -- In Parameters:
53 --   A Pl/Sql record structre.
54 --
55 -- Post Success:
56 --   The specified row will be inserted into the schema.
57 --
58 -- Post Failure:
59 --   On the insert dml failure it is important to note that we always reset the
60 --   g_api_dml status to false.
61 --   If a check, unique or parent integrity constraint violation is raised the
62 --   constraint_error procedure will be called.
63 --   If any other error is reported, the error will be raised after the
64 --   g_api_dml status is reset.
65 --
66 -- Developer Implementation Notes:
67 --   None.
68 --
69 -- Access Status:
70 --   Internal Table Handler Use Only.
71 --
72 -- {End Of Comments}
73 -- ----------------------------------------------------------------------------
74 Procedure insert_dml(p_rec in out nocopy per_ctr_shd.g_rec_type) is
75 --
76   l_proc  varchar2(72) := g_package||'insert_dml';
77 --
78 Begin
79   hr_utility.set_location('Entering:'||l_proc, 5);
80   p_rec.object_version_number := 1;  -- Initialise the object version
81   --
82   per_ctr_shd.g_api_dml := true;  -- Set the api dml status
83   --
84   -- Insert the row into: per_contact_relationships
85   --
86   insert into per_contact_relationships
87   (   contact_relationship_id,
88    business_group_id,
89    person_id,
90    contact_person_id,
91    contact_type,
92    comments,
93    primary_contact_flag,
94    request_id,
95    program_application_id,
96    program_id,
97    program_update_date,
98         date_start,
99         start_life_reason_id,
100         date_end,
101         end_life_reason_id,
102         rltd_per_rsds_w_dsgntr_flag,
103         personal_flag,
104    sequence_number,
105         cont_attribute_category,
106    cont_attribute1,
107    cont_attribute2,
108    cont_attribute3,
109    cont_attribute4,
110    cont_attribute5,
111    cont_attribute6,
112    cont_attribute7,
113    cont_attribute8,
114    cont_attribute9,
115    cont_attribute10,
116    cont_attribute11,
117    cont_attribute12,
118    cont_attribute13,
119    cont_attribute14,
120    cont_attribute15,
121    cont_attribute16,
122    cont_attribute17,
123    cont_attribute18,
124    cont_attribute19,
125    cont_attribute20,
126         cont_information_category,
127    cont_information1,
128    cont_information2,
129    cont_information3,
130    cont_information4,
131    cont_information5,
132    cont_information6,
133    cont_information7,
134    cont_information8,
135    cont_information9,
136    cont_information10,
137    cont_information11,
138    cont_information12,
139    cont_information13,
140    cont_information14,
141    cont_information15,
142    cont_information16,
143    cont_information17,
144    cont_information18,
145    cont_information19,
146    cont_information20,
147    third_party_pay_flag,
148    bondholder_flag,
149         dependent_flag,
150         beneficiary_flag,
151    object_version_number
152   )
153   Values
154   (   p_rec.contact_relationship_id,
155    p_rec.business_group_id,
156    p_rec.person_id,
160    p_rec.primary_contact_flag,
157    p_rec.contact_person_id,
158    p_rec.contact_type,
159    p_rec.comments,
161    p_rec.request_id,
162    p_rec.program_application_id,
163    p_rec.program_id,
164    p_rec.program_update_date,
165         p_rec.date_start,
166         p_rec.start_life_reason_id,
167         p_rec.date_end,
168         p_rec.end_life_reason_id,
169         p_rec.rltd_per_rsds_w_dsgntr_flag,
170         p_rec.personal_flag,
171    p_rec.sequence_number,
172    p_rec.cont_attribute_category,
173    p_rec.cont_attribute1,
174    p_rec.cont_attribute2,
175    p_rec.cont_attribute3,
176    p_rec.cont_attribute4,
177    p_rec.cont_attribute5,
178    p_rec.cont_attribute6,
179    p_rec.cont_attribute7,
180    p_rec.cont_attribute8,
181    p_rec.cont_attribute9,
182    p_rec.cont_attribute10,
183    p_rec.cont_attribute11,
184    p_rec.cont_attribute12,
185    p_rec.cont_attribute13,
186    p_rec.cont_attribute14,
187    p_rec.cont_attribute15,
188    p_rec.cont_attribute16,
189    p_rec.cont_attribute17,
190    p_rec.cont_attribute18,
191    p_rec.cont_attribute19,
192    p_rec.cont_attribute20,
193    p_rec.cont_information_category,
194    p_rec.cont_information1,
195    p_rec.cont_information2,
196    p_rec.cont_information3,
197    p_rec.cont_information4,
198    p_rec.cont_information5,
199    p_rec.cont_information6,
200    p_rec.cont_information7,
201    p_rec.cont_information8,
202    p_rec.cont_information9,
203    p_rec.cont_information10,
204    p_rec.cont_information11,
205    p_rec.cont_information12,
206    p_rec.cont_information13,
207    p_rec.cont_information14,
208    p_rec.cont_information15,
209    p_rec.cont_information16,
210    p_rec.cont_information17,
211    p_rec.cont_information18,
212    p_rec.cont_information19,
213    p_rec.cont_information20,
214    p_rec.third_party_pay_flag,
215    p_rec.bondholder_flag,
216         p_rec.dependent_flag,
217         p_rec.beneficiary_flag,
218    p_rec.object_version_number
219   );
220   --
221   per_ctr_shd.g_api_dml := false;   -- Unset the api dml status
222   --
223   hr_utility.set_location(' Leaving:'||l_proc, 10);
224 Exception
225   When hr_api.check_integrity_violated Then
226     -- A check constraint has been violated
227     per_ctr_shd.g_api_dml := false;   -- Unset the api dml status
228     per_ctr_shd.constraint_error
229       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
230   When hr_api.parent_integrity_violated Then
231     -- Parent integrity has been violated
232     per_ctr_shd.g_api_dml := false;   -- Unset the api dml status
233     per_ctr_shd.constraint_error
234       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
235   When hr_api.unique_integrity_violated Then
236     -- Unique integrity has been violated
237     per_ctr_shd.g_api_dml := false;   -- Unset the api dml status
238     per_ctr_shd.constraint_error
239       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
240   When Others Then
241     per_ctr_shd.g_api_dml := false;   -- Unset the api dml status
242     Raise;
243 End insert_dml;
244 --
245 -- ----------------------------------------------------------------------------
246 -- |------------------------------< pre_insert >------------------------------|
247 -- ----------------------------------------------------------------------------
248 -- {Start Of Comments}
249 --
250 -- Description:
251 --   This private procedure contains any processing which is required before
252 --   the insert dml. Presently, if the entity has a corresponding primary
253 --   key which is maintained by an associating sequence, the primary key for
254 --   the entity will be populated with the next sequence value in
255 --   preparation for the insert dml.
256 --
257 -- Pre Conditions:
258 --   This is an internal procedure which is called from the ins procedure.
259 --
260 -- In Parameters:
261 --   A Pl/Sql record structre.
262 --
263 -- Post Success:
264 --   Processing continues.
265 --
266 -- Post Failure:
267 --   If an error has occurred, an error message and exception will be raised
268 --   but not handled.
269 --
270 -- Developer Implementation Notes:
271 --   Any pre-processing required before the insert dml is issued should be
272 --   coded within this procedure. As stated above, a good example is the
273 --   generation of a primary key number via a corresponding sequence.
274 --   It is important to note that any 3rd party maintenance should be reviewed
275 --   before placing in this procedure.
276 --
277 -- Access Status:
278 --   Internal Table Handler Use Only.
279 --
280 -- {End Of Comments}
281 -- ----------------------------------------------------------------------------
282 Procedure pre_insert(p_rec  in out nocopy per_ctr_shd.g_rec_type) is
283     --
284     l_proc  varchar2(72) := g_package||'pre_insert';
285     --
286     Cursor C_Sel1 is select per_contact_relationships_s.nextval from sys.dual;
287     --
288     Cursor C_Sel2 is
289     select null
290     from   per_contact_relationships
291     where  contact_relationship_id = per_ctr_ins.g_contact_relationship_id;
292     --
293     l_exists varchar2(1);
294 --
295 Begin
296   hr_utility.set_location('Entering:'||l_proc, 5);
297   --
298   --
299   -- Select the next sequence number
300   --
301   if per_ctr_ins.g_contact_relationship_id is not null then
302     --
303     -- Verify registered primary key values not already in use
307     --
304     --
305     Open  C_Sel2;
306     Fetch C_Sel2 into l_exists;
308     If C_Sel2%found then
309         close C_Sel2;
310         --
311         -- The primary key values are already in use.
312         --
313         fnd_message.set_name('PER','PER_289391_KEY_ALREADY_USED');
314         fnd_message.set_token('TABLE_NAME','per_contact_relationships');
315         fnd_message.raise_error;
316     end if;
317     close c_sel2;
318     --
319     -- Use registered key values and clear globals
320     --
321     p_rec.contact_relationship_id := per_ctr_ins.g_contact_relationship_id;
322     per_ctr_ins.g_contact_relationship_id := null;
323     --
324     else
325         Open C_Sel1;
326         Fetch C_Sel1 Into p_rec.contact_relationship_id;
327         Close C_Sel1;
328     end if;
329     --
330     hr_utility.set_location(' Leaving:'||l_proc, 10);
331 End pre_insert;
332 --
333 -- ----------------------------------------------------------------------------
334 -- |-----------------------------< post_insert >------------------------------|
335 -- ----------------------------------------------------------------------------
336 -- {Start Of Comments}
337 --
338 -- Description:
339 --   This private procedure contains any processing which is required after the
340 --   insert dml.
341 --
342 -- Pre Conditions:
343 --   This is an internal procedure which is called from the ins procedure.
344 --
345 -- In Parameters:
346 --   A Pl/Sql record structre.
347 --
348 -- Post Success:
349 --   Processing continues.
350 --
351 -- Post Failure:
352 --   If an error has occurred, an error message and exception will be raised
353 --   but not handled.
354 --
355 -- Developer Implementation Notes:
356 --   Any post-processing required after the insert dml is issued should be
357 --   coded within this procedure. It is important to note that any 3rd party
358 --   maintenance should be reviewed before placing in this procedure.
359 --
360 -- Access Status:
361 --   Internal Table Handler Use Only.
362 --
363 -- {End Of Comments}
364 -- ----------------------------------------------------------------------------
365 Procedure post_insert(p_rec            in per_ctr_shd.g_rec_type,
366                       p_effective_date in date) is
367 --
368   l_proc  varchar2(72) := g_package||'post_insert';
369   --
370   -- Start of Fix for WWBUG 1408379
371   --
372   l_old ben_con_ler.g_con_ler_rec;
373   l_new ben_con_ler.g_con_ler_rec;
374   --
375   -- End of Fix for WWBUG 1408379
376   --
377 --
378 Begin
379   hr_utility.set_location('Entering:'||l_proc, 5);
380   --
381   -- Start of API User Hook for post_insert.
382   begin
383     per_ctr_rki.after_insert
384       (p_contact_relationship_id        => p_rec.contact_relationship_id
385       ,p_business_group_id              => p_rec.business_group_id
386       ,p_person_id                      => p_rec.person_id
387       ,p_contact_person_id              => p_rec.contact_person_id
388       ,p_contact_type                   => p_rec.contact_type
389       ,p_comments                       => p_rec.comments
390       ,p_primary_contact_flag           => p_rec.primary_contact_flag
391       ,p_request_id                     => p_rec.request_id
392       ,p_program_application_id         => p_rec.program_application_id
393       ,p_program_id                     => p_rec.program_id
394       ,p_program_update_date            => p_rec.program_update_date
395       ,p_date_start                     => p_rec.date_start
396       ,p_start_life_reason_id           => p_rec.start_life_reason_id
397       ,p_date_end                       => p_rec.date_end
398       ,p_end_life_reason_id             => p_rec.end_life_reason_id
399       ,p_rltd_per_rsds_w_dsgntr_flag    => p_rec.rltd_per_rsds_w_dsgntr_flag
400       ,p_personal_flag                  => p_rec.personal_flag
401       ,p_sequence_number                => p_rec.sequence_number
402       ,p_cont_attribute_category        => p_rec.cont_attribute_category
403       ,p_cont_attribute1                => p_rec.cont_attribute1
404       ,p_cont_attribute2                => p_rec.cont_attribute2
405       ,p_cont_attribute3                => p_rec.cont_attribute3
406       ,p_cont_attribute4                => p_rec.cont_attribute4
407       ,p_cont_attribute5                => p_rec.cont_attribute5
408       ,p_cont_attribute6                => p_rec.cont_attribute6
409       ,p_cont_attribute7                => p_rec.cont_attribute7
410       ,p_cont_attribute8                => p_rec.cont_attribute8
411       ,p_cont_attribute9                => p_rec.cont_attribute9
412       ,p_cont_attribute10               => p_rec.cont_attribute10
413       ,p_cont_attribute11               => p_rec.cont_attribute11
414       ,p_cont_attribute12               => p_rec.cont_attribute12
415       ,p_cont_attribute13               => p_rec.cont_attribute13
416       ,p_cont_attribute14               => p_rec.cont_attribute14
417       ,p_cont_attribute15               => p_rec.cont_attribute15
418       ,p_cont_attribute16               => p_rec.cont_attribute16
419       ,p_cont_attribute17               => p_rec.cont_attribute17
420       ,p_cont_attribute18               => p_rec.cont_attribute18
421       ,p_cont_attribute19               => p_rec.cont_attribute19
422       ,p_cont_attribute20               => p_rec.cont_attribute20
423       ,p_cont_information_category        => p_rec.cont_information_category
424       ,p_cont_information1                => p_rec.cont_information1
425       ,p_cont_information2                => p_rec.cont_information2
426       ,p_cont_information3                => p_rec.cont_information3
430       ,p_cont_information7                => p_rec.cont_information7
427       ,p_cont_information4                => p_rec.cont_information4
428       ,p_cont_information5                => p_rec.cont_information5
429       ,p_cont_information6                => p_rec.cont_information6
431       ,p_cont_information8                => p_rec.cont_information8
432       ,p_cont_information9                => p_rec.cont_information9
433       ,p_cont_information10               => p_rec.cont_information10
434       ,p_cont_information11               => p_rec.cont_information11
435       ,p_cont_information12               => p_rec.cont_information12
436       ,p_cont_information13               => p_rec.cont_information13
437       ,p_cont_information14               => p_rec.cont_information14
438       ,p_cont_information15               => p_rec.cont_information15
439       ,p_cont_information16               => p_rec.cont_information16
440       ,p_cont_information17               => p_rec.cont_information17
441       ,p_cont_information18               => p_rec.cont_information18
442       ,p_cont_information19               => p_rec.cont_information19
443       ,p_cont_information20               => p_rec.cont_information20
444       ,p_third_party_pay_flag           => p_rec.third_party_pay_flag
445       ,p_bondholder_flag                => p_rec.bondholder_flag
446       ,p_dependent_flag                 => p_rec.dependent_flag
447       ,p_beneficiary_flag               => p_rec.beneficiary_flag
448       ,p_object_version_number          => p_rec.object_version_number
449       ,p_effective_date                 => p_effective_date
450       );
451   exception
452     when hr_api.cannot_find_prog_unit then
453       hr_api.cannot_find_prog_unit_error
454         (p_module_name => 'PER_CONTACT_RELATIONSHIPS'
455         ,p_hook_type   => 'AI'
456         );
457   end;
458   --
459   -- Start of Fix for 1408379
460   --
461   l_new.person_id := p_rec.person_id;
462   l_new.contact_person_id := p_rec.contact_person_id;
463   l_new.business_group_id := p_rec.business_group_id;
464   l_new.date_start := p_rec.date_start;
465   l_new.date_end := p_rec.date_end;
466   l_new.contact_type := p_rec.contact_type;
467   l_new.personal_flag := p_rec.personal_flag;
468   l_new.start_life_reason_id := p_rec.start_life_reason_id;
469   l_new.end_life_reason_id := p_rec.end_life_reason_id;
470   l_new.rltd_per_rsds_w_dsgntr_flag := p_rec.rltd_per_rsds_w_dsgntr_flag;
471   l_new.contact_relationship_id := p_rec.contact_relationship_id;
472   --
473   -- Bug 16240344
474   l_new.cont_attribute1  := p_rec.cont_attribute1;
475   l_new.cont_attribute2  := p_rec.cont_attribute2;
476   l_new.cont_attribute3  := p_rec.cont_attribute3;
477   l_new.cont_attribute4  := p_rec.cont_attribute4;
478   l_new.cont_attribute5  := p_rec.cont_attribute5;
479   l_new.cont_attribute6  := p_rec.cont_attribute6;
480   l_new.cont_attribute7  := p_rec.cont_attribute7;
481   l_new.cont_attribute8  := p_rec.cont_attribute8;
482   l_new.cont_attribute9  := p_rec.cont_attribute9;
483   l_new.cont_attribute10 := p_rec.cont_attribute10;
484   l_new.cont_attribute11 := p_rec.cont_attribute11;
485   l_new.cont_attribute12 := p_rec.cont_attribute12;
486   l_new.cont_attribute13 := p_rec.cont_attribute13;
487   l_new.cont_attribute14 := p_rec.cont_attribute14;
488   l_new.cont_attribute15 := p_rec.cont_attribute15;
489   l_new.cont_attribute16 := p_rec.cont_attribute16;
490   l_new.cont_attribute17 := p_rec.cont_attribute17;
491   l_new.cont_attribute18 := p_rec.cont_attribute18;
492   l_new.cont_attribute19 := p_rec.cont_attribute19;
493   l_new.cont_attribute20 := p_rec.cont_attribute20;
494   -- Bug 16240344
495 
496   ben_con_ler.ler_chk(p_old            => l_old,
497                       p_new            => l_new,
498                       p_effective_date => p_effective_date);
499   --
500   -- End of Fix for 1408379
501   --
502   --
503   -- End of API User Hook for post_insert.
504   --
505   hr_utility.set_location(' Leaving:'||l_proc, 10);
506 End post_insert;
507 --
508 -- ----------------------------------------------------------------------------
509 -- |---------------------------------< ins >----------------------------------|
510 -- ----------------------------------------------------------------------------
511 Procedure ins
512   (
513   p_rec            in out nocopy per_ctr_shd.g_rec_type,
514   p_effective_date in date,
515   p_validate       in     boolean default false
516   ) is
517 --
518   l_proc  varchar2(72) := g_package||'ins';
519 --
520 Begin
521   hr_utility.set_location('Entering:'||l_proc, 5);
522   --
523   -- Determine if the business process is to be validated.
524   --
525   If p_validate then
526     --
527     -- Issue the savepoint.
528     --
529     SAVEPOINT ins_per_ctr;
530   End If;
531   --
532   -- Call the supporting insert validate operations
533   --
534   per_ctr_bus.insert_validate(p_rec
535                              ,p_effective_date);
536   --
537   -- Call the supporting pre-insert operation
538   --
539   pre_insert(p_rec);
540   --
541   -- Insert the row
542   --
543   insert_dml(p_rec);
544   --
545   -- Call the supporting post-insert operation
546   --
547   post_insert(p_rec
548              ,p_effective_date);
549   --
550   -- If we are validating then raise the Validate_Enabled exception
551   --
552   If p_validate then
553     Raise HR_Api.Validate_Enabled;
554   End If;
555   --
556   hr_utility.set_location(' Leaving:'||l_proc, 10);
557 Exception
558   When HR_Api.Validate_Enabled Then
559     --
563     ROLLBACK TO ins_per_ctr;
560     -- As the Validate_Enabled exception has been raised
561     -- we must rollback to the savepoint
562     --
564 end ins;
565 --
566 -- ----------------------------------------------------------------------------
567 -- |---------------------------------< ins >----------------------------------|
568 -- ----------------------------------------------------------------------------
569 Procedure ins
570   (p_contact_relationship_id     out nocopy number,
571   p_business_group_id            in number,
572   p_person_id                    in number,
573   p_contact_person_id            in number,
574   p_contact_type                 in varchar2,
575   p_comments                     in clob             default null,	-- Bug#13362792
576   p_primary_contact_flag         in varchar2         default 'N',
577   p_request_id                   in number           default null,
578   p_program_application_id       in number           default null,
579   p_program_id                   in number           default null,
580   p_program_update_date          in date             default null,
581   p_date_start                   in date             default null,
582   p_start_life_reason_id         in number           default null,
583   p_date_end                     in date             default null,
584   p_end_life_reason_id           in number           default null,
585   p_rltd_per_rsds_w_dsgntr_flag  in varchar2         default 'N',
586   p_personal_flag                in varchar2         default 'N',
587   p_sequence_number              in number           default null,
588   p_cont_attribute_category      in varchar2         default null,
589   p_cont_attribute1              in varchar2         default null,
590   p_cont_attribute2              in varchar2         default null,
591   p_cont_attribute3              in varchar2         default null,
592   p_cont_attribute4              in varchar2         default null,
593   p_cont_attribute5              in varchar2         default null,
594   p_cont_attribute6              in varchar2         default null,
595   p_cont_attribute7              in varchar2         default null,
596   p_cont_attribute8              in varchar2         default null,
597   p_cont_attribute9              in varchar2         default null,
598   p_cont_attribute10             in varchar2         default null,
599   p_cont_attribute11             in varchar2         default null,
600   p_cont_attribute12             in varchar2         default null,
601   p_cont_attribute13             in varchar2         default null,
602   p_cont_attribute14             in varchar2         default null,
603   p_cont_attribute15             in varchar2         default null,
604   p_cont_attribute16             in varchar2         default null,
605   p_cont_attribute17             in varchar2         default null,
606   p_cont_attribute18             in varchar2         default null,
607   p_cont_attribute19             in varchar2         default null,
608   p_cont_attribute20             in varchar2         default null,
609   p_cont_information_category      in varchar2         default null,
610   p_cont_information1              in varchar2         default null,
611   p_cont_information2              in varchar2         default null,
612   p_cont_information3              in varchar2         default null,
613   p_cont_information4              in varchar2         default null,
614   p_cont_information5              in varchar2         default null,
615   p_cont_information6              in varchar2         default null,
616   p_cont_information7              in varchar2         default null,
617   p_cont_information8              in varchar2         default null,
618   p_cont_information9              in varchar2         default null,
619   p_cont_information10             in varchar2         default null,
620   p_cont_information11             in varchar2         default null,
621   p_cont_information12             in varchar2         default null,
625   p_cont_information16             in varchar2         default null,
622   p_cont_information13             in varchar2         default null,
623   p_cont_information14             in varchar2         default null,
624   p_cont_information15             in varchar2         default null,
626   p_cont_information17             in varchar2         default null,
627   p_cont_information18             in varchar2         default null,
628   p_cont_information19             in varchar2         default null,
629   p_cont_information20             in varchar2         default null,
630   p_third_party_pay_flag         in varchar2         default 'N',
631   p_bondholder_flag              in varchar2         default 'N',
632   p_dependent_flag               in varchar2         default 'N',
633   p_beneficiary_flag             in varchar2         default 'N',
634   p_object_version_number        out nocopy number,
635   p_effective_date               in date      default null,
636   p_validate                     in boolean   default false
637 ) is
638 --
639   l_rec    per_ctr_shd.g_rec_type;
640   l_proc  varchar2(72) := g_package||'ins';
641 --
642 Begin
643   hr_utility.set_location('Entering:'||l_proc, 5);
644   --
645   -- Call conversion function to turn arguments into the
646   -- p_rec structure.
647   --
648   l_rec :=
652   p_business_group_id,
649   per_ctr_shd.convert_args
650   (
651   null,
653   p_person_id,
654   p_contact_person_id,
655   p_contact_type,
656   p_comments,
657   p_primary_contact_flag,
658   p_request_id,
659   p_program_application_id,
660   p_program_id,
661   p_program_update_date,
662   p_date_start,
663   p_start_life_reason_id,
664   p_date_end,
665   p_end_life_reason_id,
666   p_rltd_per_rsds_w_dsgntr_flag,
667   p_personal_flag,
668   p_sequence_number,
669   p_cont_attribute_category,
670   p_cont_attribute1,
671   p_cont_attribute2,
672   p_cont_attribute3,
673   p_cont_attribute4,
674   p_cont_attribute5,
675   p_cont_attribute6,
676   p_cont_attribute7,
677   p_cont_attribute8,
678   p_cont_attribute9,
679   p_cont_attribute10,
680   p_cont_attribute11,
681   p_cont_attribute12,
682   p_cont_attribute13,
683   p_cont_attribute14,
684   p_cont_attribute15,
685   p_cont_attribute16,
686   p_cont_attribute17,
687   p_cont_attribute18,
688   p_cont_attribute19,
689   p_cont_attribute20,
690   p_cont_information_category,
691   p_cont_information1,
692   p_cont_information2,
693   p_cont_information3,
694   p_cont_information4,
695   p_cont_information5,
696   p_cont_information6,
697   p_cont_information7,
698   p_cont_information8,
699   p_cont_information9,
700   p_cont_information10,
701   p_cont_information11,
702   p_cont_information12,
703   p_cont_information13,
704   p_cont_information14,
705   p_cont_information15,
706   p_cont_information16,
707   p_cont_information17,
708   p_cont_information18,
709   p_cont_information19,
710   p_cont_information20,
711   p_third_party_pay_flag,
712   p_bondholder_flag,
713   p_dependent_flag,
714   p_beneficiary_flag,
715   null
716 );
717   --
718   -- Having converted the arguments into the per_ctr_rec
719   -- plsql record structure we call the corresponding record business process.
720   --
721   ins(l_rec, p_effective_date, p_validate);
722   --
723   -- As the primary key argument(s)
724   -- are specified as an OUT's we must set these values.
725   --
726   p_contact_relationship_id := l_rec.contact_relationship_id;
727   p_object_version_number := l_rec.object_version_number;
728   --
729 -- Bug#885806: dbms_output call is replaced with hr_utility.trace call
730    hr_utility.trace('RH OVN: '||l_rec.object_version_number);
731 -- dbms_output.put_line('RH OVN: '||l_rec.object_version_number);
732   hr_utility.set_location(' Leaving:'||l_proc, 10);
733 End ins;
734 --
735 end per_ctr_ins;