2: /* $Header: pepemsai.pkb 115.0 2003/09/10 02:12:48 adevanat noship $ */
3:
4: -- Package Variables
5: g_package VARCHAR2(33) := 'hr_sa_previous_employment_api.';
6: g_debug boolean := hr_utility.debug_enabled;
7:
8: procedure create_sa_previous_employer
9: ( p_effective_date IN date
10: ,p_validate IN boolean default false
85: begin
86:
87: l_proc := g_package||'create_sa_previous_employer';
88: if g_debug then
89: hr_utility.set_location('Entering:'|| l_proc, 5);
90: end if;
91: --
92: -- Initialise local variables
93: --
100: open check_legislation(p_person_id, l_effective_date);
101: fetch check_legislation into l_legislation_code;
102: if check_legislation%notfound then
103: close check_legislation;
104: hr_utility.set_message(801,'HR_7220_INVALID_PRIMARY_KEY');
105: hr_utility.raise_error;
106: end if;
107: close check_legislation;
108: if g_debug then
101: fetch check_legislation into l_legislation_code;
102: if check_legislation%notfound then
103: close check_legislation;
104: hr_utility.set_message(801,'HR_7220_INVALID_PRIMARY_KEY');
105: hr_utility.raise_error;
106: end if;
107: close check_legislation;
108: if g_debug then
109: hr_utility.set_location(l_proc, 20);
105: hr_utility.raise_error;
106: end if;
107: close check_legislation;
108: if g_debug then
109: hr_utility.set_location(l_proc, 20);
110: end if;
111: --
112: -- Check that the legislation of the specified business group is 'SA'.
113: --
111: --
112: -- Check that the legislation of the specified business group is 'SA'.
113: --
114: if l_legislation_code <> 'SA' then
115: hr_utility.set_message(801, 'HR_7961_PER_BUS_GRP_INVALID');
116: hr_utility.set_message_token('LEG_CODE','SA');
117: hr_utility.raise_error;
118: end if;
119: if g_debug then
112: -- Check that the legislation of the specified business group is 'SA'.
113: --
114: if l_legislation_code <> 'SA' then
115: hr_utility.set_message(801, 'HR_7961_PER_BUS_GRP_INVALID');
116: hr_utility.set_message_token('LEG_CODE','SA');
117: hr_utility.raise_error;
118: end if;
119: if g_debug then
120: hr_utility.set_location(l_proc, 30);
113: --
114: if l_legislation_code <> 'SA' then
115: hr_utility.set_message(801, 'HR_7961_PER_BUS_GRP_INVALID');
116: hr_utility.set_message_token('LEG_CODE','SA');
117: hr_utility.raise_error;
118: end if;
119: if g_debug then
120: hr_utility.set_location(l_proc, 30);
121: end if;
116: hr_utility.set_message_token('LEG_CODE','SA');
117: hr_utility.raise_error;
118: end if;
119: if g_debug then
120: hr_utility.set_location(l_proc, 30);
121: end if;
122: --
123: -- Create the previous employer record using the create_previous_employer
124: --
178: );
179:
180: --
181: if g_debug then
182: hr_utility.set_location(' Leaving:'||l_proc, 40);
183: end if;
184: --
185: end create_sa_previous_employer;
186:
263: begin
264:
265: l_proc := g_package||'update_sa_previous_employer';
266: if g_debug then
267: hr_utility.set_location('Entering:'|| l_proc, 5);
268: end if;
269: --
270: -- Initialise local variables
271: --
278: open check_legislation(p_previous_employer_id, l_effective_date);
279: fetch check_legislation into l_legislation_code;
280: if check_legislation%notfound then
281: close check_legislation;
282: hr_utility.set_message(801,'HR_7220_INVALID_PRIMARY_KEY');
283: hr_utility.raise_error;
284: end if;
285: close check_legislation;
286: if g_debug then
279: fetch check_legislation into l_legislation_code;
280: if check_legislation%notfound then
281: close check_legislation;
282: hr_utility.set_message(801,'HR_7220_INVALID_PRIMARY_KEY');
283: hr_utility.raise_error;
284: end if;
285: close check_legislation;
286: if g_debug then
287: hr_utility.set_location(l_proc, 20);
283: hr_utility.raise_error;
284: end if;
285: close check_legislation;
286: if g_debug then
287: hr_utility.set_location(l_proc, 20);
288: end if;
289: --
290: -- Check that the legislation of the specified business group is 'SA'.
291: --
289: --
290: -- Check that the legislation of the specified business group is 'SA'.
291: --
292: if l_legislation_code <> 'SA' then
293: hr_utility.set_message(801, 'HR_7961_PER_BUS_GRP_INVALID');
294: hr_utility.set_message_token('LEG_CODE','SA');
295: hr_utility.raise_error;
296: end if;
297: if g_debug then
290: -- Check that the legislation of the specified business group is 'SA'.
291: --
292: if l_legislation_code <> 'SA' then
293: hr_utility.set_message(801, 'HR_7961_PER_BUS_GRP_INVALID');
294: hr_utility.set_message_token('LEG_CODE','SA');
295: hr_utility.raise_error;
296: end if;
297: if g_debug then
298: hr_utility.set_location(l_proc, 30);
291: --
292: if l_legislation_code <> 'SA' then
293: hr_utility.set_message(801, 'HR_7961_PER_BUS_GRP_INVALID');
294: hr_utility.set_message_token('LEG_CODE','SA');
295: hr_utility.raise_error;
296: end if;
297: if g_debug then
298: hr_utility.set_location(l_proc, 30);
299: end if;
294: hr_utility.set_message_token('LEG_CODE','SA');
295: hr_utility.raise_error;
296: end if;
297: if g_debug then
298: hr_utility.set_location(l_proc, 30);
299: end if;
300: --
301: -- Create the previous employer record using the create_previous_employer
302: --
352: ,p_object_version_number => p_object_version_number
353: );
354: --
355: if g_debug then
356: hr_utility.set_location(' Leaving:'||l_proc, 40);
357: end if;
358: --
359: end update_sa_previous_employer;
360: