DBA Data[Home] [Help]

PACKAGE BODY: APPS.PQH_CEI_SHD

Source


1 Package Body pqh_cei_shd as
2 /* $Header: pqceirhi.pkb 115.6 2002/12/05 19:31:08 rpasapul noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  pqh_cei_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_CORPS_EXTRA_INFO_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_corps_extra_info_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        corps_extra_info_id
50       ,corps_definition_id
51       ,information_type
52       ,information1
53       ,information2
54       ,information3
55       ,information4
56       ,information5
57       ,information6
58       ,information7
59       ,information8
60       ,information9
61       ,information10
62       ,information11
63       ,information12
64       ,information13
65       ,information14
66       ,information15
67       ,information16
68       ,information17
69       ,information18
70       ,information19
71       ,information20
72       ,information21
73       ,information22
74       ,information23
75       ,information24
76       ,information25
77       ,information26
78       ,information27
79       ,information28
80       ,information29
81       ,information30
82       ,information_category
83       ,attribute1
84       ,attribute2
85       ,attribute3
86       ,attribute4
87       ,attribute5
88       ,attribute6
89       ,attribute7
90       ,attribute8
91       ,attribute9
92       ,attribute10
93       ,attribute11
94       ,attribute12
95       ,attribute13
96       ,attribute14
97       ,attribute15
98       ,attribute16
99       ,attribute17
100       ,attribute18
101       ,attribute19
102       ,attribute20
103       ,attribute21
104       ,attribute22
105       ,attribute23
106       ,attribute24
107       ,attribute25
108       ,attribute26
109       ,attribute27
110       ,attribute28
111       ,attribute29
112       ,attribute30
113       ,attribute_category
114       ,object_version_number
115     from        pqh_corps_extra_info
116     where       corps_extra_info_id = p_corps_extra_info_id;
117   --
118   l_fct_ret     boolean;
119   --
120 Begin
121   --
122   If (p_corps_extra_info_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_corps_extra_info_id
132         = pqh_cei_shd.g_old_rec.corps_extra_info_id and
133         p_object_version_number
134         = pqh_cei_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 pqh_cei_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           <> pqh_cei_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_corps_extra_info_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        corps_extra_info_id
181       ,corps_definition_id
182       ,information_type
183       ,information1
184       ,information2
185       ,information3
186       ,information4
187       ,information5
188       ,information6
189       ,information7
190       ,information8
191       ,information9
192       ,information10
193       ,information11
194       ,information12
195       ,information13
196       ,information14
197       ,information15
198       ,information16
199       ,information17
200       ,information18
201       ,information19
202       ,information20
203       ,information21
204       ,information22
205       ,information23
206       ,information24
207       ,information25
208       ,information26
209       ,information27
210       ,information28
211       ,information29
212       ,information30
213       ,information_category
214       ,attribute1
215       ,attribute2
216       ,attribute3
217       ,attribute4
218       ,attribute5
219       ,attribute6
220       ,attribute7
221       ,attribute8
222       ,attribute9
223       ,attribute10
224       ,attribute11
225       ,attribute12
226       ,attribute13
227       ,attribute14
228       ,attribute15
229       ,attribute16
230       ,attribute17
231       ,attribute18
232       ,attribute19
233       ,attribute20
234       ,attribute21
235       ,attribute22
236       ,attribute23
237       ,attribute24
238       ,attribute25
239       ,attribute26
240       ,attribute27
241       ,attribute28
242       ,attribute29
243       ,attribute30
244       ,attribute_category
245       ,object_version_number
246     from        pqh_corps_extra_info
247     where       corps_extra_info_id = p_corps_extra_info_id
248     for update nowait;
249 --
250   l_proc        varchar2(72) := g_package||'lck';
251 --
252 Begin
253   hr_utility.set_location('Entering:'||l_proc, 5);
254   --
255   hr_api.mandatory_arg_error
256     (p_api_name           => l_proc
257     ,p_argument           => 'CORPS_EXTRA_INFO_ID'
258     ,p_argument_value     => p_corps_extra_info_id
259     );
260   hr_utility.set_location(l_proc,6);
261   hr_api.mandatory_arg_error
262     (p_api_name           => l_proc
263     ,p_argument           => 'OBJECT_VERSION_NUMBER'
264     ,p_argument_value     => p_object_version_number
265     );
266   --
267   Open  C_Sel1;
268   Fetch C_Sel1 Into pqh_cei_shd.g_old_rec;
269   If C_Sel1%notfound then
270     Close C_Sel1;
271     --
272     -- The primary key is invalid therefore we must error
273     --
274     fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
275     fnd_message.raise_error;
276   End If;
277   Close C_Sel1;
278   If (p_object_version_number
279       <> pqh_cei_shd.g_old_rec.object_version_number) Then
280         fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
281         fnd_message.raise_error;
282   End If;
283   --
284   hr_utility.set_location(' Leaving:'||l_proc, 10);
285   --
286   -- We need to trap the ORA LOCK exception
287   --
288 Exception
289   When HR_Api.Object_Locked then
290     --
291     -- The object is locked therefore we need to supply a meaningful
292     -- error message.
293     --
294     fnd_message.set_name('PAY', 'HR_7165_OBJECT_LOCKED');
295     fnd_message.set_token('TABLE_NAME', 'pqh_corps_extra_info');
296     fnd_message.raise_error;
297 End lck;
298 --
299 -- ----------------------------------------------------------------------------
300 -- |-----------------------------< convert_args >-----------------------------|
301 -- ----------------------------------------------------------------------------
302 Function convert_args
303   (p_corps_extra_info_id            in number
304   ,p_corps_definition_id            in number
305   ,p_information_type               in varchar2
306   ,p_information1                   in varchar2
307   ,p_information2                   in varchar2
308   ,p_information3                   in varchar2
309   ,p_information4                   in varchar2
310   ,p_information5                   in varchar2
311   ,p_information6                   in varchar2
312   ,p_information7                   in varchar2
313   ,p_information8                   in varchar2
314   ,p_information9                   in varchar2
315   ,p_information10                  in varchar2
316   ,p_information11                  in varchar2
317   ,p_information12                  in varchar2
318   ,p_information13                  in varchar2
319   ,p_information14                  in varchar2
320   ,p_information15                  in varchar2
321   ,p_information16                  in varchar2
322   ,p_information17                  in varchar2
323   ,p_information18                  in varchar2
324   ,p_information19                  in varchar2
325   ,p_information20                  in varchar2
326   ,p_information21                  in varchar2
327   ,p_information22                  in varchar2
328   ,p_information23                  in varchar2
329   ,p_information24                  in varchar2
330   ,p_information25                  in varchar2
331   ,p_information26                  in varchar2
332   ,p_information27                  in varchar2
333   ,p_information28                  in varchar2
334   ,p_information29                  in varchar2
335   ,p_information30                  in varchar2
336   ,p_information_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_attribute21                    in varchar2
358   ,p_attribute22                    in varchar2
359   ,p_attribute23                    in varchar2
360   ,p_attribute24                    in varchar2
361   ,p_attribute25                    in varchar2
362   ,p_attribute26                    in varchar2
363   ,p_attribute27                    in varchar2
364   ,p_attribute28                    in varchar2
365   ,p_attribute29                    in varchar2
366   ,p_attribute30                    in varchar2
367   ,p_attribute_category             in varchar2
368   ,p_object_version_number          in number
369   )
370   Return g_rec_type is
371 --
372   l_rec   g_rec_type;
373 --
374 Begin
375   --
376   -- Convert arguments into local l_rec structure.
377   --
378   l_rec.corps_extra_info_id              := p_corps_extra_info_id;
379   l_rec.corps_definition_id              := p_corps_definition_id;
380   l_rec.information_type                 := p_information_type;
381   l_rec.information1                     := p_information1;
382   l_rec.information2                     := p_information2;
383   l_rec.information3                     := p_information3;
384   l_rec.information4                     := p_information4;
385   l_rec.information5                     := p_information5;
386   l_rec.information6                     := p_information6;
387   l_rec.information7                     := p_information7;
388   l_rec.information8                     := p_information8;
389   l_rec.information9                     := p_information9;
390   l_rec.information10                    := p_information10;
391   l_rec.information11                    := p_information11;
392   l_rec.information12                    := p_information12;
393   l_rec.information13                    := p_information13;
394   l_rec.information14                    := p_information14;
395   l_rec.information15                    := p_information15;
396   l_rec.information16                    := p_information16;
397   l_rec.information17                    := p_information17;
398   l_rec.information18                    := p_information18;
399   l_rec.information19                    := p_information19;
400   l_rec.information20                    := p_information20;
401   l_rec.information21                    := p_information21;
402   l_rec.information22                    := p_information22;
403   l_rec.information23                    := p_information23;
404   l_rec.information24                    := p_information24;
405   l_rec.information25                    := p_information25;
406   l_rec.information26                    := p_information26;
407   l_rec.information27                    := p_information27;
408   l_rec.information28                    := p_information28;
409   l_rec.information29                    := p_information29;
410   l_rec.information30                    := p_information30;
411   l_rec.information_category             := p_information_category;
412   l_rec.attribute1                       := p_attribute1;
413   l_rec.attribute2                       := p_attribute2;
414   l_rec.attribute3                       := p_attribute3;
415   l_rec.attribute4                       := p_attribute4;
416   l_rec.attribute5                       := p_attribute5;
417   l_rec.attribute6                       := p_attribute6;
418   l_rec.attribute7                       := p_attribute7;
419   l_rec.attribute8                       := p_attribute8;
420   l_rec.attribute9                       := p_attribute9;
421   l_rec.attribute10                      := p_attribute10;
425   l_rec.attribute14                      := p_attribute14;
422   l_rec.attribute11                      := p_attribute11;
423   l_rec.attribute12                      := p_attribute12;
424   l_rec.attribute13                      := p_attribute13;
426   l_rec.attribute15                      := p_attribute15;
427   l_rec.attribute16                      := p_attribute16;
428   l_rec.attribute17                      := p_attribute17;
429   l_rec.attribute18                      := p_attribute18;
430   l_rec.attribute19                      := p_attribute19;
431   l_rec.attribute20                      := p_attribute20;
432   l_rec.attribute21                      := p_attribute21;
433   l_rec.attribute22                      := p_attribute22;
434   l_rec.attribute23                      := p_attribute23;
435   l_rec.attribute24                      := p_attribute24;
436   l_rec.attribute25                      := p_attribute25;
437   l_rec.attribute26                      := p_attribute26;
438   l_rec.attribute27                      := p_attribute27;
439   l_rec.attribute28                      := p_attribute28;
440   l_rec.attribute29                      := p_attribute29;
441   l_rec.attribute30                      := p_attribute30;
442   l_rec.attribute_category               := p_attribute_category;
443   l_rec.object_version_number            := p_object_version_number;
444   --
445   -- Return the plsql record structure.
446   --
447   Return(l_rec);
448 --
449 End convert_args;
450 --
451 end pqh_cei_shd;