1: Package Body ame_con_ins as
2: /* $Header: amconrhi.pkb 120.6 2006/01/12 22:43 pvelugul noship $ */
3: --
4: -- ----------------------------------------------------------------------------
5: -- | Private Global Definitions |
4: -- ----------------------------------------------------------------------------
5: -- | Private Global Definitions |
6: -- ----------------------------------------------------------------------------
7: --
8: g_package varchar2(33) := ' ame_con_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: --
85: --
86: Begin
87: hr_utility.set_location('Entering:'||l_proc, 10);
88: --
89: ame_con_ins.g_condition_id_i := p_condition_id;
90: --
91: hr_utility.set_location(' Leaving:'||l_proc, 20);
92: End set_base_key_value;
93: --
323: --
324: Begin
325: hr_utility.set_location('Entering:'||l_proc, 5);
326: --
327: ame_con_ins.dt_insert_dml
328: (p_rec => p_rec
329: ,p_effective_date => p_effective_date
330: ,p_datetrack_mode => p_datetrack_mode
331: ,p_validation_start_date => p_validation_start_date
387: Cursor C_Sel2 is
388: Select null
389: from ame_conditions
390: where condition_id =
391: ame_con_ins.g_condition_id_i
392: and p_effective_date between start_date
393: and nvl(end_date - ame_util.oneSecond , p_effective_date);
394: --
395: l_proc varchar2(72) := g_package||'pre_insert';
397: --
398: Begin
399: hr_utility.set_location('Entering:'||l_proc, 5);
400: --
401: If (ame_con_ins.g_condition_id_i is not null) Then
402: --
403: -- Verify registered primary key values not already in use
404: --
405: Open C_Sel2;
417: --
418: -- Use registered key values and clear globals
419: --
420: p_rec.condition_id :=
421: ame_con_ins.g_condition_id_i;
422: ame_con_ins.g_condition_id_i := null;
423: Else
424: --
425: -- No registerd key values, so select the next sequence number
418: -- Use registered key values and clear globals
419: --
420: p_rec.condition_id :=
421: ame_con_ins.g_condition_id_i;
422: ame_con_ins.g_condition_id_i := null;
423: Else
424: --
425: -- No registerd key values, so select the next sequence number
426: --
623: end if;
624: --
625: -- Call the lock operation
626: --
627: ame_con_ins.ins_lck
628: (p_effective_date => p_effective_date
629: ,p_datetrack_mode => l_datetrack_mode
630: ,p_rec => p_rec
631: ,p_validation_start_date => l_validation_start_date
646: hr_multi_message.end_validation_set;
647: --
648: -- Call the supporting pre-insert operation
649: --
650: ame_con_ins.pre_insert
651: (p_rec => p_rec
652: ,p_effective_date => p_effective_date
653: ,p_datetrack_mode => l_datetrack_mode
654: ,p_validation_start_date => l_validation_start_date
656: );
657: --
658: -- Insert the row
659: --
660: ame_con_ins.insert_dml
661: (p_rec => p_rec
662: ,p_effective_date => p_effective_date
663: ,p_datetrack_mode => l_datetrack_mode
664: ,p_validation_start_date => l_validation_start_date
666: );
667: --
668: -- Call the supporting post-insert operation
669: --
670: ame_con_ins.post_insert
671: (p_rec => p_rec
672: ,p_effective_date => p_effective_date
673: ,p_datetrack_mode => l_datetrack_mode
674: ,p_validation_start_date => l_validation_start_date
730: -- Having converted the arguments into the ame_con_rec
731: -- plsql record structure we call the corresponding record
732: -- business process.
733: --
734: ame_con_ins.ins
735: (p_effective_date
736: ,l_rec
737: );
738: --
746: --
747: hr_utility.set_location(' Leaving:'||l_proc, 10);
748: End ins;
749: --
750: end ame_con_ins;