DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_EQT_SHD

Source


1 Package Body per_eqt_shd as
2 /* $Header: peeqtrhi.pkb 115.15 2004/03/30 18:11:30 ynegoro ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  per_eqt_shd.';  -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |------------------------< return_api_dml_status >-------------------------|
12 -- ----------------------------------------------------------------------------
13 Function return_api_dml_status Return Boolean Is
14 --
15   l_proc 	varchar2(72) := g_package||'return_api_dml_status';
16 --
17 Begin
18   hr_utility.set_location('Entering:'||l_proc, 5);
19   --
20   Return (nvl(g_api_dml, false));
21   --
22   hr_utility.set_location(' Leaving:'||l_proc, 10);
23 End return_api_dml_status;
24 --
25 -- ----------------------------------------------------------------------------
26 -- |---------------------------< constraint_error >---------------------------|
27 -- ----------------------------------------------------------------------------
28 Procedure constraint_error
29             (p_constraint_name in all_constraints.constraint_name%TYPE) Is
30 --
31   l_proc 	varchar2(72) := g_package||'constraint_error';
32 --
33 Begin
34   hr_utility.set_location('Entering:'||l_proc, 5);
35   --
36   If (p_constraint_name = 'PER_QUALIFICATION_TYPES_PK') Then
37     hr_utility.set_message(801, 'HR_51535_EQT_QUAL_TYPE_PK');
38     hr_utility.raise_error;
39   --
40   -- pmfletch. Now coded check in TL row handler
41   --
42   -- ElsIf (p_constraint_name = 'PER_QUALIFICATION_TYPES_UK') Then
43   --   hr_utility.set_message(801, 'HR_51536_EQT_NAME_UK');
44   --   hr_utility.raise_error;
45   Else
46     hr_utility.set_message(801, 'HR_7877_API_INVALID_CONSTRAINT');
47     hr_utility.set_message_token('PROCEDURE', l_proc);
48     hr_utility.set_message_token('CONSTRAINT_NAME', p_constraint_name);
49     hr_utility.raise_error;
50   End If;
51   --
52   hr_utility.set_location(' Leaving:'||l_proc, 10);
53 End constraint_error;
54 --
55 -- ----------------------------------------------------------------------------
56 -- |-----------------------------< api_updating >-----------------------------|
57 -- ----------------------------------------------------------------------------
58 Function api_updating
59   (
60   p_qualification_type_id              in number,
61   p_object_version_number              in number
62   )      Return Boolean Is
63 --
64   --
65   -- Cursor selects the 'current' row from the HR Schema
66 
67   -- mvankda
68   -- Added Developer DF Columns to cursor C_Sel1
69 
70   Cursor C_Sel1 is
71     select
72 	qualification_type_id,
73 	name,
74 	category,
75 	rank,
76 	attribute_category,
77 	attribute1,
78 	attribute2,
79 	attribute3,
80 	attribute4,
81 	attribute5,
82 	attribute6,
83 	attribute7,
84 	attribute8,
85 	attribute9,
86 	attribute10,
87 	attribute11,
88 	attribute12,
89 	attribute13,
90 	attribute14,
91 	attribute15,
92 	attribute16,
93 	attribute17,
94 	attribute18,
95 	attribute19,
96 	attribute20,
97 	object_version_number,
98 	information_category,
99         information1,
100  	information2,
101 	information3,
102 	information4,
103 	information5,
104 	information6,
105 	information7,
106 	information8,
107 	information9,
108 	information10,
109 	information11,
110 	information12,
111 	information13,
112 	information14,
113 	information15,
114 	information16,
115 	information17,
116 	information18,
117 	information19,
118 	information20,
119 	information21,
120 	information22,
121 	information23,
122 	information24,
123 	information25,
124 	information26,
125 	information27,
126 	information28,
127 	information29,
128 	information30
129        ,qual_framework_id     -- BUG3356369
130        ,qualification_type
131        ,credit_type
132        ,credits
133        ,level_type
134        ,level_number
135        ,field
136        ,sub_field
137        ,provider
138        ,qa_organization
139     from	per_qualification_types
140     where	qualification_type_id = p_qualification_type_id;
141 --
142   l_proc	varchar2(72)	:= g_package||'api_updating';
143   l_fct_ret	boolean;
144 --
145 Begin
146   hr_utility.set_location('Entering:'||l_proc, 5);
147   --
148   If (
149 	p_qualification_type_id is null and
150 	p_object_version_number is null
151      ) Then
152     --
153     -- One of the primary key arguments is null therefore we must
154     -- set the returning function value to false
155     --
156     l_fct_ret := false;
157   Else
158     If (
159 	p_qualification_type_id = g_old_rec.qualification_type_id and
160 	p_object_version_number = g_old_rec.object_version_number
161        ) Then
162       hr_utility.set_location(l_proc, 10);
163       --
164       -- The g_old_rec is current therefore we must
165       -- set the returning function to true
166       --
167       l_fct_ret := true;
168     Else
169       --
170       -- Select the current row into g_old_rec
171       --
172       Open C_Sel1;
173       Fetch C_Sel1 Into g_old_rec;
174       If C_Sel1%notfound Then
175         Close C_Sel1;
176         --
177         -- The primary key is invalid therefore we must error
178         --
179         hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
180         hr_utility.raise_error;
181       End If;
182       Close C_Sel1;
183       If (p_object_version_number <> g_old_rec.object_version_number) Then
184         hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
185         hr_utility.raise_error;
186       End If;
187       hr_utility.set_location(l_proc, 15);
188       l_fct_ret := true;
189     End If;
190   End If;
191   hr_utility.set_location(' Leaving:'||l_proc, 20);
192   Return (l_fct_ret);
193 --
194 End api_updating;
195 --
196 -- ----------------------------------------------------------------------------
197 -- |---------------------------------< lck >----------------------------------|
198 -- ----------------------------------------------------------------------------
199 Procedure lck
200   (
201   p_qualification_type_id              in number,
202   p_object_version_number              in number
203   ) is
204 --
205 -- Cursor selects the 'current' row from the HR Schema
206 --
207 -- mvankda
208 -- Added Developer DF columns to Curor C_Sel1
209 
210   Cursor C_Sel1 is
211     select 	qualification_type_id,
212 	name,
213 	category,
214 	rank,
215 	attribute_category,
216 	attribute1,
217 	attribute2,
218 	attribute3,
219 	attribute4,
220 	attribute5,
221 	attribute6,
222 	attribute7,
223 	attribute8,
224 	attribute9,
225 	attribute10,
226 	attribute11,
227 	attribute12,
228 	attribute13,
229 	attribute14,
230 	attribute15,
231 	attribute16,
232 	attribute17,
233 	attribute18,
234 	attribute19,
235 	attribute20,
236 	object_version_number,
237 	information_category,
238         information1,
239  	information2,
240 	information3,
241 	information4,
242 	information5,
243 	information6,
244 	information7,
245 	information8,
246 	information9,
247 	information10,
248 	information11,
249 	information12,
250 	information13,
251 	information14,
252 	information15,
253 	information16,
254 	information17,
255 	information18,
256 	information19,
257 	information20,
258 	information21,
259 	information22,
260 	information23,
261 	information24,
262 	information25,
263 	information26,
264 	information27,
265 	information28,
266 	information29,
267 	information30
268        ,qual_framework_id     -- BUG3356369
269        ,qualification_type
270        ,credit_type
271        ,credits
272        ,level_type
273        ,level_number
274        ,field
275        ,sub_field
276        ,provider
277        ,qa_organization
278     from	per_qualification_types
279     where	qualification_type_id = p_qualification_type_id
280     for	update nowait;
281 --
282   l_proc	varchar2(72) := g_package||'lck';
283 --
284 Begin
285   hr_utility.set_location('Entering:'||l_proc, 5);
286   --
287   -- Add any mandatory argument checking here:
288   -- Example:
289   -- hr_api.mandatory_arg_error
290   --   (p_api_name       => l_proc,
291   --    p_argument       => 'object_version_number',
292   --    p_argument_value => p_object_version_number);
293   --
294   Open  C_Sel1;
295   Fetch C_Sel1 Into g_old_rec;
296   If C_Sel1%notfound then
297     Close C_Sel1;
298     --
299     -- The primary key is invalid therefore we must error
300     --
301     hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
302     hr_utility.raise_error;
303   End If;
304   Close C_Sel1;
305   If (p_object_version_number <> g_old_rec.object_version_number) Then
306         hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
307         hr_utility.raise_error;
308       End If;
309 --
310   hr_utility.set_location(' Leaving:'||l_proc, 10);
311 --
312 -- We need to trap the ORA LOCK exception
313 --
314 Exception
315   When HR_Api.Object_Locked then
316     --
317     -- The object is locked therefore we need to supply a meaningful
318     -- error message.
319     --
320     hr_utility.set_message(801, 'HR_7165_OBJECT_LOCKED');
321     hr_utility.set_message_token('TABLE_NAME', 'per_qualification_types');
322     hr_utility.raise_error;
323 End lck;
324 --
325 -- ----------------------------------------------------------------------------
326 -- |-----------------------------< convert_args >-----------------------------|
327 -- ----------------------------------------------------------------------------
328 -- mvankada
329 -- Added Developer DF columns
330 Function convert_args
331 	(
332 	p_qualification_type_id   in number,
333 	p_name                    in varchar2,
334 	p_category                in varchar2,
335 	p_rank                    in number,
336 	p_attribute_category      in varchar2,
337 	p_attribute1              in varchar2,
338 	p_attribute2              in varchar2,
339 	p_attribute3              in varchar2,
340 	p_attribute4              in varchar2,
341 	p_attribute5              in varchar2,
342 	p_attribute6              in varchar2,
343 	p_attribute7              in varchar2,
344 	p_attribute8              in varchar2,
345 	p_attribute9              in varchar2,
346 	p_attribute10             in varchar2,
347 	p_attribute11             in varchar2,
348 	p_attribute12             in varchar2,
349 	p_attribute13             in varchar2,
350 	p_attribute14             in varchar2,
351 	p_attribute15             in varchar2,
352 	p_attribute16             in varchar2,
353 	p_attribute17             in varchar2,
354 	p_attribute18             in varchar2,
355 	p_attribute19             in varchar2,
356 	p_attribute20             in varchar2,
357 	p_object_version_number   in number,
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_qual_framework_id       in number   -- BUG3356369
390        ,p_qualification_type      in varchar2
391        ,p_credit_type             in varchar2
392        ,p_credits                 in number
393        ,p_level_type              in varchar2
394        ,p_level_number            in number
395        ,p_field                   in varchar2
396        ,p_sub_field               in varchar2
397        ,p_provider                in varchar2
398        ,p_qa_organization         in varchar2
399 	)
400 	Return g_rec_type is
401 --
402   l_rec	  g_rec_type;
403   l_proc  varchar2(72) := g_package||'convert_args';
404 --
405 Begin
406   --
407   hr_utility.set_location('Entering:'||l_proc, 5);
408   --
409   -- Convert arguments into local l_rec structure.
410   --
411 
412   l_rec.qualification_type_id      := p_qualification_type_id;
413   l_rec.name                       := p_name;
414   l_rec.category                   := p_category;
415   l_rec.rank                       := p_rank;
416   l_rec.attribute_category         := p_attribute_category;
417   l_rec.attribute1                 := p_attribute1;
418   l_rec.attribute2                 := p_attribute2;
419   l_rec.attribute3                 := p_attribute3;
420   l_rec.attribute4                 := p_attribute4;
421   l_rec.attribute5                 := p_attribute5;
422   l_rec.attribute6                 := p_attribute6;
423   l_rec.attribute7                 := p_attribute7;
424   l_rec.attribute8                 := p_attribute8;
425   l_rec.attribute9                 := p_attribute9;
426   l_rec.attribute10                := p_attribute10;
427   l_rec.attribute11                := p_attribute11;
428   l_rec.attribute12                := p_attribute12;
429   l_rec.attribute13                := p_attribute13;
430   l_rec.attribute14                := p_attribute14;
431   l_rec.attribute15                := p_attribute15;
432   l_rec.attribute16                := p_attribute16;
433   l_rec.attribute17                := p_attribute17;
434   l_rec.attribute18                := p_attribute18;
435   l_rec.attribute19                := p_attribute19;
436   l_rec.attribute20                := p_attribute20;
437   l_rec.object_version_number      := p_object_version_number;
438 
439   -- mvankada
440   -- For DDF columns
441   l_rec.information_category       := p_information_category;
442   l_rec.information1	    	   := p_information1;
443   l_rec.information2	  	   := p_information2;
444   l_rec.information3	 	   := p_information3;
445   l_rec.information4	 	   := p_information4;
446   l_rec.information5	  	   := p_information5;
447   l_rec.information6	  	   := p_information6;
448   l_rec.information7	  	   := p_information7;
449   l_rec.information8	  	   := p_information8;
450   l_rec.information9	  	   := p_information9;
451   l_rec.information10	  	   := p_information10;
452   l_rec.information11	  	   := p_information11;
453   l_rec.information12	  	   := p_information12;
454   l_rec.information13	 	   := p_information13;
455   l_rec.information14	  	   := p_information14;
456   l_rec.information15	 	   := p_information15;
457   l_rec.information16	  	   := p_information16;
458   l_rec.information17	  	   := p_information17;
459   l_rec.information18	 	   := p_information18;
460   l_rec.information19	 	   := p_information19;
461   l_rec.information20	   	   := p_information20;
462   l_rec.information21	 	   := p_information21;
463   l_rec.information22	   	   := p_information22;
464   l_rec.information23	   	   := p_information23;
465   l_rec.information24	  	   := p_information24;
466   l_rec.information25	  	   := p_information25;
467   l_rec.information26	  	   := p_information26;
468   l_rec.information27		   := p_information27;
469   l_rec.information28	  	   := p_information28;
470   l_rec.information29	  	   := p_information29;
471   l_rec.information30	  	   := p_information30;
472 
473   -- BUG3356369
474   l_rec.qual_framework_id          := p_qual_framework_id;
475   l_rec.qualification_type         := p_qualification_type;
476   l_rec.credit_type                := p_credit_type;
477   l_rec.credits                    := p_credits;
478   l_rec.level_type                 := p_level_type;
479   l_rec.level_number               := p_level_number;
480   l_rec.field                      := p_field     ;
481   l_rec.sub_field                  := p_sub_field;
482   l_rec.provider                   := p_provider;
483   l_rec.qa_organization            := p_qa_organization;
484   --
485   -- Return the plsql record structure.
486   --
487   hr_utility.set_location(' Leaving:'||l_proc, 10);
488   Return(l_rec);
489 --
490 End convert_args;
491 --
492 end per_eqt_shd;