DBA Data[Home] [Help]

PACKAGE BODY: APPS.PQP_SHP_SHD

Source


1 Package Body pqp_shp_shd as
2 /* $Header: pqshprhi.pkb 115.8 2003/02/17 22:14:48 tmehra noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  pqp_shp_shd.';  -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |------------------------< return_api_dml_status >-------------------------|
12 -- ----------------------------------------------------------------------------
13 Function return_api_dml_status Return Boolean Is
14 --
15 Begin
16   --
17   Return (nvl(g_api_dml, false));
18   --
19 End return_api_dml_status;
20 --
21 -- ----------------------------------------------------------------------------
22 -- |---------------------------< constraint_error >---------------------------|
23 -- ----------------------------------------------------------------------------
24 Procedure constraint_error
25   (p_constraint_name in all_constraints.constraint_name%TYPE
26   ) Is
27 --
28   l_proc 	varchar2(72) := g_package||'constraint_error';
29 --
30 Begin
31   --
32   If (p_constraint_name = 'PQP_SERVICE_HISTORY_PERIODS_PK') Then
33     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
34     fnd_message.set_token('PROCEDURE', l_proc);
35     fnd_message.set_token('STEP','5');
36     fnd_message.raise_error;
37   Else
38     fnd_message.set_name('PAY', 'HR_7877_API_INVALID_CONSTRAINT');
39     fnd_message.set_token('PROCEDURE', l_proc);
40     fnd_message.set_token('CONSTRAINT_NAME', p_constraint_name);
41     fnd_message.raise_error;
42   End If;
43   --
44 End constraint_error;
45 --
46 -- ----------------------------------------------------------------------------
47 -- |-----------------------------< api_updating >-----------------------------|
48 -- ----------------------------------------------------------------------------
49 Function api_updating
50   (p_service_history_period_id            in     number
51   ,p_object_version_number                in     number
52   )
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        service_history_period_id
61       ,business_group_id
62       ,assignment_id
63       ,start_date
64       ,end_date
65       ,employer_name
66       ,employer_address
67       ,employer_type
68       ,employer_subtype
69       ,period_years
70       ,period_days
71       ,description
72       ,continuous_service
73       ,all_assignments
74       ,object_version_number
75       ,shp_attribute_category
76       ,shp_attribute1
77       ,shp_attribute2
78       ,shp_attribute3
79       ,shp_attribute4
80       ,shp_attribute5
81       ,shp_attribute6
82       ,shp_attribute7
83       ,shp_attribute8
84       ,shp_attribute9
85       ,shp_attribute10
86       ,shp_attribute11
87       ,shp_attribute12
88       ,shp_attribute13
89       ,shp_attribute14
90       ,shp_attribute15
91       ,shp_attribute16
92       ,shp_attribute17
93       ,shp_attribute18
94       ,shp_attribute19
95       ,shp_attribute20
96       ,shp_information_category
97       ,shp_information1
98       ,shp_information2
99       ,shp_information3
100       ,shp_information4
101       ,shp_information5
102       ,shp_information6
103       ,shp_information7
104       ,shp_information8
105       ,shp_information9
106       ,shp_information10
107       ,shp_information11
108       ,shp_information12
109       ,shp_information13
110       ,shp_information14
111       ,shp_information15
112       ,shp_information16
113       ,shp_information17
114       ,shp_information18
115       ,shp_information19
116       ,shp_information20
117     from	pqp_service_history_periods
118     where	service_history_period_id = p_service_history_period_id;
119 --
120   l_fct_ret	boolean;
121 --
122 Begin
123   --
124   If (p_service_history_period_id is null and
125       p_object_version_number is null
126      ) Then
127     --
128     -- One of the primary key arguments is null therefore we must
129     -- set the returning function value to false
130     --
131     l_fct_ret := false;
132   Else
133     If (p_service_history_period_id
134         = pqp_shp_shd.g_old_rec.service_history_period_id and
135         p_object_version_number
136         = pqp_shp_shd.g_old_rec.object_version_number
137        ) Then
138       --
139       -- The g_old_rec is current therefore we must
140       -- set the returning function to true
141       --
142       l_fct_ret := true;
143     Else
144       --
145       -- Select the current row into g_old_rec
146       --
147       Open C_Sel1;
148       Fetch C_Sel1 Into pqp_shp_shd.g_old_rec;
149       If C_Sel1%notfound Then
150         Close C_Sel1;
151         --
152         -- The primary key is invalid therefore we must error
153         --
154         fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
155         fnd_message.raise_error;
156       End If;
157       Close C_Sel1;
158       If (p_object_version_number
159           <> pqp_shp_shd.g_old_rec.object_version_number) Then
160         fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
161         fnd_message.raise_error;
162       End If;
163       l_fct_ret := true;
164     End If;
165   End If;
166   Return (l_fct_ret);
167 --
168 End api_updating;
169 --
170 -- ----------------------------------------------------------------------------
171 -- |---------------------------------< lck >----------------------------------|
172 -- ----------------------------------------------------------------------------
173 Procedure lck
174   (p_service_history_period_id            in     number
175   ,p_object_version_number                in     number
176   ) is
177 --
178 -- Cursor selects the 'current' row from the HR Schema
179 --
180   Cursor C_Sel1 is
181     select
182        service_history_period_id
183       ,business_group_id
184       ,assignment_id
185       ,start_date
186       ,end_date
187       ,employer_name
188       ,employer_address
189       ,employer_type
190       ,employer_subtype
191       ,period_years
192       ,period_days
193       ,description
194       ,continuous_service
195       ,all_assignments
196       ,object_version_number
197       ,shp_attribute_category
198       ,shp_attribute1
199       ,shp_attribute2
200       ,shp_attribute3
201       ,shp_attribute4
202       ,shp_attribute5
203       ,shp_attribute6
204       ,shp_attribute7
205       ,shp_attribute8
206       ,shp_attribute9
207       ,shp_attribute10
208       ,shp_attribute11
209       ,shp_attribute12
210       ,shp_attribute13
211       ,shp_attribute14
212       ,shp_attribute15
213       ,shp_attribute16
214       ,shp_attribute17
215       ,shp_attribute18
216       ,shp_attribute19
217       ,shp_attribute20
218       ,shp_information_category
219       ,shp_information1
220       ,shp_information2
221       ,shp_information3
222       ,shp_information4
223       ,shp_information5
224       ,shp_information6
225       ,shp_information7
226       ,shp_information8
227       ,shp_information9
228       ,shp_information10
229       ,shp_information11
230       ,shp_information12
231       ,shp_information13
232       ,shp_information14
233       ,shp_information15
234       ,shp_information16
235       ,shp_information17
236       ,shp_information18
237       ,shp_information19
238       ,shp_information20
239     from	pqp_service_history_periods
240     where	service_history_period_id = p_service_history_period_id
241     for	update nowait;
242 --
243   l_proc	varchar2(72) := g_package||'lck';
244 --
245 Begin
246   hr_utility.set_location('Entering:'||l_proc, 5);
247   --
248   hr_api.mandatory_arg_error
249     (p_api_name           => l_proc
250     ,p_argument           => 'SERVICE_HISTORY_PERIOD_ID'
251     ,p_argument_value     => p_service_history_period_id
252     );
253   --
254   Open  C_Sel1;
255   Fetch C_Sel1 Into pqp_shp_shd.g_old_rec;
256   If C_Sel1%notfound then
257     Close C_Sel1;
258     --
259     -- The primary key is invalid therefore we must error
260     --
261     fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
262     fnd_message.raise_error;
263   End If;
264   Close C_Sel1;
265   If (p_object_version_number
266       <> pqp_shp_shd.g_old_rec.object_version_number) Then
267         fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
268         fnd_message.raise_error;
269   End If;
270   --
271   hr_utility.set_location(' Leaving:'||l_proc, 10);
272   --
273   -- We need to trap the ORA LOCK exception
274   --
275 Exception
276   When HR_Api.Object_Locked then
277     --
278     -- The object is locked therefore we need to supply a meaningful
279     -- error message.
280     --
281     fnd_message.set_name('PAY', 'HR_7165_OBJECT_LOCKED');
282     fnd_message.set_token('TABLE_NAME', 'pqp_service_history_periods');
283     fnd_message.raise_error;
284 End lck;
285 --
286 -- ----------------------------------------------------------------------------
287 -- |-----------------------------< convert_args >-----------------------------|
288 -- ----------------------------------------------------------------------------
289 Function convert_args
290   (p_service_history_period_id      in number
291   ,p_business_group_id              in number
292   ,p_assignment_id                  in number
293   ,p_start_date                     in date
294   ,p_end_date                       in date
295   ,p_employer_name                  in varchar2
296   ,p_employer_address               in varchar2
297   ,p_employer_type                  in varchar2
298   ,p_employer_subtype               in varchar2
299   ,p_period_years                   in number
300   ,p_period_days                    in number
301   ,p_description                    in varchar2
302   ,p_continuous_service             in varchar2
303   ,p_all_assignments                in varchar2
304   ,p_object_version_number          in number
305   ,p_shp_attribute_category         in varchar2
306   ,p_shp_attribute1                 in varchar2
307   ,p_shp_attribute2                 in varchar2
308   ,p_shp_attribute3                 in varchar2
309   ,p_shp_attribute4                 in varchar2
310   ,p_shp_attribute5                 in varchar2
311   ,p_shp_attribute6                 in varchar2
312   ,p_shp_attribute7                 in varchar2
313   ,p_shp_attribute8                 in varchar2
314   ,p_shp_attribute9                 in varchar2
315   ,p_shp_attribute10                in varchar2
316   ,p_shp_attribute11                in varchar2
317   ,p_shp_attribute12                in varchar2
318   ,p_shp_attribute13                in varchar2
319   ,p_shp_attribute14                in varchar2
320   ,p_shp_attribute15                in varchar2
321   ,p_shp_attribute16                in varchar2
322   ,p_shp_attribute17                in varchar2
323   ,p_shp_attribute18                in varchar2
324   ,p_shp_attribute19                in varchar2
325   ,p_shp_attribute20                in varchar2
326   ,p_shp_information_category       in varchar2
327   ,p_shp_information1               in varchar2
328   ,p_shp_information2               in varchar2
329   ,p_shp_information3               in varchar2
330   ,p_shp_information4               in varchar2
331   ,p_shp_information5               in varchar2
332   ,p_shp_information6               in varchar2
333   ,p_shp_information7               in varchar2
334   ,p_shp_information8               in varchar2
335   ,p_shp_information9               in varchar2
336   ,p_shp_information10              in varchar2
337   ,p_shp_information11              in varchar2
338   ,p_shp_information12              in varchar2
339   ,p_shp_information13              in varchar2
340   ,p_shp_information14              in varchar2
341   ,p_shp_information15              in varchar2
342   ,p_shp_information16              in varchar2
343   ,p_shp_information17              in varchar2
344   ,p_shp_information18              in varchar2
345   ,p_shp_information19              in varchar2
346   ,p_shp_information20              in varchar2
347   )
348   Return g_rec_type is
349 --
350   l_rec   g_rec_type;
351 --
352 Begin
353   --
354   -- Convert arguments into local l_rec structure.
355   --
356   l_rec.service_history_period_id        := p_service_history_period_id;
357   l_rec.business_group_id                := p_business_group_id;
358   l_rec.assignment_id                    := p_assignment_id;
359   l_rec.start_date                       := p_start_date;
360   l_rec.end_date                         := p_end_date;
361   l_rec.employer_name                    := p_employer_name;
362   l_rec.employer_address                 := p_employer_address;
363   l_rec.employer_type                    := p_employer_type;
364   l_rec.employer_subtype                 := p_employer_subtype;
365   l_rec.period_years                     := p_period_years;
366   l_rec.period_days                      := p_period_days;
367   l_rec.description                      := p_description;
368   l_rec.continuous_service               := p_continuous_service;
369   l_rec.all_assignments                  := p_all_assignments;
370   l_rec.object_version_number            := p_object_version_number;
371   l_rec.shp_attribute_category           := p_shp_attribute_category;
372   l_rec.shp_attribute1                   := p_shp_attribute1;
373   l_rec.shp_attribute2                   := p_shp_attribute2;
374   l_rec.shp_attribute3                   := p_shp_attribute3;
375   l_rec.shp_attribute4                   := p_shp_attribute4;
376   l_rec.shp_attribute5                   := p_shp_attribute5;
377   l_rec.shp_attribute6                   := p_shp_attribute6;
378   l_rec.shp_attribute7                   := p_shp_attribute7;
379   l_rec.shp_attribute8                   := p_shp_attribute8;
380   l_rec.shp_attribute9                   := p_shp_attribute9;
381   l_rec.shp_attribute10                  := p_shp_attribute10;
382   l_rec.shp_attribute11                  := p_shp_attribute11;
383   l_rec.shp_attribute12                  := p_shp_attribute12;
384   l_rec.shp_attribute13                  := p_shp_attribute13;
385   l_rec.shp_attribute14                  := p_shp_attribute14;
386   l_rec.shp_attribute15                  := p_shp_attribute15;
387   l_rec.shp_attribute16                  := p_shp_attribute16;
388   l_rec.shp_attribute17                  := p_shp_attribute17;
389   l_rec.shp_attribute18                  := p_shp_attribute18;
390   l_rec.shp_attribute19                  := p_shp_attribute19;
391   l_rec.shp_attribute20                  := p_shp_attribute20;
392   l_rec.shp_information_category         := p_shp_information_category;
393   l_rec.shp_information1                 := p_shp_information1;
394   l_rec.shp_information2                 := p_shp_information2;
395   l_rec.shp_information3                 := p_shp_information3;
396   l_rec.shp_information4                 := p_shp_information4;
397   l_rec.shp_information5                 := p_shp_information5;
398   l_rec.shp_information6                 := p_shp_information6;
399   l_rec.shp_information7                 := p_shp_information7;
400   l_rec.shp_information8                 := p_shp_information8;
401   l_rec.shp_information9                 := p_shp_information9;
402   l_rec.shp_information10                := p_shp_information10;
406   l_rec.shp_information14                := p_shp_information14;
403   l_rec.shp_information11                := p_shp_information11;
404   l_rec.shp_information12                := p_shp_information12;
405   l_rec.shp_information13                := p_shp_information13;
407   l_rec.shp_information15                := p_shp_information15;
408   l_rec.shp_information16                := p_shp_information16;
409   l_rec.shp_information17                := p_shp_information17;
410   l_rec.shp_information18                := p_shp_information18;
411   l_rec.shp_information19                := p_shp_information19;
412   l_rec.shp_information20                := p_shp_information20;
413   --
414   -- Return the plsql record structure.
415   --
416   Return(l_rec);
417 --
418 End convert_args;
419 --
420 end pqp_shp_shd;