[Home] [Help]
PACKAGE BODY: APPS.PE_POI_SHD
Source
1 Package Body pe_poi_shd as
2 /* $Header: pepoirhi.pkb 120.0 2005/05/31 14:50:38 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' pe_poi_shd.'; -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |---------------------------< constraint_error >---------------------------|
12 -- ----------------------------------------------------------------------------
13 Procedure constraint_error
14 (p_constraint_name in all_constraints.constraint_name%TYPE) Is
15 --
16 l_proc varchar2(72) := g_package||'constraint_error';
17 --
18 Begin
19 hr_utility.set_location('Entering:'||l_proc, 5);
20 --
21 If (p_constraint_name = 'PER_POSITION_EXTRA_INFO_FK1') Then
22 hr_utility.set_message(800, 'HR_INV_INFO_TYPE');
23 hr_utility.raise_error;
24 ElsIf (p_constraint_name = 'PER_POSITION_EXTRA_INFO_FK2') Then
25 hr_utility.set_message(800, 'HR_INV_POS_ID');
26 hr_utility.raise_error;
27 ElsIf (p_constraint_name = 'PER_POSITION_EXTRA_INFO_PK') Then
28 hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
29 hr_utility.set_message_token('PROCEDURE', l_proc);
30 hr_utility.set_message_token('STEP','15');
31 hr_utility.raise_error;
32 Else
33 hr_utility.set_message(801, 'HR_7877_API_INVALID_CONSTRAINT');
34 hr_utility.set_message_token('PROCEDURE', l_proc);
35 hr_utility.set_message_token('CONSTRAINT_NAME', p_constraint_name);
36 hr_utility.raise_error;
37 End If;
38 --
39 hr_utility.set_location(' Leaving:'||l_proc, 10);
40 End constraint_error;
41 --
42 -- ----------------------------------------------------------------------------
43 -- |-----------------------------< api_updating >-----------------------------|
44 -- ----------------------------------------------------------------------------
45 Function api_updating
46 (
47 p_position_extra_info_id in number,
48 p_object_version_number in number
49 ) Return Boolean Is
50 --
51 --
52 -- Cursor selects the 'current' row from the HR Schema
53 --
54 Cursor C_Sel1 is
55 select
56 position_extra_info_id,
57 position_id,
58 information_type,
59 request_id,
60 program_application_id,
61 program_id,
62 program_update_date,
63 poei_attribute_category,
64 poei_attribute1,
65 poei_attribute2,
66 poei_attribute3,
67 poei_attribute4,
68 poei_attribute5,
69 poei_attribute6,
70 poei_attribute7,
71 poei_attribute8,
72 poei_attribute9,
73 poei_attribute10,
74 poei_attribute11,
75 poei_attribute12,
76 poei_attribute13,
77 poei_attribute14,
78 poei_attribute15,
79 poei_attribute16,
80 poei_attribute17,
81 poei_attribute18,
82 poei_attribute19,
83 poei_attribute20,
84 poei_information_category,
85 poei_information1,
86 poei_information2,
87 poei_information3,
88 poei_information4,
89 poei_information5,
90 poei_information6,
91 poei_information7,
92 poei_information8,
93 poei_information9,
94 poei_information10,
95 poei_information11,
96 poei_information12,
97 poei_information13,
98 poei_information14,
99 poei_information15,
100 poei_information16,
101 poei_information17,
102 poei_information18,
103 poei_information19,
104 poei_information20,
105 poei_information21,
106 poei_information22,
107 poei_information23,
108 poei_information24,
109 poei_information25,
110 poei_information26,
111 poei_information27,
112 poei_information28,
113 poei_information29,
114 poei_information30,
115 object_version_number
116 from per_position_extra_info
117 where position_extra_info_id = p_position_extra_info_id;
118 --
119 l_proc varchar2(72) := g_package||'api_updating';
120 l_fct_ret boolean;
121 --
122 Begin
123 hr_utility.set_location('Entering:'||l_proc, 5);
124 --
125 If (
126 p_position_extra_info_id is null and
127 p_object_version_number is null
128 ) Then
129 --
130 -- One of the primary key arguments is null therefore we must
131 -- set the returning function value to false
132 --
133 l_fct_ret := false;
134 Else
135 If (
136 p_position_extra_info_id = g_old_rec.position_extra_info_id and
137 p_object_version_number = g_old_rec.object_version_number
138 ) Then
139 hr_utility.set_location(l_proc, 10);
140 --
141 -- The g_old_rec is current therefore we must
142 -- set the returning function to true
143 --
144 l_fct_ret := true;
145 Else
146 --
147 -- Select the current row into g_old_rec
148 --
149 Open C_Sel1;
150 Fetch C_Sel1 Into g_old_rec;
151 If C_Sel1%notfound Then
152 Close C_Sel1;
153 --
154 -- The primary key is invalid therefore we must error
155 --
156 hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
157 hr_utility.raise_error;
158 End If;
159 Close C_Sel1;
160 If (p_object_version_number <> g_old_rec.object_version_number) Then
161 hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
162 hr_utility.raise_error;
163 End If;
164 hr_utility.set_location(l_proc, 15);
165 l_fct_ret := true;
166 End If;
167 End If;
168 hr_utility.set_location(' Leaving:'||l_proc, 20);
169 Return (l_fct_ret);
170 --
171 End api_updating;
172 --
173 -- ----------------------------------------------------------------------------
174 -- |---------------------------------< lck >----------------------------------|
175 -- ----------------------------------------------------------------------------
176 Procedure lck
177 (
178 p_position_extra_info_id in number,
179 p_object_version_number in number
180 ) is
181 --
182 -- Cursor selects the 'current' row from the HR Schema
183 --
184 Cursor C_Sel1 is
185 select
186 position_extra_info_id,
187 position_id,
188 information_type,
189 request_id,
190 program_application_id,
191 program_id,
192 program_update_date,
193 poei_attribute_category,
194 poei_attribute1,
195 poei_attribute2,
196 poei_attribute3,
197 poei_attribute4,
198 poei_attribute5,
199 poei_attribute6,
200 poei_attribute7,
201 poei_attribute8,
202 poei_attribute9,
203 poei_attribute10,
204 poei_attribute11,
205 poei_attribute12,
206 poei_attribute13,
207 poei_attribute14,
208 poei_attribute15,
209 poei_attribute16,
210 poei_attribute17,
211 poei_attribute18,
212 poei_attribute19,
213 poei_attribute20,
214 poei_information_category,
215 poei_information1,
216 poei_information2,
217 poei_information3,
218 poei_information4,
219 poei_information5,
220 poei_information6,
221 poei_information7,
222 poei_information8,
223 poei_information9,
224 poei_information10,
225 poei_information11,
226 poei_information12,
227 poei_information13,
228 poei_information14,
229 poei_information15,
230 poei_information16,
231 poei_information17,
232 poei_information18,
233 poei_information19,
234 poei_information20,
235 poei_information21,
236 poei_information22,
237 poei_information23,
238 poei_information24,
239 poei_information25,
240 poei_information26,
241 poei_information27,
242 poei_information28,
243 poei_information29,
244 poei_information30,
245 object_version_number
246 from per_position_extra_info
247 where position_extra_info_id = p_position_extra_info_id
248 for update nowait;
249 --
250 l_proc varchar2(72) := g_package||'lck';
251 --
252 Begin
253 hr_utility.set_location('Entering:'||l_proc, 5);
254 --
255 -- Add any mandatory argument checking here:
256 -- Example:
257 -- hr_api.mandatory_arg_error
258 -- (p_api_name => l_proc,
259 -- p_argument => 'object_version_number',
260 -- p_argument_value => p_object_version_number);
261 --
262 Open C_Sel1;
263 Fetch C_Sel1 Into g_old_rec;
264 If C_Sel1%notfound then
265 Close C_Sel1;
266 --
267 -- The primary key is invalid therefore we must error
268 --
269 hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
270 hr_utility.raise_error;
271 End If;
272 Close C_Sel1;
273 If (p_object_version_number <> g_old_rec.object_version_number) Then
274 hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
275 hr_utility.raise_error;
276 End If;
277 --
278 hr_utility.set_location(' Leaving:'||l_proc, 10);
279 --
280 -- We need to trap the ORA LOCK exception
281 --
282 Exception
283 When HR_Api.Object_Locked then
284 --
285 -- The object is locked therefore we need to supply a meaningful
286 -- error message.
287 --
288 hr_utility.set_message(801, 'HR_7165_OBJECT_LOCKED');
289 hr_utility.set_message_token('TABLE_NAME', 'per_position_extra_info');
290 hr_utility.raise_error;
291 End lck;
292
293 --
294 -- ----------------------------------------------------------------------------
295 -- |-----------------------------< convert_args >-----------------------------|
296 -- ----------------------------------------------------------------------------
297 Function convert_args
298 (
299 p_position_extra_info_id in number,
300 p_position_id in number,
301 p_information_type in varchar2,
302 p_request_id in number,
303 p_program_application_id in number,
304 p_program_id in number,
305 p_program_update_date in date,
306 p_poei_attribute_category in varchar2,
307 p_poei_attribute1 in varchar2,
308 p_poei_attribute2 in varchar2,
309 p_poei_attribute3 in varchar2,
310 p_poei_attribute4 in varchar2,
311 p_poei_attribute5 in varchar2,
312 p_poei_attribute6 in varchar2,
313 p_poei_attribute7 in varchar2,
314 p_poei_attribute8 in varchar2,
315 p_poei_attribute9 in varchar2,
316 p_poei_attribute10 in varchar2,
317 p_poei_attribute11 in varchar2,
318 p_poei_attribute12 in varchar2,
319 p_poei_attribute13 in varchar2,
320 p_poei_attribute14 in varchar2,
321 p_poei_attribute15 in varchar2,
322 p_poei_attribute16 in varchar2,
323 p_poei_attribute17 in varchar2,
324 p_poei_attribute18 in varchar2,
325 p_poei_attribute19 in varchar2,
326 p_poei_attribute20 in varchar2,
327 p_poei_information_category in varchar2,
328 p_poei_information1 in varchar2,
329 p_poei_information2 in varchar2,
330 p_poei_information3 in varchar2,
331 p_poei_information4 in varchar2,
332 p_poei_information5 in varchar2,
333 p_poei_information6 in varchar2,
334 p_poei_information7 in varchar2,
335 p_poei_information8 in varchar2,
336 p_poei_information9 in varchar2,
337 p_poei_information10 in varchar2,
338 p_poei_information11 in varchar2,
339 p_poei_information12 in varchar2,
340 p_poei_information13 in varchar2,
341 p_poei_information14 in varchar2,
342 p_poei_information15 in varchar2,
343 p_poei_information16 in varchar2,
344 p_poei_information17 in varchar2,
345 p_poei_information18 in varchar2,
346 p_poei_information19 in varchar2,
347 p_poei_information20 in varchar2,
348 p_poei_information21 in varchar2,
349 p_poei_information22 in varchar2,
350 p_poei_information23 in varchar2,
351 p_poei_information24 in varchar2,
352 p_poei_information25 in varchar2,
353 p_poei_information26 in varchar2,
354 p_poei_information27 in varchar2,
355 p_poei_information28 in varchar2,
356 p_poei_information29 in varchar2,
357 p_poei_information30 in varchar2,
358 p_object_version_number in number
359 )
360
361 Return g_rec_type is
362 --
363 l_rec g_rec_type;
364 l_proc varchar2(72) := g_package||'convert_args';
365 --
366 Begin
367 --
368 hr_utility.set_location('Entering:'||l_proc, 5);
369 --
370 -- Convert arguments into local l_rec structure.
371 --
372 l_rec.position_extra_info_id := p_position_extra_info_id;
373 l_rec.position_id := p_position_id;
374 l_rec.information_type := p_information_type;
375 l_rec.request_id := p_request_id;
376 l_rec.program_application_id := p_program_application_id;
377 l_rec.program_id := p_program_id;
378 l_rec.program_update_date := p_program_update_date;
379 l_rec.poei_attribute_category := p_poei_attribute_category;
380 l_rec.poei_attribute1 := p_poei_attribute1;
381 l_rec.poei_attribute2 := p_poei_attribute2;
382 l_rec.poei_attribute3 := p_poei_attribute3;
383 l_rec.poei_attribute4 := p_poei_attribute4;
384 l_rec.poei_attribute5 := p_poei_attribute5;
385 l_rec.poei_attribute6 := p_poei_attribute6;
386 l_rec.poei_attribute7 := p_poei_attribute7;
387 l_rec.poei_attribute8 := p_poei_attribute8;
388 l_rec.poei_attribute9 := p_poei_attribute9;
389 l_rec.poei_attribute10 := p_poei_attribute10;
390 l_rec.poei_attribute11 := p_poei_attribute11;
391 l_rec.poei_attribute12 := p_poei_attribute12;
392 l_rec.poei_attribute13 := p_poei_attribute13;
393 l_rec.poei_attribute14 := p_poei_attribute14;
394 l_rec.poei_attribute15 := p_poei_attribute15;
395 l_rec.poei_attribute16 := p_poei_attribute16;
396 l_rec.poei_attribute17 := p_poei_attribute17;
397 l_rec.poei_attribute18 := p_poei_attribute18;
398 l_rec.poei_attribute19 := p_poei_attribute19;
399 l_rec.poei_attribute20 := p_poei_attribute20;
400 l_rec.poei_information_category := p_poei_information_category;
401 l_rec.poei_information1 := p_poei_information1;
402 l_rec.poei_information2 := p_poei_information2;
403 l_rec.poei_information3 := p_poei_information3;
404 l_rec.poei_information4 := p_poei_information4;
405 l_rec.poei_information5 := p_poei_information5;
406 l_rec.poei_information6 := p_poei_information6;
407 l_rec.poei_information7 := p_poei_information7;
408 l_rec.poei_information8 := p_poei_information8;
409 l_rec.poei_information9 := p_poei_information9;
410 l_rec.poei_information10 := p_poei_information10;
411 l_rec.poei_information11 := p_poei_information11;
412 l_rec.poei_information12 := p_poei_information12;
413 l_rec.poei_information13 := p_poei_information13;
414 l_rec.poei_information14 := p_poei_information14;
415 l_rec.poei_information15 := p_poei_information15;
416 l_rec.poei_information16 := p_poei_information16;
417 l_rec.poei_information17 := p_poei_information17;
418 l_rec.poei_information18 := p_poei_information18;
419 l_rec.poei_information19 := p_poei_information19;
420 l_rec.poei_information20 := p_poei_information20;
421 l_rec.poei_information21 := p_poei_information21;
422 l_rec.poei_information22 := p_poei_information22;
423 l_rec.poei_information23 := p_poei_information23;
424 l_rec.poei_information24 := p_poei_information24;
425 l_rec.poei_information25 := p_poei_information25;
426 l_rec.poei_information26 := p_poei_information26;
427 l_rec.poei_information27 := p_poei_information27;
428 l_rec.poei_information28 := p_poei_information28;
429 l_rec.poei_information29 := p_poei_information29;
430 l_rec.poei_information30 := p_poei_information30;
431 l_rec.object_version_number := p_object_version_number;
432 --
433 -- Return the plsql record structure.
434 --
435 hr_utility.set_location(' Leaving:'||l_proc, 10);
436 Return(l_rec);
437 --
438 End convert_args;
439 --
440 end pe_poi_shd;