DBA Data[Home] [Help]

PACKAGE BODY: APPS.PQP_VAL_INS

Source


1 Package Body pqp_val_ins as
2 /* $Header: pqvalrhi.pkb 120.4 2011/09/16 06:12:51 vepravee noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  pqp_val_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_vehicle_allocation_id_i  number   default null;
14 --
15 -- ----------------------------------------------------------------------------
16 -- |------------------------< set_base_key_value >----------------------------|
17 -- ----------------------------------------------------------------------------
18 procedure set_base_key_value
19   (p_vehicle_allocation_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   pqp_val_ins.g_vehicle_allocation_id_i := p_vehicle_allocation_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 pqp_val_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  pqp_vehicle_allocations_f t
92     WHERE t.vehicle_allocation_id       = p_rec.vehicle_allocation_id
93       AND t.effective_start_date =
94           pqp_val_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          pqp_vehicle_allocations_f.created_by%TYPE;
99   l_creation_date       pqp_vehicle_allocations_f.creation_date%TYPE;
100   l_last_update_date    pqp_vehicle_allocations_f.last_update_date%TYPE;
101   l_last_updated_by     pqp_vehicle_allocations_f.last_updated_by%TYPE;
102   l_last_update_login   pqp_vehicle_allocations_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 => 'pqp_vehicle_allocations_f'
112       ,p_base_key_column => 'vehicle_allocation_id'
113       ,p_base_key_value  => p_rec.vehicle_allocation_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   --
153   --
154   -- Insert the row into: pqp_vehicle_allocations_f
155   --
156   insert into pqp_vehicle_allocations_f
157       (vehicle_allocation_id
158       ,effective_start_date
159       ,effective_end_date
160       ,assignment_id
161       ,business_group_id
162       ,across_assignments
163       ,vehicle_repository_id
164       ,usage_type
165       ,capital_contribution
166       ,private_contribution
167       ,default_vehicle
168       ,fuel_card
169       ,fuel_card_number
170       ,calculation_method
171       ,rates_table_id
172       ,element_type_id
173       ,private_use_flag
174       ,insurance_number
175       ,insurance_expiry_date
176       ,val_attribute_category
177       ,val_attribute1
178       ,val_attribute2
179       ,val_attribute3
180       ,val_attribute4
181       ,val_attribute5
182       ,val_attribute6
183       ,val_attribute7
184       ,val_attribute8
185       ,val_attribute9
186       ,val_attribute10
187       ,val_attribute11
188       ,val_attribute12
189       ,val_attribute13
190       ,val_attribute14
191       ,val_attribute15
192       ,val_attribute16
193       ,val_attribute17
194       ,val_attribute18
195       ,val_attribute19
196       ,val_attribute20
197       ,val_information_category
198       ,val_information1
199       ,val_information2
200       ,val_information3
201       ,val_information4
202       ,val_information5
203       ,val_information6
204       ,val_information7
205       ,val_information8
206       ,val_information9
207       ,val_information10
208       ,val_information11
209       ,val_information12
210       ,val_information13
211       ,val_information14
212       ,val_information15
213       ,val_information16
214       ,val_information17
215       ,val_information18
216       ,val_information19
217       ,val_information20
218       ,object_version_number
219       ,fuel_benefit
220       ,sliding_rates_info
221       ,created_by
222       ,creation_date
223       ,last_update_date
224       ,last_updated_by
225       ,last_update_login
226       )
227   Values
228     (p_rec.vehicle_allocation_id
229     ,p_rec.effective_start_date
230     ,p_rec.effective_end_date
231     ,p_rec.assignment_id
232     ,p_rec.business_group_id
233     ,p_rec.across_assignments
234     ,p_rec.vehicle_repository_id
235     ,p_rec.usage_type
236     ,p_rec.capital_contribution
237     ,p_rec.private_contribution
238     ,p_rec.default_vehicle
239     ,p_rec.fuel_card
240     ,p_rec.fuel_card_number
241     ,p_rec.calculation_method
242     ,p_rec.rates_table_id
243     ,p_rec.element_type_id
244     ,p_rec.private_use_flag
245     ,p_rec.insurance_number
246     ,p_rec.insurance_expiry_date
247     ,p_rec.val_attribute_category
248     ,p_rec.val_attribute1
249     ,p_rec.val_attribute2
250     ,p_rec.val_attribute3
251     ,p_rec.val_attribute4
252     ,p_rec.val_attribute5
253     ,p_rec.val_attribute6
254     ,p_rec.val_attribute7
255     ,p_rec.val_attribute8
256     ,p_rec.val_attribute9
257     ,p_rec.val_attribute10
258     ,p_rec.val_attribute11
259     ,p_rec.val_attribute12
260     ,p_rec.val_attribute13
261     ,p_rec.val_attribute14
262     ,p_rec.val_attribute15
263     ,p_rec.val_attribute16
264     ,p_rec.val_attribute17
265     ,p_rec.val_attribute18
266     ,p_rec.val_attribute19
267     ,p_rec.val_attribute20
268     ,p_rec.val_information_category
269     ,p_rec.val_information1
270     ,p_rec.val_information2
271     ,p_rec.val_information3
272     ,p_rec.val_information4
273     ,p_rec.val_information5
274     ,p_rec.val_information6
275     ,p_rec.val_information7
276     ,p_rec.val_information8
277     ,p_rec.val_information9
278     ,p_rec.val_information10
279     ,p_rec.val_information11
280     ,p_rec.val_information12
281     ,p_rec.val_information13
282     ,p_rec.val_information14
283     ,p_rec.val_information15
284     ,p_rec.val_information16
285     ,p_rec.val_information17
286     ,p_rec.val_information18
287     ,p_rec.val_information19
288     ,p_rec.val_information20
289     ,p_rec.object_version_number
290     ,p_rec.fuel_benefit
291     ,p_rec.sliding_rates_info
292     ,l_created_by
293     ,l_creation_date
294     ,l_last_update_date
295     ,l_last_updated_by
296     ,l_last_update_login
297     );
298   --
299   --
300   hr_utility.set_location(' Leaving:'||l_proc, 15);
301 --
302 Exception
303   When hr_api.check_integrity_violated Then
304     -- A check constraint has been violated
305     --
306     pqp_val_shd.constraint_error
307       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
308   When hr_api.unique_integrity_violated Then
309     -- Unique integrity has been violated
310     --
311     pqp_val_shd.constraint_error
312       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
313   When Others Then
314     --
315     Raise;
316 End dt_insert_dml;
317 --
318 -- ----------------------------------------------------------------------------
319 -- |------------------------------< insert_dml >------------------------------|
320 -- ----------------------------------------------------------------------------
321 Procedure insert_dml
322   (p_rec                   in out nocopy pqp_val_shd.g_rec_type
323   ,p_effective_date        in date
324   ,p_datetrack_mode        in varchar2
325   ,p_validation_start_date in date
326   ,p_validation_end_date   in date
327   ) is
328 --
329   l_proc        varchar2(72) := g_package||'insert_dml';
330 --
331 Begin
332   hr_utility.set_location('Entering:'||l_proc, 5);
333   --
334   pqp_val_ins.dt_insert_dml
335     (p_rec                   => p_rec
336     ,p_effective_date        => p_effective_date
337     ,p_datetrack_mode        => p_datetrack_mode
338     ,p_validation_start_date => p_validation_start_date
339     ,p_validation_end_date   => p_validation_end_date
340     );
341   --
342   hr_utility.set_location(' Leaving:'||l_proc, 10);
343 End insert_dml;
344 --
345 -- ----------------------------------------------------------------------------
346 -- |------------------------------< pre_insert >------------------------------|
347 -- ----------------------------------------------------------------------------
348 -- {Start Of Comments}
349 --
350 -- Description:
351 --   This private procedure contains any processing which is required before
352 --   the insert dml. Presently, if the entity has a corresponding primary
353 --   key which is maintained by an associating sequence, the primary key for
354 --   the entity will be populated with the next sequence value in
355 --   preparation for the insert dml.
356 --   Also, if comments are defined for this entity, the comments insert
357 --   logic will also be called, generating a comment_id if required.
358 --
359 -- Prerequisites:
360 --   This is an internal procedure which is called from the ins procedure.
361 --
362 -- In Parameters:
363 --   A Pl/Sql record structure.
364 --
365 -- Post Success:
366 --   Processing continues.
367 --
368 -- Post Failure:
369 --   If an error has occurred, an error message and exception will be raised
370 --   but not handled.
371 --
372 -- Developer Implementation Notes:
373 --   Any pre-processing required before the insert dml is issued should be
374 --   coded within this procedure. As stated above, a good example is the
375 --   generation of a primary key number via a corresponding sequence.
376 --   It is important to note that any 3rd party maintenance should be reviewed
377 --   before placing in this procedure.
378 --
379 -- Access Status:
380 --   Internal Row Handler Use Only.
381 --
382 -- {End Of Comments}
383 -- ----------------------------------------------------------------------------
384 Procedure pre_insert
385   (p_rec                   in out nocopy pqp_val_shd.g_rec_type
386   ,p_effective_date        in date
387   ,p_datetrack_mode        in varchar2
388   ,p_validation_start_date in date
389   ,p_validation_end_date   in date
390   ) is
391 --
392   Cursor C_Sel1 is select pqp_vehicle_allocations_s.nextval from sys.dual;
393 --
394  Cursor C_Sel2 is
395     Select null
396       from pqp_vehicle_allocations_f
397      where vehicle_allocation_id =
398              pqp_val_ins.g_vehicle_allocation_id_i;
399 --
400   l_proc        varchar2(72) := g_package||'pre_insert';
401   l_exists      varchar2(1);
402 --
403 Begin
404   hr_utility.set_location('Entering:'||l_proc, 5);
405   --
406     If (pqp_val_ins.g_vehicle_allocation_id_i is not null) Then
407     --
408     -- Verify registered primary key values not already in use
409     --
410     Open C_Sel2;
411     Fetch C_Sel2 into l_exists;
412     If C_Sel2%found Then
413        Close C_Sel2;
414        --
415        -- The primary key values are already in use.
416        --
417        fnd_message.set_name('PER','PER_289391_KEY_ALREADY_USED');
418        fnd_message.set_token('TABLE_NAME','pqp_vehicle_allocations_f');
419        fnd_message.raise_error;
420     End If;
421     Close C_Sel2;
422     --
423     -- Use registered key values and clear globals
424     --
425     p_rec.vehicle_allocation_id :=
426       pqp_val_ins.g_vehicle_allocation_id_i;
427     pqp_val_ins.g_vehicle_allocation_id_i := null;
428   Else
429     --
430     -- No registerd key values, so select the next sequence number
431     --
432     --
433     -- Select the next sequence number
434     --
435     Open C_Sel1;
436     Fetch C_Sel1 Into p_rec.vehicle_allocation_id;
437     Close C_Sel1;
438   End If;
439   --
440   --
441   hr_utility.set_location(' Leaving:'||l_proc, 10);
442 End pre_insert;
443 --
444 -- ----------------------------------------------------------------------------
445 -- |----------------------------< post_insert >-------------------------------|
446 -- ----------------------------------------------------------------------------
447 -- {Start Of Comments}
448 --
449 -- Description:
450 --   This private procedure contains any processing which is required after
451 --   the insert dml.
452 --
453 -- Prerequisites:
454 --   This is an internal procedure which is called from the ins procedure.
455 --
456 -- In Parameters:
457 --   A Pl/Sql record structure.
458 --
459 -- Post Success:
460 --   Processing continues.
461 --
462 -- Post Failure:
463 --   If an error has occurred, an error message and exception will be raised
464 --   but not handled.
465 --
466 -- Developer Implementation Notes:
467 --   Any post-processing required after the insert dml is issued should be
468 --   coded within this procedure. It is important to note that any 3rd party
469 --   maintenance should be reviewed before placing in this procedure.
470 --
471 -- Access Status:
472 --   Internal Row Handler Use Only.
473 --
474 -- {End Of Comments}
475 -- ----------------------------------------------------------------------------
476 Procedure post_insert
477   (p_rec                   in pqp_val_shd.g_rec_type
478   ,p_effective_date        in date
479   ,p_datetrack_mode        in varchar2
480   ,p_validation_start_date in date
481   ,p_validation_end_date   in date
482   ) is
483 --
484   l_proc        varchar2(72) := g_package||'post_insert';
485 --
486 Begin
487   hr_utility.set_location('Entering:'||l_proc, 5);
488   begin
489     --
490     pqp_val_rki.after_insert
491       (p_effective_date
492       => p_effective_date
493       ,p_validation_start_date
494       => p_validation_start_date
495       ,p_validation_end_date
496       => p_validation_end_date
497       ,p_vehicle_allocation_id
498       => p_rec.vehicle_allocation_id
499       ,p_effective_start_date
500       => p_rec.effective_start_date
501       ,p_effective_end_date
502       => p_rec.effective_end_date
503       ,p_assignment_id
504       => p_rec.assignment_id
505       ,p_business_group_id
506       => p_rec.business_group_id
507       ,p_across_assignments
508       => p_rec.across_assignments
509       ,p_vehicle_repository_id
510       => p_rec.vehicle_repository_id
511       ,p_usage_type
512       => p_rec.usage_type
513       ,p_capital_contribution
514       => p_rec.capital_contribution
515       ,p_private_contribution
516       => p_rec.private_contribution
517       ,p_default_vehicle
518       => p_rec.default_vehicle
519       ,p_fuel_card
520       => p_rec.fuel_card
521       ,p_fuel_card_number
522       => p_rec.fuel_card_number
523       ,p_calculation_method
524       => p_rec.calculation_method
525       ,p_rates_table_id
526       => p_rec.rates_table_id
527       ,p_element_type_id
528       => p_rec.element_type_id
529       ,p_private_use_flag
530       => p_rec.private_use_flag
531       ,p_insurance_number
532       => p_rec.insurance_number
533       ,p_insurance_expiry_date
534       => p_rec.insurance_expiry_date
535       ,p_val_attribute_category
536       => p_rec.val_attribute_category
537       ,p_val_attribute1
538       => p_rec.val_attribute1
539       ,p_val_attribute2
540       => p_rec.val_attribute2
541       ,p_val_attribute3
542       => p_rec.val_attribute3
543       ,p_val_attribute4
544       => p_rec.val_attribute4
545       ,p_val_attribute5
546       => p_rec.val_attribute5
547       ,p_val_attribute6
548       => p_rec.val_attribute6
549       ,p_val_attribute7
550       => p_rec.val_attribute7
551       ,p_val_attribute8
552       => p_rec.val_attribute8
553       ,p_val_attribute9
554       => p_rec.val_attribute9
555       ,p_val_attribute10
556       => p_rec.val_attribute10
557       ,p_val_attribute11
558       => p_rec.val_attribute11
559       ,p_val_attribute12
560       => p_rec.val_attribute12
561       ,p_val_attribute13
562       => p_rec.val_attribute13
563       ,p_val_attribute14
564       => p_rec.val_attribute14
565       ,p_val_attribute15
566       => p_rec.val_attribute15
567       ,p_val_attribute16
568       => p_rec.val_attribute16
569       ,p_val_attribute17
570       => p_rec.val_attribute17
571       ,p_val_attribute18
572       => p_rec.val_attribute18
573       ,p_val_attribute19
574       => p_rec.val_attribute19
575       ,p_val_attribute20
576       => p_rec.val_attribute20
577       ,p_val_information_category
578       => p_rec.val_information_category
579       ,p_val_information1
580       => p_rec.val_information1
581       ,p_val_information2
582       => p_rec.val_information2
583       ,p_val_information3
584       => p_rec.val_information3
585       ,p_val_information4
586       => p_rec.val_information4
587       ,p_val_information5
588       => p_rec.val_information5
589       ,p_val_information6
590       => p_rec.val_information6
591       ,p_val_information7
592       => p_rec.val_information7
593       ,p_val_information8
594       => p_rec.val_information8
595       ,p_val_information9
596       => p_rec.val_information9
597       ,p_val_information10
598       => p_rec.val_information10
599       ,p_val_information11
600       => p_rec.val_information11
601       ,p_val_information12
602       => p_rec.val_information12
603       ,p_val_information13
604       => p_rec.val_information13
605       ,p_val_information14
606       => p_rec.val_information14
607       ,p_val_information15
608       => p_rec.val_information15
609       ,p_val_information16
610       => p_rec.val_information16
611       ,p_val_information17
612       => p_rec.val_information17
613       ,p_val_information18
614       => p_rec.val_information18
615       ,p_val_information19
616       => p_rec.val_information19
617       ,p_val_information20
618       => p_rec.val_information20
619       ,p_object_version_number
620       => p_rec.object_version_number
621       ,p_fuel_benefit
622       => p_rec.fuel_benefit
623       ,p_sliding_rates_info
624       => p_rec.sliding_rates_info
625       );
626     --
627   exception
628     --
629     when hr_api.cannot_find_prog_unit then
630       --
631       hr_api.cannot_find_prog_unit_error
632         (p_module_name => 'PQP_VEHICLE_ALLOCATIONS_F'
633         ,p_hook_type   => 'AI');
634       --
635   end;
636   --
637   hr_utility.set_location(' Leaving:'||l_proc, 10);
638 End post_insert;
639 --
640 -- ----------------------------------------------------------------------------
641 -- |-------------------------------< ins_lck >--------------------------------|
642 -- ----------------------------------------------------------------------------
643 -- {Start Of Comments}
644 --
645 -- Description:
646 --   The ins_lck process has one main function to perform. When inserting
647 --   a datetracked row, we must validate the DT mode.
648 --
649 -- Prerequisites:
650 --   This procedure can only be called for the datetrack mode of INSERT.
651 --
652 -- In Parameters:
653 --
654 -- Post Success:
655 --   On successful completion of the ins_lck process the parental
656 --   datetracked rows will be locked providing the p_enforce_foreign_locking
657 --   argument value is TRUE.
658 --   If the p_enforce_foreign_locking argument value is FALSE then the
659 --   parential rows are not locked.
660 --
661 -- Post Failure:
662 --   The Lck process can fail for:
663 --   1) When attempting to lock the row the row could already be locked by
664 --      another user. This will raise the HR_Api.Object_Locked exception.
665 --   2) When attempting to the lock the parent which doesn't exist.
666 --      For the entity to be locked the parent must exist!
667 --
668 -- Developer Implementation Notes:
669 --   None.
670 --
671 -- Access Status:
672 --   Internal Row Handler Use Only.
673 --
674 -- {End Of Comments}
675 -- ----------------------------------------------------------------------------
676 Procedure ins_lck
677   (p_effective_date        in date
678   ,p_datetrack_mode        in varchar2
679   ,p_rec                   in pqp_val_shd.g_rec_type
680   ,p_validation_start_date out nocopy date
681   ,p_validation_end_date   out nocopy date
682   ) is
683 --
684   l_proc                  varchar2(72) := g_package||'ins_lck';
685   l_validation_start_date date;
686   l_validation_end_date   date;
687 --
688 Begin
689   hr_utility.set_location('Entering:'||l_proc, 5);
690   --
691   -- Validate the datetrack mode mode getting the validation start
692   -- and end dates for the specified datetrack operation.
693   --
694   dt_api.validate_dt_mode
695     (p_effective_date          => p_effective_date
696     ,p_datetrack_mode          => p_datetrack_mode
697     ,p_base_table_name         => 'pqp_vehicle_allocations_f'
698     ,p_base_key_column         => 'vehicle_allocation_id'
699     ,p_base_key_value          => p_rec.vehicle_allocation_id
700     ,p_parent_table_name1      =>'pqp_vehicle_repository_f'
701     ,p_parent_key_column1      =>'vehicle_repository_id'
702     ,p_parent_key_value1       =>p_rec.vehicle_repository_id
703     ,p_parent_table_name2      =>'per_all_assignments_f'
704     ,p_parent_key_column2      =>'assignment_id'
705     ,p_parent_key_value2       =>p_rec.assignment_id
706     ,p_enforce_foreign_locking => true
707     ,p_validation_start_date   => l_validation_start_date
708     ,p_validation_end_date     => l_validation_end_date
709     );
710   --
711   -- Set the validation start and end date OUT arguments
712   --
713   p_validation_start_date := l_validation_start_date;
714   p_validation_end_date   := l_validation_end_date;
715   --
716   hr_utility.set_location(' Leaving:'||l_proc, 10);
717   --
718 End ins_lck;
719 --
720 -- ----------------------------------------------------------------------------
721 -- |---------------------------------< ins >----------------------------------|
722 -- ----------------------------------------------------------------------------
723 Procedure ins
724   (p_effective_date in     date
725   ,p_rec            in out nocopy pqp_val_shd.g_rec_type
726   ) is
727 --
728   l_proc                        varchar2(72) := g_package||'ins';
729   l_datetrack_mode              varchar2(30) := hr_api.g_insert;
730   l_validation_start_date       date;
731   l_validation_end_date         date;
732 --
733 Begin
734   hr_utility.set_location('Entering:'||l_proc, 5);
735   --
736   -- Call the lock operation
737   --
738   pqp_val_ins.ins_lck
739     (p_effective_date        => p_effective_date
740     ,p_datetrack_mode        => l_datetrack_mode
741     ,p_rec                   => p_rec
742     ,p_validation_start_date => l_validation_start_date
743     ,p_validation_end_date   => l_validation_end_date
744     );
745   --
746   -- Call the supporting insert validate operations
747   --
748   pqp_val_bus.insert_validate
749     (p_rec                   => p_rec
750     ,p_effective_date        => p_effective_date
751     ,p_datetrack_mode        => l_datetrack_mode
752     ,p_validation_start_date => l_validation_start_date
753     ,p_validation_end_date   => l_validation_end_date
754     );
755   --
756   -- Call to raise any errors on multi-message list
757   hr_multi_message.end_validation_set;
758   --
759   -- Call the supporting pre-insert operation
760   --
761   pqp_val_ins.pre_insert
762     (p_rec                   => p_rec
763     ,p_effective_date        => p_effective_date
764     ,p_datetrack_mode        => l_datetrack_mode
765     ,p_validation_start_date => l_validation_start_date
766     ,p_validation_end_date   => l_validation_end_date
767     );
768   --
769   -- Insert the row
770   --
771   pqp_val_ins.insert_dml
772     (p_rec                   => p_rec
773     ,p_effective_date        => p_effective_date
774     ,p_datetrack_mode        => l_datetrack_mode
775     ,p_validation_start_date => l_validation_start_date
776     ,p_validation_end_date   => l_validation_end_date
777     );
778   --
779   -- Call the supporting post-insert operation
780   --
781   pqp_val_ins.post_insert
782     (p_rec                   => p_rec
783     ,p_effective_date        => p_effective_date
784     ,p_datetrack_mode        => l_datetrack_mode
785     ,p_validation_start_date => l_validation_start_date
786     ,p_validation_end_date   => l_validation_end_date
787     );
788   --
789   -- Call to raise any errors on multi-message list
790   hr_multi_message.end_validation_set;
791   --
792   hr_utility.set_location('Leaving:'||l_proc,10);
793 end ins;
794 --
795 -- ----------------------------------------------------------------------------
796 -- |---------------------------------< ins >----------------------------------|
797 -- ----------------------------------------------------------------------------
798 Procedure ins
799   (p_effective_date                 in     date
800   ,p_assignment_id                  in     number
801   ,p_business_group_id              in     number
802   ,p_vehicle_repository_id          in     number
803   ,p_across_assignments             in     varchar2
804   ,p_usage_type                     in     varchar2
805   ,p_capital_contribution           in     number
806   ,p_private_contribution           in     number
807   ,p_default_vehicle                in     varchar2
808   ,p_fuel_card                      in     varchar2
809   ,p_fuel_card_number               in     varchar2
810   ,p_calculation_method             in     varchar2
811   ,p_rates_table_id                 in     number
812   ,p_element_type_id                in     number
813   ,p_private_use_flag               in     varchar2
814   ,p_insurance_number               in     varchar2
815   ,p_insurance_expiry_date          in    date
816   ,p_val_attribute_category         in     varchar2
817   ,p_val_attribute1                 in     varchar2
818   ,p_val_attribute2                 in     varchar2
819   ,p_val_attribute3                 in     varchar2
820   ,p_val_attribute4                 in     varchar2
821   ,p_val_attribute5                 in     varchar2
822   ,p_val_attribute6                 in     varchar2
823   ,p_val_attribute7                 in     varchar2
824   ,p_val_attribute8                 in     varchar2
825   ,p_val_attribute9                 in     varchar2
826   ,p_val_attribute10                in     varchar2
827   ,p_val_attribute11                in     varchar2
828   ,p_val_attribute12                in     varchar2
829   ,p_val_attribute13                in     varchar2
830   ,p_val_attribute14                in     varchar2
831   ,p_val_attribute15                in     varchar2
832   ,p_val_attribute16                in     varchar2
833   ,p_val_attribute17                in     varchar2
834   ,p_val_attribute18                in     varchar2
835   ,p_val_attribute19                in     varchar2
836   ,p_val_attribute20                in     varchar2
837   ,p_val_information_category       in     varchar2
838   ,p_val_information1               in     varchar2
839   ,p_val_information2               in     varchar2
840   ,p_val_information3               in     varchar2
841   ,p_val_information4               in     varchar2
842   ,p_val_information5               in     varchar2
843   ,p_val_information6               in     varchar2
844   ,p_val_information7               in     varchar2
845   ,p_val_information8               in     varchar2
846   ,p_val_information9               in     varchar2
847   ,p_val_information10              in     varchar2
848   ,p_val_information11              in     varchar2
849   ,p_val_information12              in     varchar2
850   ,p_val_information13              in     varchar2
851   ,p_val_information14              in     varchar2
852   ,p_val_information15              in     varchar2
853   ,p_val_information16              in     varchar2
854   ,p_val_information17              in     varchar2
855   ,p_val_information18              in     varchar2
856   ,p_val_information19              in     varchar2
857   ,p_val_information20              in     varchar2
858   ,p_fuel_benefit                   in     varchar2
859   ,p_sliding_rates_info                  in varchar2
860   ,p_vehicle_allocation_id          out nocopy number
861   ,p_object_version_number          out nocopy number
862   ,p_effective_start_date           out nocopy date
863   ,p_effective_end_date             out nocopy date
864   ) is
865 --
866   l_rec         pqp_val_shd.g_rec_type;
867   l_proc        varchar2(72) := g_package||'ins';
868 --
869 Begin
870   hr_utility.set_location('Entering:'||l_proc, 5);
871   --
872   -- Call conversion function to turn arguments into the
873   -- p_rec structure.
874   --
875   l_rec :=
876   pqp_val_shd.convert_args
877     (null
878     ,null
879     ,null
880     ,p_assignment_id
881     ,p_business_group_id
882     ,p_across_assignments
883     ,p_vehicle_repository_id
884     ,p_usage_type
885     ,p_capital_contribution
886     ,p_private_contribution
887     ,p_default_vehicle
888     ,p_fuel_card
889     ,p_fuel_card_number
890     ,p_calculation_method
891     ,p_rates_table_id
892     ,p_element_type_id
893     ,p_private_use_flag
894     ,p_insurance_number
895     ,p_insurance_expiry_date
896     ,p_val_attribute_category
897     ,p_val_attribute1
898     ,p_val_attribute2
899     ,p_val_attribute3
900     ,p_val_attribute4
901     ,p_val_attribute5
902     ,p_val_attribute6
903     ,p_val_attribute7
904     ,p_val_attribute8
905     ,p_val_attribute9
906     ,p_val_attribute10
907     ,p_val_attribute11
908     ,p_val_attribute12
909     ,p_val_attribute13
910     ,p_val_attribute14
911     ,p_val_attribute15
912     ,p_val_attribute16
913     ,p_val_attribute17
914     ,p_val_attribute18
915     ,p_val_attribute19
916     ,p_val_attribute20
917     ,p_val_information_category
918     ,p_val_information1
919     ,p_val_information2
920     ,p_val_information3
921     ,p_val_information4
922     ,p_val_information5
923     ,p_val_information6
924     ,p_val_information7
925     ,p_val_information8
926     ,p_val_information9
927     ,p_val_information10
928     ,p_val_information11
929     ,p_val_information12
930     ,p_val_information13
931     ,p_val_information14
932     ,p_val_information15
933     ,p_val_information16
934     ,p_val_information17
935     ,p_val_information18
936     ,p_val_information19
937     ,p_val_information20
938     ,null
939     ,p_fuel_benefit
940     ,p_sliding_rates_info
941     );
942   --
943   -- Having converted the arguments into the pqp_val_rec
944   -- plsql record structure we call the corresponding record
945   -- business process.
946   --
947   pqp_val_ins.ins
948     (p_effective_date
949     ,l_rec
950     );
951   --
952   -- Set the OUT arguments.
953   --
954   p_vehicle_allocation_id            := l_rec.vehicle_allocation_id;
955   p_effective_start_date             := l_rec.effective_start_date;
956   p_effective_end_date               := l_rec.effective_end_date;
957   p_object_version_number            := l_rec.object_version_number;
958   --
959   --
960   hr_utility.set_location(' Leaving:'||l_proc, 10);
961 End ins;
962 --
963 end pqp_val_ins;