1: Package Body ame_stv_ins as
2: /* $Header: amstvrhi.pkb 120.2 2005/11/22 03:20 santosin noship $ */
3: --
4: -- ----------------------------------------------------------------------------
5: -- | Private Global Definitions |
4: -- ----------------------------------------------------------------------------
5: -- | Private Global Definitions |
6: -- ----------------------------------------------------------------------------
7: --
8: g_package varchar2(33) := ' ame_stv_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: --
24: --
25: Begin
26: hr_utility.set_location('Entering:'||l_proc, 10);
27: --
28: ame_stv_ins.g_condition_id_i := p_condition_id;
29: ame_stv_ins.g_string_value_i := p_string_value;
30: --
31: hr_utility.set_location(' Leaving:'||l_proc, 20);
32: End set_base_key_value;
25: Begin
26: hr_utility.set_location('Entering:'||l_proc, 10);
27: --
28: ame_stv_ins.g_condition_id_i := p_condition_id;
29: ame_stv_ins.g_string_value_i := p_string_value;
30: --
31: hr_utility.set_location(' Leaving:'||l_proc, 20);
32: End set_base_key_value;
33: --
252: --
253: Begin
254: hr_utility.set_location('Entering:'||l_proc, 5);
255: --
256: ame_stv_ins.dt_insert_dml
257: (p_rec => p_rec
258: ,p_effective_date => p_effective_date
259: ,p_datetrack_mode => p_datetrack_mode
260: ,p_validation_start_date => p_validation_start_date
316: Cursor C_Sel2 is
317: Select null
318: from ame_string_values
319: where condition_id =
320: ame_stv_ins.g_condition_id_i
321: and string_value =
322: ame_stv_ins.g_string_value_i
323: and p_effective_date between start_date
324: and nvl(end_date - ame_util.oneSecond , p_effective_date);
318: from ame_string_values
319: where condition_id =
320: ame_stv_ins.g_condition_id_i
321: and string_value =
322: ame_stv_ins.g_string_value_i
323: and p_effective_date between start_date
324: and nvl(end_date - ame_util.oneSecond , p_effective_date);
325: --
326: l_proc varchar2(72) := g_package||'pre_insert';
328: --
329: Begin
330: hr_utility.set_location('Entering:'||l_proc, 5);
331: --
332: If (ame_stv_ins.g_condition_id_i is not null or
333: ame_stv_ins.g_string_value_i is not null) Then
334: --
335: -- Verify registered primary key values not already in use
336: --
329: Begin
330: hr_utility.set_location('Entering:'||l_proc, 5);
331: --
332: If (ame_stv_ins.g_condition_id_i is not null or
333: ame_stv_ins.g_string_value_i is not null) Then
334: --
335: -- Verify registered primary key values not already in use
336: --
337: Open C_Sel2;
349: --
350: -- Use registered key values and clear globals
351: --
352: p_rec.condition_id :=
353: ame_stv_ins.g_condition_id_i;
354: ame_stv_ins.g_condition_id_i := null;
355: p_rec.string_value :=
356: ame_stv_ins.g_string_value_i;
357: ame_stv_ins.g_string_value_i := null;
350: -- Use registered key values and clear globals
351: --
352: p_rec.condition_id :=
353: ame_stv_ins.g_condition_id_i;
354: ame_stv_ins.g_condition_id_i := null;
355: p_rec.string_value :=
356: ame_stv_ins.g_string_value_i;
357: ame_stv_ins.g_string_value_i := null;
358: /*Else
352: p_rec.condition_id :=
353: ame_stv_ins.g_condition_id_i;
354: ame_stv_ins.g_condition_id_i := null;
355: p_rec.string_value :=
356: ame_stv_ins.g_string_value_i;
357: ame_stv_ins.g_string_value_i := null;
358: /*Else
359: --
360: -- No registerd key values, so select the next sequence number
353: ame_stv_ins.g_condition_id_i;
354: ame_stv_ins.g_condition_id_i := null;
355: p_rec.string_value :=
356: ame_stv_ins.g_string_value_i;
357: ame_stv_ins.g_string_value_i := null;
358: /*Else
359: --
360: -- No registerd key values, so select the next sequence number
361: --
556: hr_utility.set_location('Entering:'||l_proc, 5);
557: --
558: -- Call the lock operation
559: --
560: ame_stv_ins.ins_lck
561: (p_effective_date => p_effective_date
562: ,p_datetrack_mode => l_datetrack_mode
563: ,p_rec => p_rec
564: ,p_validation_start_date => l_validation_start_date
579: hr_multi_message.end_validation_set;
580: --
581: -- Call the supporting pre-insert operation
582: --
583: ame_stv_ins.pre_insert
584: (p_rec => p_rec
585: ,p_effective_date => p_effective_date
586: ,p_datetrack_mode => l_datetrack_mode
587: ,p_validation_start_date => l_validation_start_date
589: );
590: --
591: -- Insert the row
592: --
593: ame_stv_ins.insert_dml
594: (p_rec => p_rec
595: ,p_effective_date => p_effective_date
596: ,p_datetrack_mode => l_datetrack_mode
597: ,p_validation_start_date => l_validation_start_date
599: );
600: --
601: -- Call the supporting post-insert operation
602: --
603: ame_stv_ins.post_insert
604: (p_rec => p_rec
605: ,p_effective_date => p_effective_date
606: ,p_datetrack_mode => l_datetrack_mode
607: ,p_validation_start_date => l_validation_start_date
649: -- Having converted the arguments into the ame_stv_rec
650: -- plsql record structure we call the corresponding record
651: -- business process.
652: --
653: ame_stv_ins.ins
654: (p_effective_date
655: ,l_rec
656: );
657: --
664: --
665: hr_utility.set_location(' Leaving:'||l_proc, 10);
666: End ins;
667: --
668: end ame_stv_ins;