47: l_integrity_error Exception;
48: l_table_name all_tables.table_name%TYPE;
49: --
50: Begin
51: hr_utility.set_location('Entering:'||l_proc, 5);
52: --
53: -- Ensure that the p_datetrack_mode argument is not null
54: --
55: hr_api.mandatory_arg_error
88: --
89: --
90: End If;
91: --
92: hr_utility.set_location(' Leaving:'||l_proc, 10);
93: Exception
94: When l_integrity_error Then
95: --
96: -- A referential integrity check was violated therefore
95: --
96: -- A referential integrity check was violated therefore
97: -- we must error
98: --
99: hr_utility.set_message(801, 'HR_7216_DT_UPD_INTEGRITY_ERR');
100: hr_utility.set_message_token('TABLE_NAME', l_table_name);
101: hr_utility.raise_error;
102: When Others Then
103: --
96: -- A referential integrity check was violated therefore
97: -- we must error
98: --
99: hr_utility.set_message(801, 'HR_7216_DT_UPD_INTEGRITY_ERR');
100: hr_utility.set_message_token('TABLE_NAME', l_table_name);
101: hr_utility.raise_error;
102: When Others Then
103: --
104: -- An unhandled or unexpected error has occurred which
97: -- we must error
98: --
99: hr_utility.set_message(801, 'HR_7216_DT_UPD_INTEGRITY_ERR');
100: hr_utility.set_message_token('TABLE_NAME', l_table_name);
101: hr_utility.raise_error;
102: When Others Then
103: --
104: -- An unhandled or unexpected error has occurred which
105: -- we must report
103: --
104: -- An unhandled or unexpected error has occurred which
105: -- we must report
106: --
107: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
108: hr_utility.set_message_token('PROCEDURE', l_proc);
109: hr_utility.set_message_token('STEP','15');
110: hr_utility.raise_error;
111: End dt_update_validate;
104: -- An unhandled or unexpected error has occurred which
105: -- we must report
106: --
107: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
108: hr_utility.set_message_token('PROCEDURE', l_proc);
109: hr_utility.set_message_token('STEP','15');
110: hr_utility.raise_error;
111: End dt_update_validate;
112: --
105: -- we must report
106: --
107: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
108: hr_utility.set_message_token('PROCEDURE', l_proc);
109: hr_utility.set_message_token('STEP','15');
110: hr_utility.raise_error;
111: End dt_update_validate;
112: --
113: -- ----------------------------------------------------------------------------
106: --
107: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
108: hr_utility.set_message_token('PROCEDURE', l_proc);
109: hr_utility.set_message_token('STEP','15');
110: hr_utility.raise_error;
111: End dt_update_validate;
112: --
113: -- ----------------------------------------------------------------------------
114: -- |--------------------------< dt_delete_validate >--------------------------|
155: l_rows_exist Exception;
156: l_table_name all_tables.table_name%TYPE;
157: --
158: Begin
159: hr_utility.set_location('Entering:'||l_proc, 5);
160: --
161: -- Ensure that the p_datetrack_mode argument is not null
162: --
163: hr_api.mandatory_arg_error
192: --
193: --
194: End If;
195: --
196: hr_utility.set_location(' Leaving:'||l_proc, 10);
197: Exception
198: When l_rows_exist Then
199: --
200: -- A referential integrity check was violated therefore
199: --
200: -- A referential integrity check was violated therefore
201: -- we must error
202: --
203: hr_utility.set_message(801, 'HR_7215_DT_CHILD_EXISTS');
204: hr_utility.set_message_token('TABLE_NAME', l_table_name);
205: hr_utility.raise_error;
206: When Others Then
207: --
200: -- A referential integrity check was violated therefore
201: -- we must error
202: --
203: hr_utility.set_message(801, 'HR_7215_DT_CHILD_EXISTS');
204: hr_utility.set_message_token('TABLE_NAME', l_table_name);
205: hr_utility.raise_error;
206: When Others Then
207: --
208: -- An unhandled or unexpected error has occurred which
201: -- we must error
202: --
203: hr_utility.set_message(801, 'HR_7215_DT_CHILD_EXISTS');
204: hr_utility.set_message_token('TABLE_NAME', l_table_name);
205: hr_utility.raise_error;
206: When Others Then
207: --
208: -- An unhandled or unexpected error has occurred which
209: -- we must report
207: --
208: -- An unhandled or unexpected error has occurred which
209: -- we must report
210: --
211: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
212: hr_utility.set_message_token('PROCEDURE', l_proc);
213: hr_utility.set_message_token('STEP','15');
214: hr_utility.raise_error;
215: End dt_delete_validate;
208: -- An unhandled or unexpected error has occurred which
209: -- we must report
210: --
211: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
212: hr_utility.set_message_token('PROCEDURE', l_proc);
213: hr_utility.set_message_token('STEP','15');
214: hr_utility.raise_error;
215: End dt_delete_validate;
216: --
209: -- we must report
210: --
211: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
212: hr_utility.set_message_token('PROCEDURE', l_proc);
213: hr_utility.set_message_token('STEP','15');
214: hr_utility.raise_error;
215: End dt_delete_validate;
216: --
217: --
210: --
211: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
212: hr_utility.set_message_token('PROCEDURE', l_proc);
213: hr_utility.set_message_token('STEP','15');
214: hr_utility.raise_error;
215: End dt_delete_validate;
216: --
217: --
218: --
248: --
249: l_proc varchar2(72) := g_package||'chk_df';
250: --
251: begin
252: hr_utility.set_location('Entering:'||l_proc, 10);
253: --
254: if ((p_rec.person_type_usage_id is not null) and (
255: nvl(per_ptu_shd.g_old_rec.attribute_category, hr_api.g_varchar2) <>
256: nvl(p_rec.attribute_category, hr_api.g_varchar2) or
388: ,p_attribute30_value => p_rec.attribute30
389: );
390: end if;
391: --
392: hr_utility.set_location(' Leaving:'||l_proc, 20);
393: end check_df;
394: --
395: -- --------------------------------------------------------------------------
396: -- |---------------------< chk_non_updateable_args >------------------------|
404: l_error exception;
405: l_argument varchar2(30);
406: --
407: Begin
408: hr_utility.set_location('Entering:'||l_proc, 10);
409: --
410: -- Only proceed with validation if a row exists for
411: -- the current record in the HR Schema
412: --
414: (p_person_type_usage_id => p_rec.person_type_usage_id
415: ,p_object_version_number => p_rec.object_version_number
416: ,p_effective_date => p_effective_date
417: ) then
418: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
419: hr_utility.set_message_token('PROCEDURE', l_proc);
420: hr_utility.set_message_token('STEP', '20');
421: end if;
422: hr_utility.set_location(l_proc, 30);
415: ,p_object_version_number => p_rec.object_version_number
416: ,p_effective_date => p_effective_date
417: ) then
418: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
419: hr_utility.set_message_token('PROCEDURE', l_proc);
420: hr_utility.set_message_token('STEP', '20');
421: end if;
422: hr_utility.set_location(l_proc, 30);
423: --
416: ,p_effective_date => p_effective_date
417: ) then
418: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
419: hr_utility.set_message_token('PROCEDURE', l_proc);
420: hr_utility.set_message_token('STEP', '20');
421: end if;
422: hr_utility.set_location(l_proc, 30);
423: --
424: -- Bug# 2195731 Starts here. If Condition changed.
418: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
419: hr_utility.set_message_token('PROCEDURE', l_proc);
420: hr_utility.set_message_token('STEP', '20');
421: end if;
422: hr_utility.set_location(l_proc, 30);
423: --
424: -- Bug# 2195731 Starts here. If Condition changed.
425: --
426: if p_rec.person_id <> per_ptu_shd.g_old_rec.person_id then
429: end if;
430: --
431: -- Bug# 2195731 Ends here.
432: --
433: hr_utility.set_location(l_proc, 50);
434: --
435: exception
436: when l_error then
437: hr_api.argument_changed_error
439: ,p_argument => l_argument
440: );
441: when others then
442: raise;
443: hr_utility.set_location(' Leaving:'||l_proc, 100);
444: end chk_non_updateable_args;
445:
446: --
447: -- -----------------------------------------------------------------
482: from per_all_people_f
483: where person_id = p_person_id;
484: --
485: begin
486: hr_utility.set_location('Entering: '||l_proc,5);
487: --
488: --------------------------------
489: -- Check person id not null --
490: --------------------------------
503: per_ptu_shd.constraint_error('PER_PERSON_TYPE_USAGES_F_FK1');
504: end if;
505: close csr_valid_person_id;
506:
507: hr_utility.set_location('Leaving: '||l_proc,10);
508: end chk_person_id;
509: --
510: --
511: -- -----------------------------------------------------------------
577: effective_end_date >= p_effective_date) or
578: (effective_start_date >= p_effective_date));
579: --
580: begin
581: hr_utility.set_location('Entering: '||l_proc,5);
582: --
583: -----------------------------------
584: -- Check person type id not null --
585: -----------------------------------
599: --
600: -- We are initially checking only for valid person types
601: -- i.e. those that can be maintained by the user
602: --
603: hr_utility.set_location('At: '||l_proc,10);
604:
605: if ((l_api_updating and
606: per_ptu_shd.g_old_rec.person_type_id <> p_person_type_id) or
607: (not l_api_updating)) then
615: per_ptu_shd.constraint_error('PER_PERSON_TYPE_USAGES_F_FK2');
616: end if;
617: close csr_valid_person_type;
618:
619: hr_utility.set_location('At: '||l_proc,15);
620: --
621: -- Based on whether this is called call the relevant procedure
622: --
623: if ( not l_api_updating ) THEN
634: per_ptu_shd.constraint_error('PER_PERSON_TYPE_USAGES_F_FK2');
635: end if;
636: --
637: --
638: hr_utility.set_location('At: '||l_proc,20);
639: ----------------------------------------
640: -- Check uniqueness of created record --
641: ----------------------------------------
642: --
655: -- is the same as the existing one
656: -- As per business rules person type can be updated from one
657: -- flavour to an other.
658:
659: hr_utility.set_location('At: '||l_proc,25);
660:
661:
662: -----------------------------------
663: -- Check person type id is valid --
685:
686: end if;
687: end if;
688:
689: hr_utility.set_location('Leaving: '||l_proc,50);
690: end chk_person_type_id;
691: --
692: -- ----------------------------------------------------------------------------
693: -- |---------------------------< insert_validate >----------------------------|
701: --
702: l_proc varchar2(72) := g_package||'insert_validate';
703: --
704: Begin
705: hr_utility.set_location('Entering:'||l_proc, 5);
706: --
707: per_per_bus.set_security_group_id
708: (
709: p_person_id => p_rec.person_id
708: (
709: p_person_id => p_rec.person_id
710: );
711: --
712: hr_utility.set_location('Entering:'||l_proc, 7);
713: --
714: -- Call all supporting business operations
715: --
716: -- Validate the Person Id
728: -- Call descriptive flexfield validation routines
729: --
730: per_ptu_bus.check_df(p_rec => p_rec);
731: --
732: hr_utility.set_location(' Leaving:'||l_proc, 10);
733: End insert_validate;
734: --
735: -- ----------------------------------------------------------------------------
736: -- |---------------------------< update_validate >----------------------------|
744: --
745: l_proc varchar2(72) := g_package||'update_validate';
746: --
747: Begin
748: hr_utility.set_location('Entering:'||l_proc, 5);
749: --
750: per_per_bus.set_security_group_id
751: (
752: p_person_id => p_rec.person_id
750: per_per_bus.set_security_group_id
751: (
752: p_person_id => p_rec.person_id
753: );
754: hr_utility.set_location('Entering:'||l_proc, 7);
755: --
756: -- Call all supporting business operations
757: --
758: chk_non_updateable_args
779: -- Call descriptive flexfield validation routines
780: --
781: per_ptu_bus.check_df(p_rec => p_rec);
782: --
783: hr_utility.set_location(' Leaving:'||l_proc, 10);
784: End update_validate;
785: --
786: -- ----------------------------------------------------------------------------
787: -- |---------------------------< delete_validate >----------------------------|
795: --
796: l_proc varchar2(72) := g_package||'delete_validate';
797: --
798: Begin
799: hr_utility.set_location('Entering:'||l_proc, 5);
800: --
801: -- Call all supporting business operations
802: --
803: --chk_is_valid_delete(p_person_type_usage_id => p_rec.person_type_usage_id,
808: p_validation_start_date => p_validation_start_date,
809: p_validation_end_date => p_validation_end_date,
810: p_person_type_usage_id => p_rec.person_type_usage_id);
811: --
812: hr_utility.set_location(' Leaving:'||l_proc, 10);
813: End delete_validate;
814: --
815: --
816: -- ---------------------------------------------------------------------------
836: --
837: l_legislation_code varchar2(150);
838: l_proc varchar2(72) := 'return_legislation_code';
839: begin
840: hr_utility.set_location('Entering:'|| l_proc, 10);
841: --
842: -- Ensure that all the mandatory parameter are not null
843: --
844: hr_api.mandatory_arg_error(p_api_name => l_proc,
851: -- call to this function. Just return the value in the global
852: -- variable.
853: --
854: l_legislation_code := g_legislation_code;
855: hr_utility.set_location(l_proc, 20);
856: else
857: --
858: -- The ID is different to the last call to this function
859: -- or this is the first call to this function.
864: --
865: -- The primary key is invalid therefore we must error
866: --
867: close csr_leg_code;
868: hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
869: hr_utility.raise_error;
870: end if;
871: hr_utility.set_location(l_proc, 30);
872: --
865: -- The primary key is invalid therefore we must error
866: --
867: close csr_leg_code;
868: hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
869: hr_utility.raise_error;
870: end if;
871: hr_utility.set_location(l_proc, 30);
872: --
873: -- Set the global variables so the values are
867: close csr_leg_code;
868: hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
869: hr_utility.raise_error;
870: end if;
871: hr_utility.set_location(l_proc, 30);
872: --
873: -- Set the global variables so the values are
874: -- available for the next call to this function
875: --
876: close csr_leg_code;
877: g_person_type_usage_id := p_person_type_usage_id;
878: g_legislation_code := l_legislation_code;
879: end if;
880: hr_utility.set_location(' Leaving:'|| l_proc, 40);
881: --
882: return l_legislation_code;
883: end return_legislation_code;
884: --