[Home] [Help]
PACKAGE BODY: APPS.PQH_DE_VLDLVL_API
Source
1 Package Body PQH_DE_VLDLVL_API as
2 /* $Header: pqlvlapi.pkb 115.1 2002/12/03 00:08:32 rpasapul noship $ */
3 --
4 -- Package Variables
5 --
6 g_package varchar2(33) := 'PQH_DE_VLDLVL_API.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |--------------------------< Insert_Vldtn_JobFTRS >------------------------|
10 -- ----------------------------------------------------------------------------
11 --
12 procedure Insert_Vldtn_Lvl
13 (p_validate in boolean default false
14 ,p_effective_date in date
15 ,p_business_group_id in number
16 ,P_WRKPLC_VLDTN_VER_ID In Number
17 ,P_LEVEL_NUMBER_ID In Number
18 ,P_LEVEL_CODE_ID In Number
19 ,P_WRKPLC_VLDTN_LVLNUM_Id out nocopy Number
20 ,p_object_version_number out nocopy number) is
21 --
22 -- Declare cursors and local variables
23 --
24
25 l_proc varchar2(72) := g_package||'Insert_Vldtn_Lvl';
26 l_object_Version_Number PQH_DE_WRKPLC_VLDTN_LVLNUMS.OBJECT_VERSION_NUMBER%TYPE;
27 L_Effective_Date Date;
28 l_Wrkplc_vldtn_LvlNum_id PQH_DE_WRKPLC_VLDTN_LVLNUMS.WRKPLC_VLDTN_LvlNum_ID%TYPE;
29
30 begin
31 hr_utility.set_location('Entering:'|| l_proc, 10);
32 --
33 -- Issue a savepoint
34 --
35 savepoint Insert_Vldtn_Lvl;
36 --
37 -- Truncate the time portion from all IN date parameters
38 --
39 l_effective_date := Trunc(p_effective_Date);
40 --
41 -- Call Before Process User Hook
42 --
43 begin
44 PQH_DE_VLDLVL_BK1.Insert_Vldtn_LVL_b
45 (p_effective_date => L_Effective_Date
46 ,p_business_group_id => p_Business_Group_Id
47 ,P_WRKPLC_VLDTN_VER_ID => P_Wrkplc_Vldtn_VER_Id
48 ,P_Level_Number_Id => P_Level_Number_Id
49 ,P_Level_Code_Id => P_Level_Code_Id);
50
51
52 exception
53 when hr_api.cannot_find_prog_unit then
54 hr_api.cannot_find_prog_unit_error
55 (p_module_name => 'Insert_Vldtn_Lvl'
56 ,p_hook_type => 'BP'
57 );
58 end;
59 --
60 -- Validation in addition to Row Handlers
61 --
62 --
63 -- Process Logic
64 pqh_lvl_ins.ins
65 (P_EFFECTIVE_DATE => l_Effective_date
66 ,P_WRKPLC_VLDTN_VER_ID => p_Wrkplc_Vldtn_VER_Id
67 ,P_LEVEL_NUMBER_ID => P_LEVEL_NUMBER_ID
68 ,P_BUSINESS_GROUP_ID => P_BUSINESS_GROUP_ID
69 ,P_LEVEL_CODE_ID => P_LEVEL_CODE_ID
70 ,P_WRKPLC_VLDTN_LVLNUM_ID => l_WRKPLC_VLDTN_LVLNUM_ID
71 ,P_OBJECT_VERSION_NUMBER => l_OBJECT_VERSION_NUMBER);
72
73 --
74 -- Call After Process User Hook
75 --
76 begin
77 PQH_DE_VLDLVL_BK1.Insert_Vldtn_LVL_a
78 (p_effective_date => l_Effective_Date
79 ,p_business_group_id => p_Business_group_Id
80 ,p_WRKPLC_VLDTN_VER_ID => p_WRKPLC_VLDTN_VER_ID
81 ,p_LEVEL_NUMBER_ID => p_LEVEL_NUMBER_ID
82 ,P_LEVEL_CODE_ID => P_LEVEL_CODE_ID
83 ,P_WRKPLC_VLDTN_LVLNUM_ID => l_WRKPLC_VLDTN_LVLNUM_ID
84 ,p_object_version_number => l_object_version_number);
85
86 exception
87 when hr_api.cannot_find_prog_unit then
88 hr_api.cannot_find_prog_unit_error
89 (p_module_name => 'Insert_Vldtn_Lvl'
90 ,p_hook_type => 'AP'
91 );
92 end;
93 --
94 -- When in validation only mode raise the Validate_Enabled exception
95 --
96 if p_validate then
97 raise hr_api.validate_enabled;
98 end if;
99 --
100 -- Set all output arguments
101 --
102 p_wrkplc_vldtn_Lvlnum_id := l_Wrkplc_vldtn_Lvlnum_id;
103 p_object_version_number := l_object_version_number;
104
105 --
106 hr_utility.set_location(' Leaving:'||l_proc, 70);
107 exception
108 when hr_api.validate_enabled then
109 --
110 -- As the Validate_Enabled exception has been raised
111 -- we must rollback to the savepoint
112 --
113 rollback to Insert_Vldtn_Lvl;
114 --
115 -- Only set output warning arguments
116 -- (Any key or derived arguments must be set to null
117 -- when validation only mode is being used.)
118 --
119 p_wrkplc_vldtn_LvlNum_id := null;
120 p_object_version_number := null;
121 hr_utility.set_location(' Leaving:'||l_proc, 80);
122
123 when others then
124 p_wrkplc_vldtn_LvlNum_id := null;
125 p_object_version_number := null;
126 --
127 -- A validation or unexpected error has occured
128 --
129 rollback to Insert_Vldtn_Lvl;
130 hr_utility.set_location(' Leaving:'||l_proc, 90);
131 raise;
132 end Insert_Vldtn_Lvl;
133
134 --
135 -- ----------------------------------------------------------------------------
136 -- |--------------------------< Update_Vldtn_Lvl >--------------------------|
137 -- ----------------------------------------------------------------------------
138
139 procedure Update_Vldtn_Lvl
140 (p_validate in boolean default false
141 ,p_effective_date in date
142 ,p_business_group_id in number Default hr_api.g_Number
143 ,P_WRKPLC_VLDTN_VER_ID In Number Default hr_api.g_Number
144 ,p_LEVEL_NUMBER_ID In Number Default hr_api.g_Number
145 ,P_LEVEL_CODE_ID In Number Default hr_api.g_Number
146 ,P_WRKPLC_VLDTN_LVLNUM_ID In Number
147 ,p_object_version_number IN out nocopy number) Is
148
149 l_proc varchar2(72) := g_package||'Update_Vldtn_Lvl';
150 l_object_Version_Number PQH_DE_WRKPLC_VLDTN_LVLNUMS.OBJECT_VERSION_NUMBER%TYPE := P_Object_version_Number;
151 L_Effective_Date Date;
152
153 Begin
154 hr_utility.set_location('Entering:'|| l_proc, 10);
155 --
156 -- Issue a savepoint
157 --
158 savepoint Update_Vldtn_Lvl;
159 --
160 -- Truncate the time portion from all IN date parameters
161 --
162 l_effective_date := Trunc(p_effective_Date);
163 --
164 -- Call Before Process User Hook
165 --
166 begin
167
168 PQH_DE_VLDLVL_BK2.Update_Vldtn_LVL_b
169 (p_effective_date => l_Effective_Date
170 ,p_business_group_id => p_business_group_id
171 ,p_WRKPLC_VLDTN_VER_ID => p_Wrkplc_Vldtn_VER_Id
172 ,P_Level_Number_Id => P_Level_Number_id
173 ,P_Level_Code_Id => P_level_Code_Id
174 ,P_WRKPLC_VLDTN_LVLNUM_ID => P_WRKPLC_VLDTN_LVLNUM_ID
175 ,p_object_version_number => l_object_version_number);
176
177 exception
178 when hr_api.cannot_find_prog_unit then
179 hr_api.cannot_find_prog_unit_error
180 (p_module_name => 'Update_Vldtn_Lvl'
181 ,p_hook_type => 'BP'
182 );
183 end;
184
185 pqh_lvl_upd.upd
186 (P_EFFECTIVE_DATE => l_Effective_Date
187 ,P_Wrkplc_Vldtn_Lvlnum_Id => P_Wrkplc_Vldtn_Lvlnum_Id
188 ,P_WRKPLC_VLDTN_VER_ID => P_WRKPLC_VLDTN_Ver_ID
189 ,P_OBJECT_VERSION_NUMBER => l_OBJECT_VERSION_NUMBER
190 ,P_Level_Number_id => P_level_number_id
191 ,P_Level_Code_Id => P_level_Code_Id
192 ,P_BUSINESS_GROUP_ID => P_BUSINESS_GROUP_ID);
193
194 --
195 --
196 -- Call After Process User Hook
197 --
198 begin
199
200 PQH_DE_VLDLVL_BK2.Update_Vldtn_LVL_a
201 (p_effective_date => l_Effective_Date
202 ,p_business_group_id => p_business_group_id
203 ,p_WRKPLC_VLDTN_VER_ID => p_Wrkplc_Vldtn_VER_Id
204 ,P_Level_Number_Id => P_Level_Number_Id
205 ,P_Level_Code_Id => P_Level_Code_Id
206 ,P_WRKPLC_VLDTN_Lvlnum_ID => P_WRKPLC_VLDTN_Lvlnum_ID
207 ,p_object_version_number => l_object_version_number);
208
209 exception
210 when hr_api.cannot_find_prog_unit then
211 hr_api.cannot_find_prog_unit_error
212 (p_module_name => 'Update_Vldtn_Lvl'
213 ,p_hook_type => 'AP'
214 );
215 end;
216 --
217 -- When in validation only mode raise the Validate_Enabled exception
218 --
219 if p_validate then
220 raise hr_api.validate_enabled;
221 end if;
222 --
223 -- Set all output arguments
224 --
225
226 p_object_version_number := l_object_version_number;
227
228 --
229 hr_utility.set_location(' Leaving:'||l_proc, 70);
230 exception
231 when hr_api.validate_enabled then
232 --
233 -- As the Validate_Enabled exception has been raised
234 -- we must rollback to the savepoint
235 --
236 rollback to Update_Vldtn_Lvl;
237 --
238 -- Only set output warning arguments
239 -- (Any key or derived arguments must be set to null
240 -- when validation only mode is being used.)
241 --
242 hr_utility.set_location(' Leaving:'||l_proc, 80);
243
244 when others then
245 p_object_version_number := l_object_version_number;
246 --
247 -- A validation or unexpected error has occured
248 --
249 rollback to Update_Vldtn_Lvl;
250 hr_utility.set_location(' Leaving:'||l_proc, 90);
251 raise;
252 end Update_Vldtn_Lvl;
253
254 --
255 -- ----------------------------------------------------------------------------
259 (p_validate in boolean default false
256 -- |-------------------< delete_Vldtn_Lvl>------------------------------|
257 -- ----------------------------------------------------------------------------
258 procedure delete_Vldtn_lvl
260 ,p_WRKPLC_VLDTN_Lvlnum_ID In Number
261 ,p_object_version_number In number) Is --
262
263 -- Declare cursors and local variables
264 --
265 l_proc varchar2(72) := g_package||'delete_Vldtn_Lvl';
266 --
267 begin
268 hr_utility.set_location('Entering:'|| l_proc, 10);
269 --
270 -- Issue a savepoint
271 --
272 savepoint delete_Vldtn_Lvl;
273 --
274 -- Call Before Process User Hook
275 --
276 begin
277 PQH_DE_VLDLVL_BK3.Delete_Vldtn_Lvl_b
278 (p_WRKPLC_VLDTN_Lvlnum_ID => p_WRKPLC_VLDTN_LvlNum_Id
279 ,p_object_version_number => p_object_version_number);
280 exception
281 when hr_api.cannot_find_prog_unit then
282 hr_api.cannot_find_prog_unit_error
283 (p_module_name => 'delete_Vldtn_Lvl'
284 ,p_hook_type => 'BP');
285 end;
286 --
287 -- Process Logic
288 --
289 pqh_Lvl_del.del
290 (p_WRKPLC_VLDTN_LvlNum_ID => p_WRKPLC_VLDTN_Lvlnum_ID
291 ,p_object_version_number => p_object_version_number);
292 --
293 -- Call After Process User Hook
294 --
295 begin
296
297 PQH_DE_VLDLvl_BK3.Delete_Vldtn_Lvl_a
298 (p_WRKPLC_VLDTN_LvlNum_ID => p_WRKPLC_VLDTN_LvlNum_ID
299 ,p_object_version_number => p_object_version_number);
300
301 exception
302 when hr_api.cannot_find_prog_unit then
303 hr_api.cannot_find_prog_unit_error
304 (p_module_name => 'delete_Vldtn_Lvl'
305 ,p_hook_type => 'AP');
306 end;
307 --
308 -- When in validation only mode raise the Validate_Enabled exception
309 --
310 if p_validate then
311 raise hr_api.validate_enabled;
312 end if;
313 --
314 -- Set all output arguments
315 --
316 hr_utility.set_location(' Leaving:'||l_proc, 70);
317 exception
318 when hr_api.validate_enabled then
319 --
320 -- As the Validate_Enabled exception has been raised
321 -- we must rollback to the savepoint
322 --
323 rollback to delete_Vldtn_Lvl;
324 --
325 -- Only set output warning arguments
326 -- (Any key or derived arguments must be set to null
327 -- when validation only mode is being used.)
328 --
329 hr_utility.set_location(' Leaving:'||l_proc, 80);
330 when others then
331 --
332 -- A validation or unexpected error has occured
333 --
334 rollback to delete_Vldtn_Lvl;
335 hr_utility.set_location(' Leaving:'||l_proc, 90);
336 raise;
337 end delete_Vldtn_Lvl;
338
339 end PQH_DE_VLDLvl_API;