29: l_exists varchar2(1);
30: l_dynamic_insert_allowed varchar2(1);
31: l_cagr_grade_structure_id number;
32: --
33: cursor csr_in_per_cagr_grades_def is
34: select null
35: from per_cagr_grades_def pcg
36: where pcg.id_flex_num = p_cagr_id_flex_num
37: and pcg.cagr_grade_def_id = p_cagr_grade_def_id;
31: l_cagr_grade_structure_id number;
32: --
33: cursor csr_in_per_cagr_grades_def is
34: select null
35: from per_cagr_grades_def pcg
36: where pcg.id_flex_num = p_cagr_id_flex_num
37: and pcg.cagr_grade_def_id = p_cagr_grade_def_id;
38: --
39: cursor csr_in_cagr_grade_structs is
43: and cgs.collective_agreement_id = p_collective_agreement_id;
44: --
45: cursor csr_in_cagr_grades is
46: select null
47: from per_cagr_grades pcg
48: where pcg.cagr_grade_def_id = p_cagr_grade_def_id
49: and pcg.cagr_grade_structure_id = l_cagr_grade_structure_id;
50: --
51: begin
97: --
98: hr_utility.set_location(l_proc, 40);
99: --
100: --
101: --It must be in per_cagr_grades_def
102: --
103: Open csr_in_per_cagr_grades_def;
104: Fetch csr_in_per_cagr_grades_def into l_exists;
105: if csr_in_per_cagr_grades_def%notfound then
99: --
100: --
101: --It must be in per_cagr_grades_def
102: --
103: Open csr_in_per_cagr_grades_def;
104: Fetch csr_in_per_cagr_grades_def into l_exists;
105: if csr_in_per_cagr_grades_def%notfound then
106: close csr_in_per_cagr_grades_def;
107: -- msg The given grade definition does not exist for the grade structure
100: --
101: --It must be in per_cagr_grades_def
102: --
103: Open csr_in_per_cagr_grades_def;
104: Fetch csr_in_per_cagr_grades_def into l_exists;
105: if csr_in_per_cagr_grades_def%notfound then
106: close csr_in_per_cagr_grades_def;
107: -- msg The given grade definition does not exist for the grade structure
108: hr_utility.set_location(l_proc, 50);
101: --It must be in per_cagr_grades_def
102: --
103: Open csr_in_per_cagr_grades_def;
104: Fetch csr_in_per_cagr_grades_def into l_exists;
105: if csr_in_per_cagr_grades_def%notfound then
106: close csr_in_per_cagr_grades_def;
107: -- msg The given grade definition does not exist for the grade structure
108: hr_utility.set_location(l_proc, 50);
109: hr_utility.set_message(800, 'PER_52807_GRADE_NOT_STRUCT');
102: --
103: Open csr_in_per_cagr_grades_def;
104: Fetch csr_in_per_cagr_grades_def into l_exists;
105: if csr_in_per_cagr_grades_def%notfound then
106: close csr_in_per_cagr_grades_def;
107: -- msg The given grade definition does not exist for the grade structure
108: hr_utility.set_location(l_proc, 50);
109: hr_utility.set_message(800, 'PER_52807_GRADE_NOT_STRUCT');
110: hr_utility.raise_error;
108: hr_utility.set_location(l_proc, 50);
109: hr_utility.set_message(800, 'PER_52807_GRADE_NOT_STRUCT');
110: hr_utility.raise_error;
111: Else
112: close csr_in_per_cagr_grades_def;
113: End If;
114: -- It must exist in per_cagr_grade_structures
115: Open csr_in_cagr_grade_structs;
116: Fetch csr_in_cagr_grade_structs Into l_dynamic_insert_allowed,