DBA Data[Home] [Help]

PACKAGE BODY: APPS.GHR_REI_SHD

Source


1 Package Body ghr_rei_shd as
2 /* $Header: ghreirhi.pkb 120.2.12010000.2 2008/09/02 07:19:59 vmididho ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ghr_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) 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 = 'GHR_PA_REQUEST_EXTRA_INFO_FK1') Then
22     hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
23     hr_utility.set_message_token('PROCEDURE', l_proc);
24     hr_utility.set_message_token('STEP','5');
25     hr_utility.raise_error;
26   ElsIf (p_constraint_name = 'GHR_PA_REQUEST_EXTRA_INFO_FK2') Then
27     hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
28     hr_utility.set_message_token('PROCEDURE', l_proc);
29     hr_utility.set_message_token('STEP','10');
30     hr_utility.raise_error;
31   ElsIf (p_constraint_name = 'GHR_PA_REQUEST_EXTRA_INFO_PK') Then
32     hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
33     hr_utility.set_message_token('PROCEDURE', l_proc);
34     hr_utility.set_message_token('STEP','15');
35     hr_utility.raise_error;
36   Else
37     hr_utility.set_message(801, 'HR_7877_API_INVALID_CONSTRAINT');
38     hr_utility.set_message_token('PROCEDURE', l_proc);
39     hr_utility.set_message_token('CONSTRAINT_NAME', p_constraint_name);
40     hr_utility.raise_error;
41   End If;
42   --
43   hr_utility.set_location(' Leaving:'||l_proc, 10);
44 End constraint_error;
45 --
46 -- ----------------------------------------------------------------------------
47 -- |-----------------------------< api_updating >-----------------------------|
48 -- ----------------------------------------------------------------------------
49 Function api_updating
50   (
51   p_pa_request_extra_info_id           in number,
52   p_object_version_number              in number
53   )      Return Boolean Is
54 --
55   --
56   -- Cursor selects the 'current' row from the HR Schema
57   --
58   Cursor C_Sel1 is
59     select
60 		pa_request_extra_info_id,
61 	pa_request_id,
62 	information_type,
63 	rei_attribute_category,
64 	rei_attribute1,
65 	rei_attribute2,
66 	rei_attribute3,
67 	rei_attribute4,
68 	rei_attribute5,
69 	rei_attribute6,
70 	rei_attribute7,
71 	rei_attribute8,
72 	rei_attribute9,
73 	rei_attribute10,
74 	rei_attribute11,
75 	rei_attribute12,
76 	rei_attribute13,
77 	rei_attribute14,
78 	rei_attribute15,
79 	rei_attribute16,
80 	rei_attribute17,
81 	rei_attribute18,
82 	rei_attribute19,
83 	rei_attribute20,
84 	rei_information_category,
85 	rei_information1,
86 	rei_information2,
87 	rei_information3,
88 	rei_information4,
89 	rei_information5,
90 	rei_information6,
91 	rei_information7,
92 	rei_information8,
93 	rei_information9,
94 	rei_information10,
95 	rei_information11,
96 	rei_information12,
97 	rei_information13,
98 	rei_information14,
99 	rei_information15,
100 	rei_information16,
101 	rei_information17,
102 	rei_information18,
103 	rei_information19,
104 	rei_information20,
105 	rei_information21,
106 	rei_information22,
107 	rei_information28,
108 	rei_information29,
109 	rei_information23,
110 	rei_information24,
111 	rei_information25,
112 	rei_information26,
113 	rei_information27,
114 	rei_information30,
115 	object_version_number,
116 	request_id,
117 	program_application_id,
118 	program_id,
119 	program_update_date
120     from	ghr_pa_request_extra_info
121     where	pa_request_extra_info_id = p_pa_request_extra_info_id;
122 --
123   l_proc	varchar2(72)	:= g_package||'api_updating';
124   l_fct_ret	boolean;
125 --
126 Begin
127   hr_utility.set_location('Entering:'||l_proc, 5);
128   --
129   If (
130 	p_pa_request_extra_info_id is null and
131 	p_object_version_number is null
132      ) Then
133     --
134     -- One of the primary key arguments is null therefore we must
135     -- set the returning function value to false
136     --
137     l_fct_ret := false;
138   Else
139     If (
140 	p_pa_request_extra_info_id = g_old_rec.pa_request_extra_info_id and
141 	p_object_version_number = g_old_rec.object_version_number
142        ) Then
143       hr_utility.set_location(l_proc, 10);
144       --
145       -- The g_old_rec is current therefore we must
146       -- set the returning function to true
147       --
148       l_fct_ret := true;
149     Else
150       --
151       -- Select the current row into g_old_rec
152       --
153       Open C_Sel1;
154       Fetch C_Sel1 Into g_old_rec;
155       If C_Sel1%notfound Then
156         Close C_Sel1;
157         --
158         -- The primary key is invalid therefore we must error
159         --
160         hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
161         hr_utility.raise_error;
162       End If;
163       Close C_Sel1;
164       If (p_object_version_number <> g_old_rec.object_version_number) Then
165         hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
166         hr_utility.raise_error;
167       End If;
168       hr_utility.set_location(l_proc, 15);
169       l_fct_ret := true;
170     End If;
171   End If;
172   hr_utility.set_location(' Leaving:'||l_proc, 20);
173   Return (l_fct_ret);
174 --
175 End api_updating;
176 --
177 -- ----------------------------------------------------------------------------
178 -- |---------------------------------< lck >----------------------------------|
179 -- ----------------------------------------------------------------------------
180 Procedure lck
181   (
182   p_pa_request_extra_info_id           in number,
183   p_object_version_number              in number
184   ) is
185 --
186 -- Cursor selects the 'current' row from the HR Schema
187 --
188   Cursor C_Sel1 is
189     select 	pa_request_extra_info_id,
190 	pa_request_id,
191 	information_type,
192 	rei_attribute_category,
193 	rei_attribute1,
194 	rei_attribute2,
195 	rei_attribute3,
196 	rei_attribute4,
197 	rei_attribute5,
198 	rei_attribute6,
199 	rei_attribute7,
200 	rei_attribute8,
201 	rei_attribute9,
202 	rei_attribute10,
203 	rei_attribute11,
204 	rei_attribute12,
205 	rei_attribute13,
206 	rei_attribute14,
207 	rei_attribute15,
208 	rei_attribute16,
209 	rei_attribute17,
210 	rei_attribute18,
211 	rei_attribute19,
212 	rei_attribute20,
213 	rei_information_category,
214 	rei_information1,
215 	rei_information2,
216 	rei_information3,
217 	rei_information4,
218 	rei_information5,
219 	rei_information6,
220 	rei_information7,
221 	rei_information8,
222 	rei_information9,
223 	rei_information10,
224 	rei_information11,
225 	rei_information12,
226 	rei_information13,
227 	rei_information14,
228 	rei_information15,
229 	rei_information16,
230 	rei_information17,
231 	rei_information18,
232 	rei_information19,
233 	rei_information20,
234 	rei_information21,
235 	rei_information22,
236 	rei_information28,
237 	rei_information29,
238 	rei_information23,
239 	rei_information24,
240 	rei_information25,
241 	rei_information26,
242 	rei_information27,
243 	rei_information30,
244 	object_version_number,
245 	request_id,
246 	program_application_id,
247 	program_id,
248 	program_update_date
249     from	ghr_pa_request_extra_info
250     where	pa_request_extra_info_id = p_pa_request_extra_info_id
251     for	update nowait;
252 --
253   l_proc	varchar2(72) := g_package||'lck';
254 --
255 Begin
256   hr_utility.set_location('Entering:'||l_proc, 5);
257   --
258   -- Add any mandatory argument checking here:
259   -- Example:
260   -- hr_api.mandatory_arg_error
261   --   (p_api_name       => l_proc,
262   --    p_argument       => 'object_version_number',
263   --    p_argument_value => p_object_version_number);
264   --
265   Open  C_Sel1;
266   Fetch C_Sel1 Into g_old_rec;
267   If C_Sel1%notfound then
268     Close C_Sel1;
269     --
270     -- The primary key is invalid therefore we must error
271     --
272     hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
273     hr_utility.raise_error;
274   End If;
275   Close C_Sel1;
276   If (p_object_version_number <> g_old_rec.object_version_number) Then
277         hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
278         hr_utility.raise_error;
279       End If;
280 --
281   hr_utility.set_location(' Leaving:'||l_proc, 10);
282 --
283 -- We need to trap the ORA LOCK exception
284 --
285 Exception
286   When HR_Api.Object_Locked then
287     --
288     -- The object is locked therefore we need to supply a meaningful
289     -- error message.
290     --
291     hr_utility.set_message(801, 'HR_7165_OBJECT_LOCKED');
292     hr_utility.set_message_token('TABLE_NAME', 'ghr_ogh_pa_request_extra_info');
293 
294     hr_utility.raise_error;
295 End lck;
296 --
297 -- ----------------------------------------------------------------------------
298 -- |-----------------------------< convert_args >-----------------------------|
299 -- ----------------------------------------------------------------------------
300 Function convert_args
301 	(
302 	p_pa_request_extra_info_id      in number,
303 	p_pa_request_id                 in number,
304 	p_information_type              in varchar2,
305 	p_rei_attribute_category        in varchar2,
306 	p_rei_attribute1                in varchar2,
307 	p_rei_attribute2                in varchar2,
308 	p_rei_attribute3                in varchar2,
309 	p_rei_attribute4                in varchar2,
310 	p_rei_attribute5                in varchar2,
311 	p_rei_attribute6                in varchar2,
312 	p_rei_attribute7                in varchar2,
313 	p_rei_attribute8                in varchar2,
314 	p_rei_attribute9                in varchar2,
315 	p_rei_attribute10               in varchar2,
316 	p_rei_attribute11               in varchar2,
317 	p_rei_attribute12               in varchar2,
318 	p_rei_attribute13               in varchar2,
319 	p_rei_attribute14               in varchar2,
320 	p_rei_attribute15               in varchar2,
321 	p_rei_attribute16               in varchar2,
322 	p_rei_attribute17               in varchar2,
323 	p_rei_attribute18               in varchar2,
324 	p_rei_attribute19               in varchar2,
325 	p_rei_attribute20               in varchar2,
326 	p_rei_information_category      in varchar2,
327 	p_rei_information1              in varchar2,
328 	p_rei_information2              in varchar2,
329 	p_rei_information3              in varchar2,
330 	p_rei_information4              in varchar2,
331 	p_rei_information5              in varchar2,
332 	p_rei_information6              in varchar2,
333 	p_rei_information7              in varchar2,
334 	p_rei_information8              in varchar2,
335 	p_rei_information9              in varchar2,
336 	p_rei_information10             in varchar2,
337 	p_rei_information11             in varchar2,
338 	p_rei_information12             in varchar2,
339 	p_rei_information13             in varchar2,
340 	p_rei_information14             in varchar2,
341 	p_rei_information15             in varchar2,
342 	p_rei_information16             in varchar2,
343 	p_rei_information17             in varchar2,
344 	p_rei_information18             in varchar2,
345 	p_rei_information19             in varchar2,
346 	p_rei_information20             in varchar2,
347 	p_rei_information21             in varchar2,
348 	p_rei_information22             in varchar2,
349 	p_rei_information28             in varchar2,
350 	p_rei_information29             in varchar2,
351 	p_rei_information23             in varchar2,
352 	p_rei_information24             in varchar2,
353 	p_rei_information25             in varchar2,
354 	p_rei_information26             in varchar2,
355 	p_rei_information27             in varchar2,
356 	p_rei_information30             in varchar2,
357 	p_object_version_number         in number,
358 	p_request_id                    in number,
359 	p_program_application_id        in number,
360 	p_program_id                    in number,
361 	p_program_update_date           in date
362 	)
363 	Return g_rec_type is
364 --
365   l_rec	  g_rec_type;
366   l_proc  varchar2(72) := g_package||'convert_args';
367 --
368 Begin
369   --
370   hr_utility.set_location('Entering:'||l_proc, 5);
371   --
372   -- Convert arguments into local l_rec structure.
373   --
374   l_rec.pa_request_extra_info_id         := p_pa_request_extra_info_id;
375   l_rec.pa_request_id                    := p_pa_request_id;
376   l_rec.information_type                 := p_information_type;
377   l_rec.rei_attribute_category           := p_rei_attribute_category;
378   l_rec.rei_attribute1                   := p_rei_attribute1;
379   l_rec.rei_attribute2                   := p_rei_attribute2;
380   l_rec.rei_attribute3                   := p_rei_attribute3;
381   l_rec.rei_attribute4                   := p_rei_attribute4;
382   l_rec.rei_attribute5                   := p_rei_attribute5;
383   l_rec.rei_attribute6                   := p_rei_attribute6;
384   l_rec.rei_attribute7                   := p_rei_attribute7;
385   l_rec.rei_attribute8                   := p_rei_attribute8;
386   l_rec.rei_attribute9                   := p_rei_attribute9;
387   l_rec.rei_attribute10                  := p_rei_attribute10;
388   l_rec.rei_attribute11                  := p_rei_attribute11;
389   l_rec.rei_attribute12                  := p_rei_attribute12;
390   l_rec.rei_attribute13                  := p_rei_attribute13;
391   l_rec.rei_attribute14                  := p_rei_attribute14;
392   l_rec.rei_attribute15                  := p_rei_attribute15;
393   l_rec.rei_attribute16                  := p_rei_attribute16;
394   l_rec.rei_attribute17                  := p_rei_attribute17;
395   l_rec.rei_attribute18                  := p_rei_attribute18;
396   l_rec.rei_attribute19                  := p_rei_attribute19;
397   l_rec.rei_attribute20                  := p_rei_attribute20;
398   l_rec.rei_information_category         := p_rei_information_category;
399   l_rec.rei_information1                 := p_rei_information1;
400   l_rec.rei_information2                 := p_rei_information2;
401   l_rec.rei_information3                 := p_rei_information3;
402   l_rec.rei_information4                 := p_rei_information4;
403   l_rec.rei_information5                 := p_rei_information5;
404   l_rec.rei_information6                 := p_rei_information6;
405   l_rec.rei_information7                 := p_rei_information7;
406   l_rec.rei_information8                 := p_rei_information8;
407   l_rec.rei_information9                 := p_rei_information9;
408   l_rec.rei_information10                := p_rei_information10;
409   l_rec.rei_information11                := p_rei_information11;
410   l_rec.rei_information12                := p_rei_information12;
411   l_rec.rei_information13                := p_rei_information13;
412   l_rec.rei_information14                := p_rei_information14;
413   l_rec.rei_information15                := p_rei_information15;
414   l_rec.rei_information16                := p_rei_information16;
415   l_rec.rei_information17                := p_rei_information17;
416   l_rec.rei_information18                := p_rei_information18;
417   l_rec.rei_information19                := p_rei_information19;
418   l_rec.rei_information20                := p_rei_information20;
419   l_rec.rei_information21                := p_rei_information21;
420   l_rec.rei_information22                := p_rei_information22;
421   l_rec.rei_information28                := p_rei_information28;
422   l_rec.rei_information29                := p_rei_information29;
423   l_rec.rei_information23                := p_rei_information23;
424   l_rec.rei_information24                := p_rei_information24;
425   l_rec.rei_information25                := p_rei_information25;
426   l_rec.rei_information26                := p_rei_information26;
427   l_rec.rei_information27                := p_rei_information27;
428   l_rec.rei_information30                := p_rei_information30;
429   l_rec.object_version_number            := p_object_version_number;
430   l_rec.request_id                       := p_request_id;
431   l_rec.program_application_id           := p_program_application_id;
432   l_rec.program_id                       := p_program_id;
433   l_rec.program_update_date              := p_program_update_date;
434   --
435   -- Return the plsql record structure.
436   --
437   hr_utility.set_location(' Leaving:'||l_proc, 10);
438   Return(l_rec);
439 --
440 End convert_args;
441 --
442 end ghr_rei_shd;