DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_PSP_SHD

Source


1 Package Body per_psp_shd as
2 /* $Header: pepsprhi.pkb 115.5 2003/11/17 13:06:07 tpapired noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  per_psp_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 = 'PER_SPINAL_POINTS_FK1') 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   ElsIf (p_constraint_name = 'PER_SPINAL_POINTS_FK2') Then
38     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
39     fnd_message.set_token('PROCEDURE', l_proc);
40     fnd_message.set_token('STEP','10');
41     fnd_message.raise_error;
42   ElsIf (p_constraint_name = 'PER_SPINAL_POINTS_PK') Then
43     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
44     fnd_message.set_token('PROCEDURE', l_proc);
45     fnd_message.set_token('STEP','15');
46     fnd_message.raise_error;
47   Else
48     fnd_message.set_name('PAY', 'HR_7877_API_INVALID_CONSTRAINT');
49     fnd_message.set_token('PROCEDURE', l_proc);
50     fnd_message.set_token('CONSTRAINT_NAME', p_constraint_name);
51     fnd_message.raise_error;
52   End If;
53   --
54 End constraint_error;
55 --
56 -- ----------------------------------------------------------------------------
57 -- |-----------------------------< api_updating >-----------------------------|
58 -- ----------------------------------------------------------------------------
59 Function api_updating
60   (p_spinal_point_id                      in     number
61   ,p_object_version_number                in     number
62   )
63   Return Boolean Is
64   --
65   --
66   -- Cursor selects the 'current' row from the HR Schema
67   --
68   Cursor C_Sel1 is
69     select
70        spinal_point_id
71       ,business_group_id
72       ,parent_spine_id
73       ,sequence
74       ,spinal_point
75       ,request_id
76       ,program_application_id
77       ,program_id
78       ,program_update_date
79       ,object_version_number
80       ,information_category
81       ,information1
82       ,information2
83       ,information3
84       ,information4
85       ,information5
86       ,information6
87       ,information7
88       ,information8
89       ,information9
90       ,information10
91       ,information11
92       ,information12
93       ,information13
94       ,information14
95       ,information15
96       ,information16
97       ,information17
98       ,information18
99       ,information19
100       ,information20
101       ,information21
102       ,information22
103       ,information23
104       ,information24
105       ,information25
106       ,information26
107       ,information27
108       ,information28
109       ,information29
110       ,information30
111     from        per_spinal_points
112     where       spinal_point_id = p_spinal_point_id;
113   --
114   l_fct_ret     boolean;
115   --
116 Begin
117   --
118   If (p_spinal_point_id is null and
119       p_object_version_number is null
120      ) Then
121     --
122     -- One of the primary key arguments is null therefore we must
123     -- set the returning function value to false
124     --
125     l_fct_ret := false;
126   Else
127     If (p_spinal_point_id
128         = per_psp_shd.g_old_rec.spinal_point_id and
129         p_object_version_number
130         = per_psp_shd.g_old_rec.object_version_number
131        ) Then
132       --
133       -- The g_old_rec is current therefore we must
134       -- set the returning function to true
135       --
136       l_fct_ret := true;
137     Else
138       --
139       -- Select the current row into g_old_rec
140       --
141       Open C_Sel1;
142       Fetch C_Sel1 Into per_psp_shd.g_old_rec;
143       If C_Sel1%notfound Then
144         Close C_Sel1;
145         --
146         -- The primary key is invalid therefore we must error
147         --
148         fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
149         fnd_message.raise_error;
150       End If;
151       Close C_Sel1;
152       If (p_object_version_number
153           <> per_psp_shd.g_old_rec.object_version_number) Then
154         fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
155         fnd_message.raise_error;
156       End If;
157       l_fct_ret := true;
158     End If;
159   End If;
160   Return (l_fct_ret);
161 --
162 End api_updating;
163 --
164 -- ----------------------------------------------------------------------------
165 -- |---------------------------------< lck >----------------------------------|
166 -- ----------------------------------------------------------------------------
167 Procedure lck
168   (p_spinal_point_id                      in     number
169   ,p_object_version_number                in     number
170   ) is
171 --
172 -- Cursor selects the 'current' row from the HR Schema
173 --
174   Cursor C_Sel1 is
175     select
176        spinal_point_id
177       ,business_group_id
178       ,parent_spine_id
179       ,sequence
180       ,spinal_point
181       ,request_id
182       ,program_application_id
183       ,program_id
184       ,program_update_date
185       ,object_version_number
186       ,information_category
187       ,information1
188       ,information2
189       ,information3
190       ,information4
191       ,information5
192       ,information6
193       ,information7
194       ,information8
195       ,information9
196       ,information10
197       ,information11
198       ,information12
199       ,information13
200       ,information14
201       ,information15
202       ,information16
203       ,information17
204       ,information18
205       ,information19
206       ,information20
207       ,information21
208       ,information22
209       ,information23
210       ,information24
211       ,information25
212       ,information26
213       ,information27
214       ,information28
215       ,information29
216       ,information30
217     from        per_spinal_points
218     where       spinal_point_id = p_spinal_point_id
219     for update nowait;
220 --
221   l_proc        varchar2(72) := g_package||'lck';
222 --
223 Begin
224   hr_utility.set_location('Entering:'||l_proc, 5);
225   --
226   hr_api.mandatory_arg_error
227     (p_api_name           => l_proc
228     ,p_argument           => 'SPINAL_POINT_ID'
229     ,p_argument_value     => p_spinal_point_id
230     );
231   hr_utility.set_location(l_proc,6);
232   hr_api.mandatory_arg_error
233     (p_api_name           => l_proc
234     ,p_argument           => 'OBJECT_VERSION_NUMBER'
235     ,p_argument_value     => p_object_version_number
236     );
237   --
238   Open  C_Sel1;
239   Fetch C_Sel1 Into per_psp_shd.g_old_rec;
240   If C_Sel1%notfound then
241     Close C_Sel1;
242     --
243     -- The primary key is invalid therefore we must error
244     --
245     fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
246     fnd_message.raise_error;
247   End If;
248   Close C_Sel1;
249   If (p_object_version_number
250       <> per_psp_shd.g_old_rec.object_version_number) Then
251         fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
252         fnd_message.raise_error;
253   End If;
254   --
255   hr_utility.set_location(' Leaving:'||l_proc, 10);
256   --
257   -- We need to trap the ORA LOCK exception
258   --
259 Exception
260   When HR_Api.Object_Locked then
261     --
262     -- The object is locked therefore we need to supply a meaningful
263     -- error message.
264     --
265     fnd_message.set_name('PAY', 'HR_7165_OBJECT_LOCKED');
266     fnd_message.set_token('TABLE_NAME', 'per_spinal_points');
267     fnd_message.raise_error;
268 End lck;
269 --
270 -- ----------------------------------------------------------------------------
271 -- |-----------------------------< convert_args >-----------------------------|
272 -- ----------------------------------------------------------------------------
273 Function convert_args
274   (p_spinal_point_id                in number
275   ,p_business_group_id              in number
276   ,p_parent_spine_id                in number
277   ,p_sequence                       in number
278   ,p_spinal_point                   in varchar2
279   ,p_request_id                     in number
280   ,p_program_application_id         in number
281   ,p_program_id                     in number
282   ,p_program_update_date            in date
283   ,p_object_version_number          in number
284   ,p_information_category           in varchar2
285   ,p_information1                   in varchar2
286   ,p_information2                   in varchar2
287   ,p_information3                   in varchar2
288   ,p_information4                   in varchar2
289   ,p_information5                   in varchar2
290   ,p_information6                   in varchar2
291   ,p_information7                   in varchar2
292   ,p_information8                   in varchar2
293   ,p_information9                   in varchar2
294   ,p_information10                  in varchar2
295   ,p_information11                  in varchar2
296   ,p_information12                  in varchar2
297   ,p_information13                  in varchar2
298   ,p_information14                  in varchar2
299   ,p_information15                  in varchar2
300   ,p_information16                  in varchar2
301   ,p_information17                  in varchar2
302   ,p_information18                  in varchar2
303   ,p_information19                  in varchar2
304   ,p_information20                  in varchar2
305   ,p_information21                  in varchar2
306   ,p_information22                  in varchar2
307   ,p_information23                  in varchar2
308   ,p_information24                  in varchar2
309   ,p_information25                  in varchar2
310   ,p_information26                  in varchar2
311   ,p_information27                  in varchar2
312   ,p_information28                  in varchar2
313   ,p_information29                  in varchar2
314   ,p_information30                  in varchar2
315   )
316   Return g_rec_type is
317 --
318   l_rec   g_rec_type;
319 --
320 Begin
321   --
322   -- Convert arguments into local l_rec structure.
323   --
324   l_rec.spinal_point_id                  := p_spinal_point_id;
325   l_rec.business_group_id                := p_business_group_id;
326   l_rec.parent_spine_id                  := p_parent_spine_id;
327   l_rec.sequence                         := p_sequence;
328   l_rec.spinal_point                     := p_spinal_point;
329   l_rec.request_id                       := p_request_id;
330   l_rec.program_application_id           := p_program_application_id;
331   l_rec.program_id                       := p_program_id;
332   l_rec.program_update_date              := p_program_update_date;
333   l_rec.object_version_number            := p_object_version_number;
334   l_rec.information_category               := p_information_category;
335   l_rec.information1                       := p_information1;
336   l_rec.information2                       := p_information2;
337   l_rec.information3                       := p_information3;
338   l_rec.information4                       := p_information4;
339   l_rec.information5                       := p_information5;
340   l_rec.information6                       := p_information6;
341   l_rec.information7                       := p_information7;
342   l_rec.information8                       := p_information8;
343   l_rec.information9                       := p_information9;
344   l_rec.information10                      := p_information10;
345   l_rec.information11                      := p_information11;
346   l_rec.information12                      := p_information12;
347   l_rec.information13                      := p_information13;
348   l_rec.information14                      := p_information14;
349   l_rec.information15                      := p_information15;
350   l_rec.information16                      := p_information16;
351   l_rec.information17                      := p_information17;
352   l_rec.information18                      := p_information18;
353   l_rec.information19                      := p_information19;
354   l_rec.information20                      := p_information20;
355   l_rec.information21                      := p_information21;
356   l_rec.information22                      := p_information22;
357   l_rec.information23                      := p_information23;
358   l_rec.information24                      := p_information24;
359   l_rec.information25                      := p_information25;
360   l_rec.information26                      := p_information26;
361   l_rec.information27                      := p_information27;
362   l_rec.information28                      := p_information28;
363   l_rec.information29                      := p_information29;
364   l_rec.information30                      := p_information30;
365   --
366   -- Return the plsql record structure.
367   --
368   Return(l_rec);
369 --
370 End convert_args;
371 --
372 end per_psp_shd;