DBA Data[Home] [Help]

PACKAGE BODY: APPS.PQH_ASA_INS

Source


4 -- ----------------------------------------------------------------------------
1 Package Body pqh_asa_ins as
2 /* $Header: pqasarhi.pkb 115.3 2002/11/27 00:35:21 rpasapul noship $ */
3 --
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  pqh_asa_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_assignment_acco_id_i  number   default null;
14 --
15 -- ----------------------------------------------------------------------------
16 -- |------------------------< set_base_key_value >----------------------------|
17 -- ----------------------------------------------------------------------------
18 procedure set_base_key_value
19   (p_assignment_acco_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   pqh_asa_ins.g_assignment_acco_id_i := p_assignment_acco_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).
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.
49 --   6) To raise any other errors.
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 pqh_asa_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   pqh_assign_accommodations_f t
92     where  t.assignment_acco_id       = p_rec.assignment_acco_id
93     and    t.effective_start_date =
94              pqh_asa_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          pqh_assign_accommodations_f.created_by%TYPE;
99   l_creation_date       pqh_assign_accommodations_f.creation_date%TYPE;
100   l_last_update_date    pqh_assign_accommodations_f.last_update_date%TYPE;
101   l_last_updated_by     pqh_assign_accommodations_f.last_updated_by%TYPE;
102   l_last_update_login   pqh_assign_accommodations_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 => 'pqh_assign_accommodations_f'
112       ,p_base_key_column => 'assignment_acco_id'
113       ,p_base_key_value  => p_rec.assignment_acco_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');
142     End If;
139       fnd_message.set_token('PROCEDURE', l_proc);
140       fnd_message.set_token('STEP','10');
141       fnd_message.raise_error;
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   --
153   --
154   -- Insert the row into: pqh_assign_accommodations_f
155   --
156   insert into pqh_assign_accommodations_f
157       (assignment_acco_id
158       ,effective_start_date
159       ,effective_end_date
160       ,business_group_id
161       ,assignment_id
162       ,accommodation_given
163       ,temporary_assignment
164       ,accommodation_id
165       ,acceptance_date
166       ,moving_date
167       ,refusal_date
168       ,comments
169       ,indemnity_entitlement
170       ,indemnity_amount
171       ,type_of_payment
172       ,information_category
173       ,information1
174       ,information2
175       ,information3
176       ,information4
177       ,information5
178       ,information6
179       ,information7
180       ,information8
181       ,information9
182       ,information10
183       ,information11
184       ,information12
185       ,information13
186       ,information14
187       ,information15
188       ,information16
189       ,information17
190       ,information18
191       ,information19
192       ,information20
193       ,information21
194       ,information22
195       ,information23
196       ,information24
197       ,information25
198       ,information26
199       ,information27
200       ,information28
201       ,information29
202       ,information30
203       ,attribute_category
204       ,attribute1
205       ,attribute2
206       ,attribute3
207       ,attribute4
208       ,attribute5
209       ,attribute6
210       ,attribute7
211       ,attribute8
212       ,attribute9
213       ,attribute10
214       ,attribute11
215       ,attribute12
216       ,attribute13
217       ,attribute14
218       ,attribute15
219       ,attribute16
220       ,attribute17
221       ,attribute18
222       ,attribute19
223       ,attribute20
224       ,attribute21
225       ,attribute22
226       ,attribute23
227       ,attribute24
228       ,attribute25
229       ,attribute26
230       ,attribute27
231       ,attribute28
232       ,attribute29
233       ,attribute30
234       ,object_version_number
235       ,reason_for_no_acco
236       ,indemnity_currency
237       ,created_by
238       ,creation_date
239       ,last_update_date
240       ,last_updated_by
241       ,last_update_login
242       )
243   Values
244     (p_rec.assignment_acco_id
245     ,p_rec.effective_start_date
246     ,p_rec.effective_end_date
247     ,p_rec.business_group_id
248     ,p_rec.assignment_id
249     ,p_rec.accommodation_given
250     ,p_rec.temporary_assignment
251     ,p_rec.accommodation_id
252     ,p_rec.acceptance_date
253     ,p_rec.moving_date
254     ,p_rec.refusal_date
255     ,p_rec.comments
256     ,p_rec.indemnity_entitlement
257     ,p_rec.indemnity_amount
258     ,p_rec.type_of_payment
259     ,p_rec.information_category
260     ,p_rec.information1
261     ,p_rec.information2
262     ,p_rec.information3
263     ,p_rec.information4
264     ,p_rec.information5
265     ,p_rec.information6
266     ,p_rec.information7
267     ,p_rec.information8
268     ,p_rec.information9
269     ,p_rec.information10
270     ,p_rec.information11
271     ,p_rec.information12
272     ,p_rec.information13
273     ,p_rec.information14
274     ,p_rec.information15
275     ,p_rec.information16
276     ,p_rec.information17
277     ,p_rec.information18
278     ,p_rec.information19
279     ,p_rec.information20
280     ,p_rec.information21
281     ,p_rec.information22
282     ,p_rec.information23
283     ,p_rec.information24
284     ,p_rec.information25
285     ,p_rec.information26
286     ,p_rec.information27
287     ,p_rec.information28
288     ,p_rec.information29
289     ,p_rec.information30
290     ,p_rec.attribute_category
291     ,p_rec.attribute1
292     ,p_rec.attribute2
293     ,p_rec.attribute3
294     ,p_rec.attribute4
295     ,p_rec.attribute5
296     ,p_rec.attribute6
297     ,p_rec.attribute7
298     ,p_rec.attribute8
299     ,p_rec.attribute9
300     ,p_rec.attribute10
301     ,p_rec.attribute11
302     ,p_rec.attribute12
303     ,p_rec.attribute13
304     ,p_rec.attribute14
305     ,p_rec.attribute15
306     ,p_rec.attribute16
307     ,p_rec.attribute17
308     ,p_rec.attribute18
309     ,p_rec.attribute19
310     ,p_rec.attribute20
311     ,p_rec.attribute21
312     ,p_rec.attribute22
313     ,p_rec.attribute23
314     ,p_rec.attribute24
315     ,p_rec.attribute25
316     ,p_rec.attribute26
317     ,p_rec.attribute27
318     ,p_rec.attribute28
319     ,p_rec.attribute29
320     ,p_rec.attribute30
321     ,p_rec.object_version_number
322     ,p_rec.reason_for_no_acco
323     ,p_rec.indemnity_currency
324     ,l_created_by
325     ,l_creation_date
326     ,l_last_update_date
327     ,l_last_updated_by
328     ,l_last_update_login
329     );
330   --
331   --
332   hr_utility.set_location(' Leaving:'||l_proc, 15);
333 --
334 Exception
335   When hr_api.check_integrity_violated Then
336     -- A check constraint has been violated
337     --
338     pqh_asa_shd.constraint_error
339       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
340   When hr_api.unique_integrity_violated Then
341     -- Unique integrity has been violated
342     --
343     pqh_asa_shd.constraint_error
344       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
345   When Others Then
346     --
347     Raise;
348 End dt_insert_dml;
349 --
350 -- ----------------------------------------------------------------------------
351 -- |------------------------------< insert_dml >------------------------------|
352 -- ----------------------------------------------------------------------------
353 Procedure insert_dml
354   (p_rec                   in out nocopy pqh_asa_shd.g_rec_type
355   ,p_effective_date        in date
356   ,p_datetrack_mode        in varchar2
357   ,p_validation_start_date in date
358   ,p_validation_end_date   in date
359   ) is
360 --
361   l_proc        varchar2(72) := g_package||'insert_dml';
362 --
363 Begin
364   hr_utility.set_location('Entering:'||l_proc, 5);
365   --
366   pqh_asa_ins.dt_insert_dml
367     (p_rec                   => p_rec
368     ,p_effective_date        => p_effective_date
369     ,p_datetrack_mode        => p_datetrack_mode
370     ,p_validation_start_date => p_validation_start_date
371     ,p_validation_end_date   => p_validation_end_date
372     );
373   --
374   hr_utility.set_location(' Leaving:'||l_proc, 10);
375 End insert_dml;
376 --
377 -- ----------------------------------------------------------------------------
378 -- |------------------------------< pre_insert >------------------------------|
379 -- ----------------------------------------------------------------------------
380 -- {Start Of Comments}
381 --
382 -- Description:
383 --   This private procedure contains any processing which is required before
384 --   the insert dml. Presently, if the entity has a corresponding primary
385 --   key which is maintained by an associating sequence, the primary key for
386 --   the entity will be populated with the next sequence value in
387 --   preparation for the insert dml.
388 --   Also, if comments are defined for this entity, the comments insert
389 --   logic will also be called, generating a comment_id if required.
390 --
391 -- Prerequisites:
392 --   This is an internal procedure which is called from the ins procedure.
393 --
394 -- In Parameters:
395 --   A Pl/Sql record structure.
396 --
397 -- Post Success:
398 --   Processing continues.
399 --
400 -- Post Failure:
401 --   If an error has occurred, an error message and exception will be raised
402 --   but not handled.
403 --
404 -- Developer Implementation Notes:
405 --   Any pre-processing required before the insert dml is issued should be
406 --   coded within this procedure. As stated above, a good example is the
407 --   generation of a primary key number via a corresponding sequence.
408 --   It is important to note that any 3rd party maintenance should be reviewed
409 --   before placing in this procedure.
410 --
411 -- Access Status:
412 --   Internal Row Handler Use Only.
413 --
414 -- {End Of Comments}
415 -- ----------------------------------------------------------------------------
416 Procedure pre_insert
417   (p_rec                   in out nocopy pqh_asa_shd.g_rec_type
418   ,p_effective_date        in date
419   ,p_datetrack_mode        in varchar2
420   ,p_validation_start_date in date
421   ,p_validation_end_date   in date
422   ) is
423 --
424   Cursor C_Sel1 is select pqh_assign_accommodations_s.nextval from sys.dual;
425 --
426  Cursor C_Sel2 is
427     Select null
428       from pqh_assign_accommodations_f
429      where assignment_acco_id =
430              pqh_asa_ins.g_assignment_acco_id_i;
431 --
432   l_proc        varchar2(72) := g_package||'pre_insert';
433   l_exists      varchar2(1);
434 --
435 Begin
436   hr_utility.set_location('Entering:'||l_proc, 5);
437   --
438     If (pqh_asa_ins.g_assignment_acco_id_i is not null) Then
439     --
440     -- Verify registered primary key values not already in use
441     --
442     Open C_Sel2;
443     Fetch C_Sel2 into l_exists;
444     If C_Sel2%found Then
445        Close C_Sel2;
446        --
447        -- The primary key values are already in use.
448        --
449        fnd_message.set_name('PER','PER_289391_KEY_ALREADY_USED');
450        fnd_message.set_token('TABLE_NAME','pqh_assign_accommodations_f');
451        fnd_message.raise_error;
452     End If;
453     Close C_Sel2;
454     --
455     -- Use registered key values and clear globals
456     --
457     p_rec.assignment_acco_id :=
458       pqh_asa_ins.g_assignment_acco_id_i;
459     pqh_asa_ins.g_assignment_acco_id_i := null;
460   Else
461     --
462     -- No registerd key values, so select the next sequence number
463     --
464     --
465     -- Select the next sequence number
466     --
467     Open C_Sel1;
468     Fetch C_Sel1 Into p_rec.assignment_acco_id;
469     Close C_Sel1;
470   End If;
471   --
472   --
473   hr_utility.set_location(' Leaving:'||l_proc, 10);
474 End pre_insert;
475 --
476 -- ----------------------------------------------------------------------------
477 -- |----------------------------< post_insert >-------------------------------|
478 -- ----------------------------------------------------------------------------
479 -- {Start Of Comments}
480 --
481 -- Description:
482 --   This private procedure contains any processing which is required after
483 --   the insert dml.
484 --
485 -- Prerequisites:
486 --   This is an internal procedure which is called from the ins procedure.
487 --
488 -- In Parameters:
489 --   A Pl/Sql record structure.
490 --
491 -- Post Success:
492 --   Processing continues.
493 --
494 -- Post Failure:
495 --   If an error has occurred, an error message and exception will be raised
496 --   but not handled.
497 --
498 -- Developer Implementation Notes:
499 --   Any post-processing required after the insert dml is issued should be
500 --   coded within this procedure. It is important to note that any 3rd party
501 --   maintenance should be reviewed before placing in this procedure.
502 --
503 -- Access Status:
504 --   Internal Row Handler Use Only.
505 --
506 -- {End Of Comments}
507 -- ----------------------------------------------------------------------------
508 Procedure post_insert
509   (p_rec                   in pqh_asa_shd.g_rec_type
510   ,p_effective_date        in date
511   ,p_datetrack_mode        in varchar2
512   ,p_validation_start_date in date
513   ,p_validation_end_date   in date
514   ) is
515 --
516   l_proc        varchar2(72) := g_package||'post_insert';
517 --
518 Begin
519   hr_utility.set_location('Entering:'||l_proc, 5);
520   begin
521     --
522     pqh_asa_rki.after_insert
523       (p_effective_date
524       => p_effective_date
525       ,p_validation_start_date
526       => p_validation_start_date
530       => p_rec.assignment_acco_id
527       ,p_validation_end_date
528       => p_validation_end_date
529       ,p_assignment_acco_id
531       ,p_effective_start_date
532       => p_rec.effective_start_date
533       ,p_effective_end_date
534       => p_rec.effective_end_date
535       ,p_business_group_id
536       => p_rec.business_group_id
537       ,p_assignment_id
538       => p_rec.assignment_id
539       ,p_accommodation_given
540       => p_rec.accommodation_given
541       ,p_temporary_assignment
542       => p_rec.temporary_assignment
543       ,p_accommodation_id
544       => p_rec.accommodation_id
545       ,p_acceptance_date
546       => p_rec.acceptance_date
547       ,p_moving_date
548       => p_rec.moving_date
549       ,p_refusal_date
550       => p_rec.refusal_date
551       ,p_comments
555       ,p_indemnity_amount
552       => p_rec.comments
553       ,p_indemnity_entitlement
554       => p_rec.indemnity_entitlement
556       => p_rec.indemnity_amount
557       ,p_type_of_payment
558       => p_rec.type_of_payment
559       ,p_information_category
560       => p_rec.information_category
561       ,p_information1
562       => p_rec.information1
563       ,p_information2
564       => p_rec.information2
565       ,p_information3
566       => p_rec.information3
567       ,p_information4
568       => p_rec.information4
569       ,p_information5
570       => p_rec.information5
571       ,p_information6
572       => p_rec.information6
573       ,p_information7
574       => p_rec.information7
575       ,p_information8
576       => p_rec.information8
577       ,p_information9
578       => p_rec.information9
579       ,p_information10
580       => p_rec.information10
581       ,p_information11
582       => p_rec.information11
583       ,p_information12
584       => p_rec.information12
585       ,p_information13
586       => p_rec.information13
587       ,p_information14
588       => p_rec.information14
589       ,p_information15
590       => p_rec.information15
591       ,p_information16
592       => p_rec.information16
593       ,p_information17
594       => p_rec.information17
595       ,p_information18
596       => p_rec.information18
597       ,p_information19
598       => p_rec.information19
599       ,p_information20
600       => p_rec.information20
601       ,p_information21
602       => p_rec.information21
603       ,p_information22
604       => p_rec.information22
605       ,p_information23
606       => p_rec.information23
607       ,p_information24
608       => p_rec.information24
609       ,p_information25
610       => p_rec.information25
611       ,p_information26
612       => p_rec.information26
613       ,p_information27
614       => p_rec.information27
615       ,p_information28
616       => p_rec.information28
617       ,p_information29
618       => p_rec.information29
619       ,p_information30
620       => p_rec.information30
621       ,p_attribute_category
622       => p_rec.attribute_category
623       ,p_attribute1
624       => p_rec.attribute1
625       ,p_attribute2
626       => p_rec.attribute2
627       ,p_attribute3
628       => p_rec.attribute3
629       ,p_attribute4
630       => p_rec.attribute4
631       ,p_attribute5
632       => p_rec.attribute5
633       ,p_attribute6
634       => p_rec.attribute6
635       ,p_attribute7
636       => p_rec.attribute7
637       ,p_attribute8
638       => p_rec.attribute8
639       ,p_attribute9
640       => p_rec.attribute9
641       ,p_attribute10
642       => p_rec.attribute10
643       ,p_attribute11
644       => p_rec.attribute11
645       ,p_attribute12
646       => p_rec.attribute12
647       ,p_attribute13
648       => p_rec.attribute13
649       ,p_attribute14
650       => p_rec.attribute14
651       ,p_attribute15
652       => p_rec.attribute15
653       ,p_attribute16
654       => p_rec.attribute16
655       ,p_attribute17
656       => p_rec.attribute17
657       ,p_attribute18
658       => p_rec.attribute18
659       ,p_attribute19
660       => p_rec.attribute19
661       ,p_attribute20
662       => p_rec.attribute20
663       ,p_attribute21
664       => p_rec.attribute21
665       ,p_attribute22
666       => p_rec.attribute22
667       ,p_attribute23
668       => p_rec.attribute23
669       ,p_attribute24
670       => p_rec.attribute24
671       ,p_attribute25
672       => p_rec.attribute25
673       ,p_attribute26
674       => p_rec.attribute26
675       ,p_attribute27
676       => p_rec.attribute27
677       ,p_attribute28
678       => p_rec.attribute28
679       ,p_attribute29
680       => p_rec.attribute29
681       ,p_attribute30
682       => p_rec.attribute30
683       ,p_object_version_number
684       => p_rec.object_version_number
685       ,p_reason_for_no_acco
686       => p_rec.reason_for_no_acco
687       ,p_indemnity_currency
688       => p_rec.indemnity_currency
689       );
690     --
691   exception
692     --
693     when hr_api.cannot_find_prog_unit then
694       --
695       hr_api.cannot_find_prog_unit_error
696         (p_module_name => 'PQH_ASSIGN_ACCOMMODATIONS_F'
697         ,p_hook_type   => 'AI');
698       --
699   end;
700   --
701   hr_utility.set_location(' Leaving:'||l_proc, 10);
702 End post_insert;
703 --
704 -- ----------------------------------------------------------------------------
705 -- |-------------------------------< ins_lck >--------------------------------|
706 -- ----------------------------------------------------------------------------
707 -- {Start Of Comments}
708 --
709 -- Description:
710 --   The ins_lck process has one main function to perform. When inserting
711 --   a datetracked row, we must validate the DT mode.
712 --
713 -- Prerequisites:
714 --   This procedure can only be called for the datetrack mode of INSERT.
715 --
716 -- In Parameters:
717 --
718 -- Post Success:
719 --   On successful completion of the ins_lck process the parental
720 --   datetracked rows will be locked providing the p_enforce_foreign_locking
721 --   argument value is TRUE.
722 --   If the p_enforce_foreign_locking argument value is FALSE then the
723 --   parential rows are not locked.
724 --
725 -- Post Failure:
726 --   The Lck process can fail for:
727 --   1) When attempting to lock the row the row could already be locked by
728 --      another user. This will raise the HR_Api.Object_Locked exception.
729 --   2) When attempting to the lock the parent which doesn't exist.
730 --      For the entity to be locked the parent must exist!
731 --
732 -- Developer Implementation Notes:
733 --   None.
734 --
735 -- Access Status:
736 --   Internal Row Handler Use Only.
737 --
738 -- {End Of Comments}
739 -- ----------------------------------------------------------------------------
740 Procedure ins_lck
741   (p_effective_date        in date
742   ,p_datetrack_mode        in varchar2
743   ,p_rec                   in pqh_asa_shd.g_rec_type
744   ,p_validation_start_date out nocopy date
745   ,p_validation_end_date   out nocopy date
746   ) is
747 --
748   l_proc                  varchar2(72) := g_package||'ins_lck';
749   l_validation_start_date date;
750   l_validation_end_date   date;
751 --
752 Begin
753   hr_utility.set_location('Entering:'||l_proc, 5);
754   --
755   -- Validate the datetrack mode mode getting the validation start
756   -- and end dates for the specified datetrack operation.
757   --
758   dt_api.validate_dt_mode
759     (p_effective_date          => p_effective_date
760     ,p_datetrack_mode          => p_datetrack_mode
761     ,p_base_table_name         => 'pqh_assign_accommodations_f'
762     ,p_base_key_column         => 'assignment_acco_id'
763     ,p_base_key_value          => p_rec.assignment_acco_id
764     ,p_parent_table_name1      => 'pqh_accommodations_f'
765     ,p_parent_key_column1      => 'accommodation_id'
766     ,p_parent_key_value1       => p_rec.accommodation_id
767     ,p_enforce_foreign_locking => true
768     ,p_validation_start_date   => l_validation_start_date
769     ,p_validation_end_date     => l_validation_end_date
770     );
771   --
772   -- Set the validation start and end date OUT arguments
773   --
774   p_validation_start_date := l_validation_start_date;
775   p_validation_end_date   := l_validation_end_date;
776   --
777   hr_utility.set_location(' Leaving:'||l_proc, 10);
778   --
779 End ins_lck;
780 --
781 -- ----------------------------------------------------------------------------
782 -- |---------------------------------< ins >----------------------------------|
783 -- ----------------------------------------------------------------------------
784 Procedure ins
785   (p_effective_date in     date
786   ,p_rec            in out nocopy pqh_asa_shd.g_rec_type
787   ) is
788 --
789   l_proc                        varchar2(72) := g_package||'ins';
790   l_datetrack_mode              varchar2(30) := hr_api.g_insert;
791   l_validation_start_date       date;
792   l_validation_end_date         date;
793 --
794 Begin
795   hr_utility.set_location('Entering:'||l_proc, 5);
796   --
797   -- Call the lock operation
798   --
799   pqh_asa_ins.ins_lck
800     (p_effective_date        => p_effective_date
801     ,p_datetrack_mode        => l_datetrack_mode
802     ,p_rec                   => p_rec
803     ,p_validation_start_date => l_validation_start_date
804     ,p_validation_end_date   => l_validation_end_date
805     );
806   --
807   -- Call the supporting insert validate operations
808   --
809   pqh_asa_bus.insert_validate
810     (p_rec                   => p_rec
811     ,p_effective_date        => p_effective_date
812     ,p_datetrack_mode        => l_datetrack_mode
813     ,p_validation_start_date => l_validation_start_date
814     ,p_validation_end_date   => l_validation_end_date
815     );
816   --
817   -- Call to raise any errors on multi-message list
818   hr_multi_message.end_validation_set;
819   --
820   -- Call the supporting pre-insert operation
821   --
822   pqh_asa_ins.pre_insert
823     (p_rec                   => p_rec
824     ,p_effective_date        => p_effective_date
825     ,p_datetrack_mode        => l_datetrack_mode
826     ,p_validation_start_date => l_validation_start_date
827     ,p_validation_end_date   => l_validation_end_date
828     );
829   --
830   -- Insert the row
831   --
832   pqh_asa_ins.insert_dml
833     (p_rec                   => p_rec
834     ,p_effective_date        => p_effective_date
835     ,p_datetrack_mode        => l_datetrack_mode
836     ,p_validation_start_date => l_validation_start_date
837     ,p_validation_end_date   => l_validation_end_date
838     );
839   --
840   -- Call the supporting post-insert operation
841   --
842   pqh_asa_ins.post_insert
843     (p_rec                   => p_rec
844     ,p_effective_date        => p_effective_date
845     ,p_datetrack_mode        => l_datetrack_mode
846     ,p_validation_start_date => l_validation_start_date
847     ,p_validation_end_date   => l_validation_end_date
848     );
849   --
850   -- Call to raise any errors on multi-message list
851   hr_multi_message.end_validation_set;
852   --
853   hr_utility.set_location('Leaving:'||l_proc,10);
854 end ins;
855 --
856 -- ----------------------------------------------------------------------------
857 -- |---------------------------------< ins >----------------------------------|
858 -- ----------------------------------------------------------------------------
859 Procedure ins
860   (p_effective_date                 in     date
861   ,p_business_group_id              in     number
862   ,p_assignment_id                  in     number
863   ,p_accommodation_given            in     varchar2
864   ,p_temporary_assignment           in     varchar2 default null
865   ,p_accommodation_id               in     number   default null
866   ,p_acceptance_date                in     date     default null
867   ,p_moving_date                    in     date     default null
868   ,p_refusal_date                   in     date     default null
869   ,p_comments                       in     varchar2 default null
870   ,p_indemnity_entitlement          in     varchar2 default null
871   ,p_indemnity_amount               in     number   default null
872   ,p_type_of_payment                in     varchar2 default null
873   ,p_information_category           in     varchar2 default null
874   ,p_information1                   in     varchar2 default null
875   ,p_information2                   in     varchar2 default null
876   ,p_information3                   in     varchar2 default null
877   ,p_information4                   in     varchar2 default null
878   ,p_information5                   in     varchar2 default null
879   ,p_information6                   in     varchar2 default null
880   ,p_information7                   in     varchar2 default null
881   ,p_information8                   in     varchar2 default null
882   ,p_information9                   in     varchar2 default null
883   ,p_information10                  in     varchar2 default null
884   ,p_information11                  in     varchar2 default null
885   ,p_information12                  in     varchar2 default null
886   ,p_information13                  in     varchar2 default null
887   ,p_information14                  in     varchar2 default null
888   ,p_information15                  in     varchar2 default null
889   ,p_information16                  in     varchar2 default null
890   ,p_information17                  in     varchar2 default null
891   ,p_information18                  in     varchar2 default null
892   ,p_information19                  in     varchar2 default null
893   ,p_information20                  in     varchar2 default null
894   ,p_information21                  in     varchar2 default null
895   ,p_information22                  in     varchar2 default null
896   ,p_information23                  in     varchar2 default null
897   ,p_information24                  in     varchar2 default null
898   ,p_information25                  in     varchar2 default null
899   ,p_information26                  in     varchar2 default null
900   ,p_information27                  in     varchar2 default null
901   ,p_information28                  in     varchar2 default null
902   ,p_information29                  in     varchar2 default null
903   ,p_information30                  in     varchar2 default null
904   ,p_attribute_category             in     varchar2 default null
905   ,p_attribute1                     in     varchar2 default null
906   ,p_attribute2                     in     varchar2 default null
907   ,p_attribute3                     in     varchar2 default null
908   ,p_attribute4                     in     varchar2 default null
909   ,p_attribute5                     in     varchar2 default null
910   ,p_attribute6                     in     varchar2 default null
911   ,p_attribute7                     in     varchar2 default null
912   ,p_attribute8                     in     varchar2 default null
913   ,p_attribute9                     in     varchar2 default null
914   ,p_attribute10                    in     varchar2 default null
915   ,p_attribute11                    in     varchar2 default null
916   ,p_attribute12                    in     varchar2 default null
917   ,p_attribute13                    in     varchar2 default null
918   ,p_attribute14                    in     varchar2 default null
919   ,p_attribute15                    in     varchar2 default null
920   ,p_attribute16                    in     varchar2 default null
921   ,p_attribute17                    in     varchar2 default null
922   ,p_attribute18                    in     varchar2 default null
923   ,p_attribute19                    in     varchar2 default null
924   ,p_attribute20                    in     varchar2 default null
928   ,p_attribute24                    in     varchar2 default null
925   ,p_attribute21                    in     varchar2 default null
926   ,p_attribute22                    in     varchar2 default null
927   ,p_attribute23                    in     varchar2 default null
929   ,p_attribute25                    in     varchar2 default null
930   ,p_attribute26                    in     varchar2 default null
931   ,p_attribute27                    in     varchar2 default null
932   ,p_attribute28                    in     varchar2 default null
933   ,p_attribute29                    in     varchar2 default null
934   ,p_attribute30                    in     varchar2 default null
935   ,p_reason_for_no_acco             in     varchar2 default null
936   ,p_indemnity_currency             in     varchar2 default null
937   ,p_assignment_acco_id                out nocopy number
938   ,p_object_version_number             out nocopy number
939   ,p_effective_start_date              out nocopy date
940   ,p_effective_end_date                out nocopy date
941   ) is
942 --
943   l_rec         pqh_asa_shd.g_rec_type;
944   l_proc        varchar2(72) := g_package||'ins';
945 --
946 Begin
947   hr_utility.set_location('Entering:'||l_proc, 5);
948   --
949   -- Call conversion function to turn arguments into the
950   -- p_rec structure.
951   --
952   l_rec :=
953   pqh_asa_shd.convert_args
954     (null
955     ,null
956     ,null
957     ,p_business_group_id
958     ,p_assignment_id
959     ,p_accommodation_given
960     ,p_temporary_assignment
961     ,p_accommodation_id
962     ,p_acceptance_date
963     ,p_moving_date
964     ,p_refusal_date
965     ,p_comments
966     ,p_indemnity_entitlement
967     ,p_indemnity_amount
968     ,p_type_of_payment
969     ,p_information_category
970     ,p_information1
971     ,p_information2
972     ,p_information3
973     ,p_information4
974     ,p_information5
975     ,p_information6
976     ,p_information7
977     ,p_information8
978     ,p_information9
979     ,p_information10
980     ,p_information11
981     ,p_information12
982     ,p_information13
983     ,p_information14
984     ,p_information15
985     ,p_information16
986     ,p_information17
987     ,p_information18
988     ,p_information19
989     ,p_information20
990     ,p_information21
991     ,p_information22
992     ,p_information23
993     ,p_information24
994     ,p_information25
995     ,p_information26
996     ,p_information27
997     ,p_information28
998     ,p_information29
999     ,p_information30
1000     ,p_attribute_category
1001     ,p_attribute1
1002     ,p_attribute2
1003     ,p_attribute3
1004     ,p_attribute4
1005     ,p_attribute5
1006     ,p_attribute6
1007     ,p_attribute7
1008     ,p_attribute8
1009     ,p_attribute9
1010     ,p_attribute10
1011     ,p_attribute11
1012     ,p_attribute12
1013     ,p_attribute13
1014     ,p_attribute14
1015     ,p_attribute15
1016     ,p_attribute16
1017     ,p_attribute17
1018     ,p_attribute18
1019     ,p_attribute19
1020     ,p_attribute20
1021     ,p_attribute21
1022     ,p_attribute22
1023     ,p_attribute23
1024     ,p_attribute24
1025     ,p_attribute25
1026     ,p_attribute26
1027     ,p_attribute27
1028     ,p_attribute28
1029     ,p_attribute29
1030     ,p_attribute30
1031     ,null
1032     ,p_reason_for_no_acco
1033     ,p_indemnity_currency
1034     );
1035   --
1036   -- Having converted the arguments into the pqh_asa_rec
1037   -- plsql record structure we call the corresponding record
1038   -- business process.
1039   --
1040   pqh_asa_ins.ins
1041     (p_effective_date
1042     ,l_rec
1043     );
1044   --
1045   -- Set the OUT arguments.
1046   --
1047   p_assignment_acco_id               := l_rec.assignment_acco_id;
1048   p_effective_start_date             := l_rec.effective_start_date;
1049   p_effective_end_date               := l_rec.effective_end_date;
1050   p_object_version_number            := l_rec.object_version_number;
1051   --
1052   --
1053   hr_utility.set_location(' Leaving:'||l_proc, 10);
1054 End ins;
1055 --
1056 end pqh_asa_ins;