DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_CPO_SHD

Source


4 -- ----------------------------------------------------------------------------
1 Package Body per_cpo_shd as
2 /* $Header: pecporhi.pkb 115.0 2004/03/17 10:23 ynegoro noship $ */
3 --
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  per_cpo_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 --
24 Procedure constraint_error
21 -- ----------------------------------------------------------------------------
22 -- |---------------------------< constraint_error >---------------------------|
23 -- ----------------------------------------------------------------------------
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_COMPETENCE_OUTCOMES_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   ElsIf (p_constraint_name = 'PER_COMPETENCE_OUTCOMES_FK1') 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   Else
43     fnd_message.set_name('PAY', 'HR_7877_API_INVALID_CONSTRAINT');
44     fnd_message.set_token('PROCEDURE', l_proc);
45     fnd_message.set_token('CONSTRAINT_NAME', p_constraint_name);
46     fnd_message.raise_error;
47   End If;
48   --
49 End constraint_error;
50 --
51 -- ----------------------------------------------------------------------------
52 -- |-----------------------------< api_updating >-----------------------------|
53 -- ----------------------------------------------------------------------------
54 Function api_updating
55   (p_outcome_id                           in     number
56   ,p_object_version_number                in     number
57   )
58   Return Boolean Is
59   --
60   --
61   -- Cursor selects the 'current' row from the HR Schema
62   --
63   Cursor C_Sel1 is
64     select
65        outcome_id
66       ,competence_id
67       ,outcome_number
68       ,name
69       ,date_from
70       ,date_to
71       ,assessment_criteria
72       ,attribute_category
73       ,attribute1
74       ,attribute2
75       ,attribute3
76       ,attribute4
77       ,attribute5
78       ,attribute6
79       ,attribute7
80       ,attribute8
81       ,attribute9
82       ,attribute10
83       ,attribute11
84       ,attribute12
85       ,attribute13
86       ,attribute14
87       ,attribute15
88       ,attribute16
89       ,attribute17
90       ,attribute18
91       ,attribute19
92       ,attribute20
93       ,information_category
94       ,information1
95       ,information2
96       ,information3
97       ,information4
98       ,information5
99       ,information6
100       ,information7
101       ,information8
102       ,information9
103       ,information10
104       ,information11
105       ,information12
106       ,information13
107       ,information14
108       ,information15
109       ,information16
110       ,information17
111       ,information18
112       ,information19
113       ,information20
114       ,object_version_number
115     from        per_competence_outcomes
116     where       outcome_id = p_outcome_id;
117   --
118   l_fct_ret     boolean;
119   --
120 Begin
121   --
122   If (p_outcome_id is null and
123       p_object_version_number is null
124      ) Then
125     --
126     -- One of the primary key arguments is null therefore we must
127     -- set the returning function value to false
128     --
129     l_fct_ret := false;
130   Else
131     If (p_outcome_id
132         = per_cpo_shd.g_old_rec.outcome_id and
133         p_object_version_number
134         = per_cpo_shd.g_old_rec.object_version_number
135        ) Then
136       --
137       -- The g_old_rec is current therefore we must
138       -- set the returning function to true
139       --
140       l_fct_ret := true;
141     Else
142       --
143       -- Select the current row into g_old_rec
144       --
145       Open C_Sel1;
146       Fetch C_Sel1 Into per_cpo_shd.g_old_rec;
147       If C_Sel1%notfound Then
148         Close C_Sel1;
149         --
150         -- The primary key is invalid therefore we must error
151         --
152         fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
153         fnd_message.raise_error;
154       End If;
155       Close C_Sel1;
156       If (p_object_version_number
157           <> per_cpo_shd.g_old_rec.object_version_number) Then
158         fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
159         fnd_message.raise_error;
160       End If;
161       l_fct_ret := true;
162     End If;
163   End If;
164   Return (l_fct_ret);
165 --
166 End api_updating;
167 --
168 -- ----------------------------------------------------------------------------
169 -- |---------------------------------< lck >----------------------------------|
170 -- ----------------------------------------------------------------------------
171 Procedure lck
172   (p_outcome_id                           in     number
173   ,p_object_version_number                in     number
174   ) is
175 --
176 -- Cursor selects the 'current' row from the HR Schema
177 --
178   Cursor C_Sel1 is
179     select
180        outcome_id
181       ,competence_id
182       ,outcome_number
183       ,name
184       ,date_from
185       ,date_to
186       ,assessment_criteria
187       ,attribute_category
191       ,attribute4
188       ,attribute1
189       ,attribute2
190       ,attribute3
192       ,attribute5
193       ,attribute6
194       ,attribute7
195       ,attribute8
196       ,attribute9
197       ,attribute10
198       ,attribute11
199       ,attribute12
203       ,attribute16
200       ,attribute13
201       ,attribute14
202       ,attribute15
204       ,attribute17
205       ,attribute18
206       ,attribute19
207       ,attribute20
208       ,information_category
209       ,information1
210       ,information2
211       ,information3
212       ,information4
213       ,information5
214       ,information6
215       ,information7
216       ,information8
217       ,information9
218       ,information10
219       ,information11
220       ,information12
221       ,information13
222       ,information14
223       ,information15
224       ,information16
225       ,information17
226       ,information18
227       ,information19
228       ,information20
229       ,object_version_number
230     from        per_competence_outcomes
231     where       outcome_id = p_outcome_id
232     for update nowait;
233 --
234   l_proc        varchar2(72) := g_package||'lck';
235 --
236 Begin
237   hr_utility.set_location('Entering:'||l_proc, 5);
238   --
239   hr_api.mandatory_arg_error
240     (p_api_name           => l_proc
241     ,p_argument           => 'OUTCOME_ID'
242     ,p_argument_value     => p_outcome_id
243     );
244   hr_utility.set_location(l_proc,6);
245   hr_api.mandatory_arg_error
246     (p_api_name           => l_proc
247     ,p_argument           => 'OBJECT_VERSION_NUMBER'
248     ,p_argument_value     => p_object_version_number
249     );
250   --
251   Open  C_Sel1;
252   Fetch C_Sel1 Into per_cpo_shd.g_old_rec;
253   If C_Sel1%notfound then
254     Close C_Sel1;
255     --
256     -- The primary key is invalid therefore we must error
257     --
258     fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
259     fnd_message.raise_error;
260   End If;
261   Close C_Sel1;
262   If (p_object_version_number
263       <> per_cpo_shd.g_old_rec.object_version_number) Then
264         fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
265         fnd_message.raise_error;
266   End If;
267   --
268   hr_utility.set_location(' Leaving:'||l_proc, 10);
269   --
270   -- We need to trap the ORA LOCK exception
271   --
272 Exception
273   When HR_Api.Object_Locked then
274     --
275     -- The object is locked therefore we need to supply a meaningful
276     -- error message.
277     --
278     fnd_message.set_name('PAY', 'HR_7165_OBJECT_LOCKED');
279     fnd_message.set_token('TABLE_NAME', 'per_competence_outcomes');
280     fnd_message.raise_error;
281 End lck;
282 --
283 -- ----------------------------------------------------------------------------
284 -- |-----------------------------< convert_args >-----------------------------|
285 -- ----------------------------------------------------------------------------
286 Function convert_args
287   (p_outcome_id                     in number
288   ,p_competence_id                  in number
289   ,p_outcome_number                 in number
290   ,p_name                           in varchar2
291   ,p_date_from                      in date
292   ,p_date_to                        in date
293   ,p_assessment_criteria            in varchar2
294   ,p_attribute_category             in varchar2
295   ,p_attribute1                     in varchar2
296   ,p_attribute2                     in varchar2
297   ,p_attribute3                     in varchar2
298   ,p_attribute4                     in varchar2
302   ,p_attribute8                     in varchar2
299   ,p_attribute5                     in varchar2
300   ,p_attribute6                     in varchar2
301   ,p_attribute7                     in varchar2
303   ,p_attribute9                     in varchar2
304   ,p_attribute10                    in varchar2
305   ,p_attribute11                    in varchar2
306   ,p_attribute12                    in varchar2
307   ,p_attribute13                    in varchar2
308   ,p_attribute14                    in varchar2
309   ,p_attribute15                    in varchar2
310   ,p_attribute16                    in varchar2
311   ,p_attribute17                    in varchar2
312   ,p_attribute18                    in varchar2
313   ,p_attribute19                    in varchar2
314   ,p_attribute20                    in varchar2
315   ,p_information_category           in varchar2
316   ,p_information1                   in varchar2
317   ,p_information2                   in varchar2
318   ,p_information3                   in varchar2
319   ,p_information4                   in varchar2
320   ,p_information5                   in varchar2
321   ,p_information6                   in varchar2
322   ,p_information7                   in varchar2
323   ,p_information8                   in varchar2
324   ,p_information9                   in varchar2
325   ,p_information10                  in varchar2
326   ,p_information11                  in varchar2
327   ,p_information12                  in varchar2
328   ,p_information13                  in varchar2
329   ,p_information14                  in varchar2
330   ,p_information15                  in varchar2
331   ,p_information16                  in varchar2
332   ,p_information17                  in varchar2
333   ,p_information18                  in varchar2
334   ,p_information19                  in varchar2
335   ,p_information20                  in varchar2
336   ,p_object_version_number          in number
337   )
338   Return g_rec_type is
339 --
340   l_rec   g_rec_type;
341 --
342 Begin
343   --
344   -- Convert arguments into local l_rec structure.
345   --
346   l_rec.outcome_id                       := p_outcome_id;
347   l_rec.competence_id                    := p_competence_id;
348   l_rec.outcome_number                   := p_outcome_number;
349   l_rec.name                             := p_name;
350   l_rec.date_from                        := p_date_from;
351   l_rec.date_to                          := p_date_to;
352   l_rec.assessment_criteria              := p_assessment_criteria;
353   l_rec.attribute_category               := p_attribute_category;
354   l_rec.attribute1                       := p_attribute1;
355   l_rec.attribute2                       := p_attribute2;
356   l_rec.attribute3                       := p_attribute3;
357   l_rec.attribute4                       := p_attribute4;
358   l_rec.attribute5                       := p_attribute5;
359   l_rec.attribute6                       := p_attribute6;
360   l_rec.attribute7                       := p_attribute7;
361   l_rec.attribute8                       := p_attribute8;
362   l_rec.attribute9                       := p_attribute9;
363   l_rec.attribute10                      := p_attribute10;
364   l_rec.attribute11                      := p_attribute11;
368   l_rec.attribute15                      := p_attribute15;
365   l_rec.attribute12                      := p_attribute12;
366   l_rec.attribute13                      := p_attribute13;
367   l_rec.attribute14                      := p_attribute14;
369   l_rec.attribute16                      := p_attribute16;
370   l_rec.attribute17                      := p_attribute17;
371   l_rec.attribute18                      := p_attribute18;
372   l_rec.attribute19                      := p_attribute19;
373   l_rec.attribute20                      := p_attribute20;
374   l_rec.information_category             := p_information_category;
375   l_rec.information1                     := p_information1;
376   l_rec.information2                     := p_information2;
380   l_rec.information6                     := p_information6;
377   l_rec.information3                     := p_information3;
378   l_rec.information4                     := p_information4;
379   l_rec.information5                     := p_information5;
381   l_rec.information7                     := p_information7;
382   l_rec.information8                     := p_information8;
383   l_rec.information9                     := p_information9;
384   l_rec.information10                    := p_information10;
385   l_rec.information11                    := p_information11;
386   l_rec.information12                    := p_information12;
387   l_rec.information13                    := p_information13;
388   l_rec.information14                    := p_information14;
389   l_rec.information15                    := p_information15;
390   l_rec.information16                    := p_information16;
391   l_rec.information17                    := p_information17;
392   l_rec.information18                    := p_information18;
393   l_rec.information19                    := p_information19;
394   l_rec.information20                    := p_information20;
395   l_rec.object_version_number            := p_object_version_number;
396   --
397   -- Return the plsql record structure.
398   --
399   Return(l_rec);
400 --
401 End convert_args;
402 --
403 end per_cpo_shd;