[Home] [Help]
PACKAGE BODY: APPS.PQH_REI_SHD
Source
1 Package Body pqh_rei_shd as
2 /* $Header: pqreirhi.pkb 115.3 2002/12/03 20:42:51 rpasapul noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' pqh_rei_shd.'; -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |---------------------------< constraint_error >---------------------------|
12 -- ----------------------------------------------------------------------------
13 Procedure constraint_error
14 (p_constraint_name in all_constraints.constraint_name%TYPE
15 ) Is
16 --
17 l_proc varchar2(72) := g_package||'constraint_error';
18 --
19 Begin
20 --
21 If (p_constraint_name = 'PQH_ROLE_EXTRA_INFO_FK1') Then
22 hr_utility.set_message(800, 'HR_INV_INFO_TYPE');
23 hr_utility.raise_error;
24 Elsif (p_constraint_name = 'PQH_ROLE_EXTRA_INFO_FK2') Then
25 hr_utility.set_message(8302, 'PQH_INV_ROLE_ID');
26 hr_utility.raise_error;
27 ElsIf (p_constraint_name = 'PQH_ROLE_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 End constraint_error;
40 --
41 -- ----------------------------------------------------------------------------
42 -- |-----------------------------< api_updating >-----------------------------|
43 -- ----------------------------------------------------------------------------
44 Function api_updating
45 (p_role_extra_info_id in number
46 ,p_object_version_number in number
47 )
48 Return Boolean Is
49 --
50 --
51 -- Cursor selects the 'current' row from the HR Schema
52 --
53 Cursor C_Sel1 is
54 select
55 role_extra_info_id
56 ,role_id
57 ,information_type
58 ,request_id
59 ,program_application_id
60 ,program_id
61 ,program_update_date
62 ,attribute_category
63 ,attribute1
64 ,attribute2
65 ,attribute3
66 ,attribute4
67 ,attribute5
68 ,attribute6
69 ,attribute7
70 ,attribute8
71 ,attribute9
72 ,attribute10
73 ,attribute11
74 ,attribute12
75 ,attribute13
76 ,attribute14
77 ,attribute15
78 ,attribute16
79 ,attribute17
80 ,attribute18
81 ,attribute19
82 ,attribute20
83 ,attribute21
84 ,attribute22
85 ,attribute23
86 ,attribute24
87 ,attribute25
88 ,attribute26
89 ,attribute27
90 ,attribute28
91 ,attribute29
92 ,attribute30
93 ,information_category
94 ,information1
95 ,information2
96 ,information3
97 ,information4
98 ,information5
99 ,information6
100 ,information7
101 ,information8
102 ,information9
103 ,information10
104 ,information11
105 ,information12
106 ,information13
107 ,information14
108 ,information15
109 ,information16
110 ,information17
111 ,information18
112 ,information19
113 ,information20
114 ,information21
115 ,information22
116 ,information23
117 ,information24
118 ,information25
119 ,information26
120 ,information27
121 ,information28
122 ,information29
123 ,information30
124 ,object_version_number
125 from pqh_role_extra_info
126 where role_extra_info_id = p_role_extra_info_id;
127 --
128 l_fct_ret boolean;
129 --
130 Begin
131 --
132 If (p_role_extra_info_id is null and
133 p_object_version_number is null
134 ) Then
135 --
136 -- One of the primary key arguments is null therefore we must
137 -- set the returning function value to false
138 --
139 l_fct_ret := false;
140 Else
141 If (p_role_extra_info_id
142 = pqh_rei_shd.g_old_rec.role_extra_info_id and
143 p_object_version_number
144 = pqh_rei_shd.g_old_rec.object_version_number
145 ) Then
146 --
147 -- The g_old_rec is current therefore we must
148 -- set the returning function to true
149 --
150 l_fct_ret := true;
151 Else
152 --
153 -- Select the current row into g_old_rec
154 --
155 Open C_Sel1;
156 Fetch C_Sel1 Into pqh_rei_shd.g_old_rec;
157 If C_Sel1%notfound Then
158 Close C_Sel1;
159 --
160 -- The primary key is invalid therefore we must error
161 --
162 hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
163 hr_utility.raise_error;
164
165 End If;
166 Close C_Sel1;
167
168 If (p_object_version_number <> g_old_rec.object_version_number) Then
169 hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
170 hr_utility.raise_error;
171 End If;
172
173 l_fct_ret := true;
174 End If;
175 End If;
176 Return (l_fct_ret);
177 --
178 End api_updating;
179 --
180 -- ----------------------------------------------------------------------------
181 -- |---------------------------------< lck >----------------------------------|
182 -- ----------------------------------------------------------------------------
183 Procedure lck
184 (p_role_extra_info_id in number
185 ,p_object_version_number in number
186 ) is
187 --
188 -- Cursor selects the 'current' row from the HR Schema
189 --
190 Cursor C_Sel1 is
191 select
192 role_extra_info_id
193 ,role_id
194 ,information_type
195 ,request_id
196 ,program_application_id
197 ,program_id
198 ,program_update_date
199 ,attribute_category
200 ,attribute1
201 ,attribute2
202 ,attribute3
203 ,attribute4
204 ,attribute5
205 ,attribute6
206 ,attribute7
207 ,attribute8
208 ,attribute9
209 ,attribute10
210 ,attribute11
211 ,attribute12
212 ,attribute13
213 ,attribute14
214 ,attribute15
215 ,attribute16
216 ,attribute17
217 ,attribute18
218 ,attribute19
219 ,attribute20
220 ,attribute21
221 ,attribute22
222 ,attribute23
223 ,attribute24
224 ,attribute25
225 ,attribute26
226 ,attribute27
227 ,attribute28
228 ,attribute29
229 ,attribute30
230 ,information_category
231 ,information1
232 ,information2
233 ,information3
234 ,information4
235 ,information5
236 ,information6
237 ,information7
238 ,information8
239 ,information9
240 ,information10
241 ,information11
242 ,information12
243 ,information13
244 ,information14
245 ,information15
246 ,information16
247 ,information17
248 ,information18
249 ,information19
250 ,information20
251 ,information21
252 ,information22
253 ,information23
254 ,information24
255 ,information25
256 ,information26
257 ,information27
258 ,information28
259 ,information29
260 ,information30
261 ,object_version_number
262 from pqh_role_extra_info
263 where role_extra_info_id = p_role_extra_info_id
264 for update nowait;
265 --
266 l_proc varchar2(72) := g_package||'lck';
267 --
268 Begin
269 hr_utility.set_location('Entering:'||l_proc, 5);
270 --
271 hr_api.mandatory_arg_error
272 (p_api_name => l_proc
273 ,p_argument => 'ROLE_EXTRA_INFO_ID'
274 ,p_argument_value => p_role_extra_info_id
275 );
276 hr_utility.set_location(l_proc,6);
277 hr_api.mandatory_arg_error
278 (p_api_name => l_proc
279 ,p_argument => 'OBJECT_VERSION_NUMBER'
280 ,p_argument_value => p_object_version_number
281 );
282 --
283 Open C_Sel1;
284 Fetch C_Sel1 Into pqh_rei_shd.g_old_rec;
285 If C_Sel1%notfound then
286 Close C_Sel1;
287 --
288 -- The primary key is invalid therefore we must error
289 --
290 hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
291 hr_utility.raise_error;
292 End If;
293 Close C_Sel1;
294 If (p_object_version_number <> g_old_rec.object_version_number) Then
295 hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
296 hr_utility.raise_error;
297 End If;
298 --
299 hr_utility.set_location(' Leaving:'||l_proc, 10);
300 --
301 -- We need to trap the ORA LOCK exception
302 --
303
304
305 Exception
306 When HR_Api.Object_Locked then
307 --
308 -- The object is locked therefore we need to supply a meaningful
309 -- error message.
310 --
311 hr_utility.set_message(801, 'HR_7165_OBJECT_LOCKED');
312 hr_utility.set_message_token('TABLE_NAME', 'pqh_role_extra_info');
313 hr_utility.raise_error;
314 End lck;
315
316 -- ----------------------------------------------------------------------------
317 -- |-----------------------------< convert_args >-----------------------------|
318 -- ----------------------------------------------------------------------------
319 Function convert_args
320 (p_role_extra_info_id in number
321 ,p_role_id in number
322 ,p_information_type in varchar2
323 ,p_request_id in number
324 ,p_program_application_id in number
325 ,p_program_id in number
326 ,p_program_update_date in date
327 ,p_attribute_category in varchar2
328 ,p_attribute1 in varchar2
329 ,p_attribute2 in varchar2
330 ,p_attribute3 in varchar2
331 ,p_attribute4 in varchar2
332 ,p_attribute5 in varchar2
333 ,p_attribute6 in varchar2
334 ,p_attribute7 in varchar2
335 ,p_attribute8 in varchar2
336 ,p_attribute9 in varchar2
337 ,p_attribute10 in varchar2
338 ,p_attribute11 in varchar2
339 ,p_attribute12 in varchar2
340 ,p_attribute13 in varchar2
341 ,p_attribute14 in varchar2
342 ,p_attribute15 in varchar2
343 ,p_attribute16 in varchar2
344 ,p_attribute17 in varchar2
345 ,p_attribute18 in varchar2
346 ,p_attribute19 in varchar2
347 ,p_attribute20 in varchar2
348 ,p_attribute21 in varchar2
349 ,p_attribute22 in varchar2
350 ,p_attribute23 in varchar2
351 ,p_attribute24 in varchar2
352 ,p_attribute25 in varchar2
353 ,p_attribute26 in varchar2
354 ,p_attribute27 in varchar2
355 ,p_attribute28 in varchar2
356 ,p_attribute29 in varchar2
357 ,p_attribute30 in varchar2
358 ,p_information_category in varchar2
359 ,p_information1 in varchar2
360 ,p_information2 in varchar2
361 ,p_information3 in varchar2
362 ,p_information4 in varchar2
363 ,p_information5 in varchar2
364 ,p_information6 in varchar2
365 ,p_information7 in varchar2
366 ,p_information8 in varchar2
367 ,p_information9 in varchar2
368 ,p_information10 in varchar2
369 ,p_information11 in varchar2
370 ,p_information12 in varchar2
371 ,p_information13 in varchar2
372 ,p_information14 in varchar2
373 ,p_information15 in varchar2
374 ,p_information16 in varchar2
375 ,p_information17 in varchar2
376 ,p_information18 in varchar2
377 ,p_information19 in varchar2
378 ,p_information20 in varchar2
379 ,p_information21 in varchar2
380 ,p_information22 in varchar2
381 ,p_information23 in varchar2
382 ,p_information24 in varchar2
383 ,p_information25 in varchar2
384 ,p_information26 in varchar2
385 ,p_information27 in varchar2
386 ,p_information28 in varchar2
387 ,p_information29 in varchar2
388 ,p_information30 in varchar2
389 ,p_object_version_number in number
390 )
391 Return g_rec_type is
392 --
393 l_rec g_rec_type;
394 --
395 Begin
396 --
397 -- Convert arguments into local l_rec structure.
398 --
399 l_rec.role_extra_info_id := p_role_extra_info_id;
400 l_rec.role_id := p_role_id;
401 l_rec.information_type := p_information_type;
402 l_rec.request_id := p_request_id;
403 l_rec.program_application_id := p_program_application_id;
404 l_rec.program_id := p_program_id;
405 l_rec.program_update_date := p_program_update_date;
406 l_rec.attribute_category := p_attribute_category;
407 l_rec.attribute1 := p_attribute1;
408 l_rec.attribute2 := p_attribute2;
409 l_rec.attribute3 := p_attribute3;
410 l_rec.attribute4 := p_attribute4;
411 l_rec.attribute5 := p_attribute5;
412 l_rec.attribute6 := p_attribute6;
413 l_rec.attribute7 := p_attribute7;
414 l_rec.attribute8 := p_attribute8;
415 l_rec.attribute9 := p_attribute9;
416 l_rec.attribute10 := p_attribute10;
417 l_rec.attribute11 := p_attribute11;
418 l_rec.attribute12 := p_attribute12;
419 l_rec.attribute13 := p_attribute13;
420 l_rec.attribute14 := p_attribute14;
421 l_rec.attribute15 := p_attribute15;
422 l_rec.attribute16 := p_attribute16;
423 l_rec.attribute17 := p_attribute17;
427 l_rec.attribute21 := p_attribute21;
424 l_rec.attribute18 := p_attribute18;
425 l_rec.attribute19 := p_attribute19;
426 l_rec.attribute20 := p_attribute20;
428 l_rec.attribute22 := p_attribute22;
429 l_rec.attribute23 := p_attribute23;
430 l_rec.attribute24 := p_attribute24;
431 l_rec.attribute25 := p_attribute25;
432 l_rec.attribute26 := p_attribute26;
433 l_rec.attribute27 := p_attribute27;
434 l_rec.attribute28 := p_attribute28;
435 l_rec.attribute29 := p_attribute29;
436 l_rec.attribute30 := p_attribute30;
437 l_rec.information_category := p_information_category;
438 l_rec.information1 := p_information1;
439 l_rec.information2 := p_information2;
440 l_rec.information3 := p_information3;
441 l_rec.information4 := p_information4;
442 l_rec.information5 := p_information5;
443 l_rec.information6 := p_information6;
444 l_rec.information7 := p_information7;
445 l_rec.information8 := p_information8;
446 l_rec.information9 := p_information9;
447 l_rec.information10 := p_information10;
448 l_rec.information11 := p_information11;
449 l_rec.information12 := p_information12;
450 l_rec.information13 := p_information13;
451 l_rec.information14 := p_information14;
452 l_rec.information15 := p_information15;
453 l_rec.information16 := p_information16;
454 l_rec.information17 := p_information17;
455 l_rec.information18 := p_information18;
456 l_rec.information19 := p_information19;
457 l_rec.information20 := p_information20;
458 l_rec.information21 := p_information21;
459 l_rec.information22 := p_information22;
460 l_rec.information23 := p_information23;
461 l_rec.information24 := p_information24;
462 l_rec.information25 := p_information25;
463 l_rec.information26 := p_information26;
464 l_rec.information27 := p_information27;
465 l_rec.information28 := p_information28;
466 l_rec.information29 := p_information29;
467 l_rec.information30 := p_information30;
468 l_rec.object_version_number := p_object_version_number;
469 --
470 -- Return the plsql record structure.
471 --
472 Return(l_rec);
473 --
474 End convert_args;
475 --
476 end pqh_rei_shd;