DBA Data[Home] [Help]

PACKAGE BODY: APPS.PQH_LOS_SHD

Source


4 -- ----------------------------------------------------------------------------
1 Package Body pqh_los_shd as
2 /* $Header: pqlosrhi.pkb 120.0 2005/05/29 02:11:26 appldev noship $ */
3 --
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  pqh_los_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_SITUATIONS_PK') Then
22     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
23     fnd_message.set_token('PROCEDURE', l_proc);
24     fnd_message.set_token('STEP','5');
25     fnd_message.raise_error;
26   Else
27     fnd_message.set_name('PAY', 'HR_7877_API_INVALID_CONSTRAINT');
28     fnd_message.set_token('PROCEDURE', l_proc);
29     fnd_message.set_token('CONSTRAINT_NAME', p_constraint_name);
30     fnd_message.raise_error;
31   End If;
32   --
33 End constraint_error;
34 --
35 -- ----------------------------------------------------------------------------
36 -- |-----------------------------< api_updating >-----------------------------|
37 -- ----------------------------------------------------------------------------
38 Function api_updating
39   (p_situation_id                         in     number
40   ,p_object_version_number                in     number
41   )
42   Return Boolean Is
43   --
44   --
45   -- Cursor selects the 'current' row from the HR Schema
46   --
47   Cursor C_Sel1 is
48     select
49        situation_id
50       ,situation
51       ,effective_start_date
52       ,effective_end_date
53       ,business_group_id
54       ,situation_type
55       ,length_of_service
56       ,employee_type
57       ,entitlement_flag
58       ,worktime_proportional
59       ,entitlement_value
60       ,information_category
61       ,information1
62       ,information2
63       ,information3
64       ,information4
65       ,information5
66       ,information6
67       ,information7
68       ,information8
69       ,information9
70       ,information10
71       ,information11
72       ,information12
73       ,information13
74       ,information14
75       ,information15
76       ,information16
77       ,information17
78       ,information18
79       ,information19
80       ,information20
81       ,information21
82       ,information22
83       ,information23
84       ,information24
85       ,information25
86       ,information26
87       ,information27
88       ,information28
89       ,information29
90       ,information30
91       ,attribute_category
92       ,attribute1
93       ,attribute2
94       ,attribute3
95       ,attribute4
96       ,attribute5
97       ,attribute6
98       ,attribute7
99       ,attribute8
100       ,attribute9
101       ,attribute10
102       ,attribute11
103       ,attribute12
104       ,attribute13
105       ,attribute14
106       ,attribute15
107       ,attribute16
108       ,attribute17
109       ,attribute18
110       ,attribute19
111       ,attribute20
112       ,attribute21
113       ,attribute22
114       ,attribute23
115       ,attribute24
116       ,attribute25
117       ,attribute26
118       ,attribute27
119       ,attribute28
120       ,attribute29
121       ,attribute30
122       ,object_version_number
123     from        pqh_situations
124     where       situation_id = p_situation_id;
125   --
126   l_fct_ret     boolean;
127   --
128 Begin
129   --
130   If (p_situation_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 (p_situation_id
140         = pqh_los_shd.g_old_rec.situation_id and
141         p_object_version_number
142         = pqh_los_shd.g_old_rec.object_version_number
143        ) Then
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 pqh_los_shd.g_old_rec;
155       If C_Sel1%notfound Then
156         Close C_Sel1;
160         fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
157         --
158         -- The primary key is invalid therefore we must error
159         --
161         fnd_message.raise_error;
162       End If;
163       Close C_Sel1;
164       If (p_object_version_number
165           <> pqh_los_shd.g_old_rec.object_version_number) Then
166         fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
167         fnd_message.raise_error;
168       End If;
169       l_fct_ret := true;
170     End If;
171   End If;
172   Return (l_fct_ret);
173 --
174 End api_updating;
175 --
176 -- ----------------------------------------------------------------------------
177 -- |---------------------------------< lck >----------------------------------|
178 -- ----------------------------------------------------------------------------
179 Procedure lck
180   (p_situation_id                         in     number
181   ,p_object_version_number                in     number
182   ) is
183 --
184 -- Cursor selects the 'current' row from the HR Schema
185 --
186   Cursor C_Sel1 is
187     select
188        situation_id
189       ,situation
190       ,effective_start_date
191       ,effective_end_date
192       ,business_group_id
193       ,situation_type
194       ,length_of_service
195       ,employee_type
196       ,entitlement_flag
197       ,worktime_proportional
198       ,entitlement_value
199       ,information_category
200       ,information1
201       ,information2
202       ,information3
203       ,information4
204       ,information5
205       ,information6
206       ,information7
207       ,information8
208       ,information9
209       ,information10
210       ,information11
211       ,information12
212       ,information13
213       ,information14
214       ,information15
215       ,information16
216       ,information17
217       ,information18
218       ,information19
219       ,information20
220       ,information21
221       ,information22
222       ,information23
223       ,information24
224       ,information25
225       ,information26
226       ,information27
227       ,information28
228       ,information29
229       ,information30
230       ,attribute_category
231       ,attribute1
232       ,attribute2
233       ,attribute3
234       ,attribute4
235       ,attribute5
236       ,attribute6
237       ,attribute7
238       ,attribute8
239       ,attribute9
240       ,attribute10
241       ,attribute11
242       ,attribute12
243       ,attribute13
244       ,attribute14
245       ,attribute15
246       ,attribute16
247       ,attribute17
248       ,attribute18
249       ,attribute19
250       ,attribute20
251       ,attribute21
252       ,attribute22
253       ,attribute23
254       ,attribute24
255       ,attribute25
256       ,attribute26
257       ,attribute27
258       ,attribute28
259       ,attribute29
260       ,attribute30
261       ,object_version_number
262     from        pqh_situations
263     where       situation_id = p_situation_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           => 'SITUATION_ID'
274     ,p_argument_value     => p_situation_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_los_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     fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
291     fnd_message.raise_error;
292   End If;
293   Close C_Sel1;
294   If (p_object_version_number
295       <> pqh_los_shd.g_old_rec.object_version_number) Then
296         fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
297         fnd_message.raise_error;
298   End If;
299   --
300   hr_utility.set_location(' Leaving:'||l_proc, 10);
301   --
302   -- We need to trap the ORA LOCK exception
303   --
304 Exception
305   When HR_Api.Object_Locked then
306     --
307     -- The object is locked therefore we need to supply a meaningful
308     -- error message.
309     --
310     fnd_message.set_name('PAY', 'HR_7165_OBJECT_LOCKED');
311     fnd_message.set_token('TABLE_NAME', 'pqh_situations');
312     fnd_message.raise_error;
313 End lck;
314 --
315 -- ----------------------------------------------------------------------------
316 -- |-----------------------------< convert_args >-----------------------------|
317 -- ----------------------------------------------------------------------------
318 Function convert_args
319   (p_situation_id                   in number
320   ,p_situation                      in varchar2
321   ,p_effective_start_date           in date
322   ,p_effective_end_date             in date
323   ,p_business_group_id              in number
324   ,p_situation_type                 in varchar2
328   ,p_worktime_proportional          in varchar2
325   ,p_length_of_service              in varchar2
326   ,p_employee_type                  in varchar2
327   ,p_entitlement_flag               in varchar2
329   ,p_entitlement_value              in number
330   ,p_information_category           in varchar2
331   ,p_information1                   in varchar2
332   ,p_information2                   in varchar2
333   ,p_information3                   in varchar2
334   ,p_information4                   in varchar2
335   ,p_information5                   in varchar2
336   ,p_information6                   in varchar2
337   ,p_information7                   in varchar2
338   ,p_information8                   in varchar2
339   ,p_information9                   in varchar2
340   ,p_information10                  in varchar2
341   ,p_information11                  in varchar2
342   ,p_information12                  in varchar2
343   ,p_information13                  in varchar2
344   ,p_information14                  in varchar2
345   ,p_information15                  in varchar2
346   ,p_information16                  in varchar2
347   ,p_information17                  in varchar2
348   ,p_information18                  in varchar2
349   ,p_information19                  in varchar2
350   ,p_information20                  in varchar2
351   ,p_information21                  in varchar2
352   ,p_information22                  in varchar2
353   ,p_information23                  in varchar2
354   ,p_information24                  in varchar2
355   ,p_information25                  in varchar2
356   ,p_information26                  in varchar2
357   ,p_information27                  in varchar2
358   ,p_information28                  in varchar2
359   ,p_information29                  in varchar2
360   ,p_information30                  in varchar2
361   ,p_attribute_category             in varchar2
362   ,p_attribute1                     in varchar2
363   ,p_attribute2                     in varchar2
364   ,p_attribute3                     in varchar2
365   ,p_attribute4                     in varchar2
366   ,p_attribute5                     in varchar2
367   ,p_attribute6                     in varchar2
368   ,p_attribute7                     in varchar2
369   ,p_attribute8                     in varchar2
370   ,p_attribute9                     in varchar2
371   ,p_attribute10                    in varchar2
372   ,p_attribute11                    in varchar2
373   ,p_attribute12                    in varchar2
374   ,p_attribute13                    in varchar2
375   ,p_attribute14                    in varchar2
376   ,p_attribute15                    in varchar2
377   ,p_attribute16                    in varchar2
378   ,p_attribute17                    in varchar2
379   ,p_attribute18                    in varchar2
380   ,p_attribute19                    in varchar2
381   ,p_attribute20                    in varchar2
382   ,p_attribute21                    in varchar2
383   ,p_attribute22                    in varchar2
384   ,p_attribute23                    in varchar2
385   ,p_attribute24                    in varchar2
386   ,p_attribute25                    in varchar2
387   ,p_attribute26                    in varchar2
388   ,p_attribute27                    in varchar2
389   ,p_attribute28                    in varchar2
390   ,p_attribute29                    in varchar2
391   ,p_attribute30                    in varchar2
392   ,p_object_version_number          in number
393   )
394   Return g_rec_type is
395 --
396   l_rec   g_rec_type;
397 --
398 Begin
399   --
400   -- Convert arguments into local l_rec structure.
401   --
402   l_rec.situation_id                     := p_situation_id;
403   l_rec.situation                        := p_situation;
404   l_rec.effective_start_date             := p_effective_start_date;
405   l_rec.effective_end_date               := p_effective_end_date;
406   l_rec.business_group_id                := p_business_group_id;
407   l_rec.situation_type                   := p_situation_type;
408   l_rec.length_of_service                := p_length_of_service;
409   l_rec.employee_type                    := p_employee_type;
410   l_rec.entitlement_flag                 := p_entitlement_flag;
411   l_rec.worktime_proportional            := p_worktime_proportional;
412   l_rec.entitlement_value                := p_entitlement_value;
413   l_rec.information_category             := p_information_category;
414   l_rec.information1                     := p_information1;
415   l_rec.information2                     := p_information2;
416   l_rec.information3                     := p_information3;
417   l_rec.information4                     := p_information4;
418   l_rec.information5                     := p_information5;
419   l_rec.information6                     := p_information6;
420   l_rec.information7                     := p_information7;
421   l_rec.information8                     := p_information8;
422   l_rec.information9                     := p_information9;
423   l_rec.information10                    := p_information10;
424   l_rec.information11                    := p_information11;
425   l_rec.information12                    := p_information12;
426   l_rec.information13                    := p_information13;
427   l_rec.information14                    := p_information14;
428   l_rec.information15                    := p_information15;
429   l_rec.information16                    := p_information16;
430   l_rec.information17                    := p_information17;
431   l_rec.information18                    := p_information18;
432   l_rec.information19                    := p_information19;
433   l_rec.information20                    := p_information20;
434   l_rec.information21                    := p_information21;
435   l_rec.information22                    := p_information22;
439   l_rec.information26                    := p_information26;
436   l_rec.information23                    := p_information23;
437   l_rec.information24                    := p_information24;
438   l_rec.information25                    := p_information25;
440   l_rec.information27                    := p_information27;
441   l_rec.information28                    := p_information28;
442   l_rec.information29                    := p_information29;
443   l_rec.information30                    := p_information30;
444   l_rec.attribute_category               := p_attribute_category;
445   l_rec.attribute1                       := p_attribute1;
446   l_rec.attribute2                       := p_attribute2;
447   l_rec.attribute3                       := p_attribute3;
448   l_rec.attribute4                       := p_attribute4;
449   l_rec.attribute5                       := p_attribute5;
450   l_rec.attribute6                       := p_attribute6;
451   l_rec.attribute7                       := p_attribute7;
452   l_rec.attribute8                       := p_attribute8;
453   l_rec.attribute9                       := p_attribute9;
454   l_rec.attribute10                      := p_attribute10;
455   l_rec.attribute11                      := p_attribute11;
456   l_rec.attribute12                      := p_attribute12;
457   l_rec.attribute13                      := p_attribute13;
458   l_rec.attribute14                      := p_attribute14;
459   l_rec.attribute15                      := p_attribute15;
460   l_rec.attribute16                      := p_attribute16;
461   l_rec.attribute17                      := p_attribute17;
462   l_rec.attribute18                      := p_attribute18;
463   l_rec.attribute19                      := p_attribute19;
464   l_rec.attribute20                      := p_attribute20;
465   l_rec.attribute21                      := p_attribute21;
466   l_rec.attribute22                      := p_attribute22;
467   l_rec.attribute23                      := p_attribute23;
468   l_rec.attribute24                      := p_attribute24;
469   l_rec.attribute25                      := p_attribute25;
470   l_rec.attribute26                      := p_attribute26;
471   l_rec.attribute27                      := p_attribute27;
472   l_rec.attribute28                      := p_attribute28;
473   l_rec.attribute29                      := p_attribute29;
474   l_rec.attribute30                      := p_attribute30;
475   l_rec.object_version_number            := p_object_version_number;
476   --
477   -- Return the plsql record structure.
478   --
479   Return(l_rec);
480 --
481 End convert_args;
482 --
483 end pqh_los_shd;