DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_CNI_SHD

Source


1 Package Body per_cni_shd as
2 /* $Header: pecnirhi.pkb 120.0 2005/05/31 06:49 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  per_cni_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 = 'SYS_C00255171') 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_config_information_id                in     number
40   )
41   Return Boolean Is
42   --
43   --
44   -- Cursor selects the 'current' row from the HR Schema
45   --
46   Cursor C_Sel1 is
47     select
48        configuration_code
49       ,config_information_category
50       ,config_information1
51       ,config_information2
52       ,config_information3
53       ,config_information4
54       ,config_information5
55       ,config_information6
56       ,config_information7
57       ,config_information8
58       ,config_information9
59       ,config_information10
60       ,config_information11
61       ,config_information12
62       ,config_information13
63       ,config_information14
64       ,config_information15
65       ,config_information16
66       ,config_information17
67       ,config_information18
68       ,config_information19
69       ,config_information20
70       ,config_information21
71       ,config_information22
72       ,config_information23
73       ,config_information24
74       ,config_information25
75       ,config_information26
76       ,config_information27
77       ,config_information28
78       ,config_information29
79       ,config_information30
80       ,config_information_id
81       ,config_sequence
82       ,object_version_number
83     from        per_ri_config_information
84     where       config_information_id = p_config_information_id;
85   --
86   l_fct_ret     boolean;
87   --
88 Begin
89   --
90   If (p_config_information_id is null
91      ) Then
92     --
93     -- One of the primary key arguments is null therefore we must
94     -- set the returning function value to false
95     --
96     l_fct_ret := false;
97   Else
98     If (p_config_information_id
99         = per_cni_shd.g_old_rec.config_information_id
100        ) Then
101       --
102       -- The g_old_rec is current therefore we must
103       -- set the returning function to true
104       --
105       l_fct_ret := true;
106     Else
107       --
108       -- Select the current row into g_old_rec
109       --
110       Open C_Sel1;
111       Fetch C_Sel1 Into per_cni_shd.g_old_rec;
112       If C_Sel1%notfound Then
113         Close C_Sel1;
114         --
115         -- The primary key is invalid therefore we must error
116         --
117         fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
118         fnd_message.raise_error;
119       End If;
120       Close C_Sel1;
121       --
122       l_fct_ret := true;
123     End If;
124   End If;
125   Return (l_fct_ret);
126 --
127 End api_updating;
128 --
129 -- ----------------------------------------------------------------------------
130 -- |---------------------------------< lck >----------------------------------|
131 -- ----------------------------------------------------------------------------
132 Procedure lck
133   (p_config_information_id In Number
134   ,p_object_version_number In Number
135   ) is
136 --
137 -- Cursor selects the 'current' row from the HR Schema
138 --
139   Cursor C_Sel1 is
140     select
141        configuration_code
142       ,config_information_category
143       ,config_information1
144       ,config_information2
145       ,config_information3
146       ,config_information4
147       ,config_information5
148       ,config_information6
149       ,config_information7
150       ,config_information8
151       ,config_information9
152       ,config_information10
153       ,config_information11
154       ,config_information12
155       ,config_information13
156       ,config_information14
157       ,config_information15
158       ,config_information16
159       ,config_information17
160       ,config_information18
161       ,config_information19
162       ,config_information20
163       ,config_information21
164       ,config_information22
165       ,config_information23
166       ,config_information24
167       ,config_information25
168       ,config_information26
169       ,config_information27
170       ,config_information28
171       ,config_information29
172       ,config_information30
173       ,config_information_id
174       ,config_sequence
175       ,object_version_number
176     from        per_ri_config_information
177     where       config_information_id = p_config_information_id
178     for update nowait;
179 --
180   l_proc        varchar2(72) := g_package||'lck';
181 --
182 Begin
183   hr_utility.set_location('Entering:'||l_proc, 5);
184   --
185   hr_api.mandatory_arg_error
186     (p_api_name           => l_proc
187     ,p_argument           => 'CONFIG_INFORMATION_ID'
188     ,p_argument_value     => p_config_information_id
189     );
190 
191   hr_utility.set_location(l_proc,6);
192   hr_api.mandatory_arg_error
193     (p_api_name           => l_proc
194     ,p_argument           => 'OBJECT_VERSION_NUMBER'
195     ,p_argument_value     => p_object_version_number
196     );
197 
198   --
199   Open  C_Sel1;
200   Fetch C_Sel1 Into per_cni_shd.g_old_rec;
201   If C_Sel1%notfound then
202     Close C_Sel1;
203     --
204     -- The primary key is invalid therefore we must error
205     --
206     fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
207     fnd_message.raise_error;
208   End If;
209   Close C_Sel1;
210   --
211 
212   If (p_object_version_number <> per_wbi_shd.g_old_rec.object_version_number) Then
213           fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
214           fnd_message.raise_error;
215   End If;
216 
217   --
218   hr_utility.set_location(' Leaving:'||l_proc, 10);
219   --
220   -- We need to trap the ORA LOCK exception
221   --
222 Exception
223   When HR_Api.Object_Locked then
224     --
225     -- The object is locked therefore we need to supply a meaningful
226     -- error message.
227     --
228     fnd_message.set_name('PAY', 'HR_7165_OBJECT_LOCKED');
229     fnd_message.set_token('TABLE_NAME', 'per_ri_config_information');
230     fnd_message.raise_error;
231 End lck;
232 --
233 -- ----------------------------------------------------------------------------
234 -- |-----------------------------< convert_args >-----------------------------|
235 -- ----------------------------------------------------------------------------
236 Function convert_args
237   (p_configuration_code             in varchar2
238   ,p_config_information_category    in varchar2
239   ,p_config_information1            in varchar2
240   ,p_config_information2            in varchar2
241   ,p_config_information3            in varchar2
242   ,p_config_information4            in varchar2
243   ,p_config_information5            in varchar2
244   ,p_config_information6            in varchar2
245   ,p_config_information7            in varchar2
246   ,p_config_information8            in varchar2
247   ,p_config_information9            in varchar2
248   ,p_config_information10           in varchar2
249   ,p_config_information11           in varchar2
250   ,p_config_information12           in varchar2
251   ,p_config_information13           in varchar2
252   ,p_config_information14           in varchar2
253   ,p_config_information15           in varchar2
254   ,p_config_information16           in varchar2
255   ,p_config_information17           in varchar2
256   ,p_config_information18           in varchar2
257   ,p_config_information19           in varchar2
258   ,p_config_information20           in varchar2
259   ,p_config_information21           in varchar2
260   ,p_config_information22           in varchar2
261   ,p_config_information23           in varchar2
262   ,p_config_information24           in varchar2
263   ,p_config_information25           in varchar2
264   ,p_config_information26           in varchar2
265   ,p_config_information27           in varchar2
266   ,p_config_information28           in varchar2
267   ,p_config_information29           in varchar2
268   ,p_config_information30           in varchar2
269   ,p_config_information_id          in number
270   ,p_config_sequence                in number
271   ,p_object_version_number          In Number
272   )
273   Return g_rec_type is
274 --
275   l_rec   g_rec_type;
276 --
277 Begin
278   --
279   -- Convert arguments into local l_rec structure.
280   --
281   l_rec.configuration_code               := p_configuration_code;
282   l_rec.config_information_category      := p_config_information_category;
283   l_rec.config_information1              := p_config_information1;
284   l_rec.config_information2              := p_config_information2;
285   l_rec.config_information3              := p_config_information3;
286   l_rec.config_information4              := p_config_information4;
287   l_rec.config_information5              := p_config_information5;
288   l_rec.config_information6              := p_config_information6;
289   l_rec.config_information7              := p_config_information7;
290   l_rec.config_information8              := p_config_information8;
291   l_rec.config_information9              := p_config_information9;
292   l_rec.config_information10             := p_config_information10;
293   l_rec.config_information11             := p_config_information11;
294   l_rec.config_information12             := p_config_information12;
295   l_rec.config_information13             := p_config_information13;
296   l_rec.config_information14             := p_config_information14;
297   l_rec.config_information15             := p_config_information15;
298   l_rec.config_information16             := p_config_information16;
299   l_rec.config_information17             := p_config_information17;
300   l_rec.config_information18             := p_config_information18;
301   l_rec.config_information19             := p_config_information19;
302   l_rec.config_information20             := p_config_information20;
303   l_rec.config_information21             := p_config_information21;
304   l_rec.config_information22             := p_config_information22;
305   l_rec.config_information23             := p_config_information23;
306   l_rec.config_information24             := p_config_information24;
307   l_rec.config_information25             := p_config_information25;
308   l_rec.config_information26             := p_config_information26;
309   l_rec.config_information27             := p_config_information27;
310   l_rec.config_information28             := p_config_information28;
311   l_rec.config_information29             := p_config_information29;
312   l_rec.config_information30             := p_config_information30;
313   l_rec.config_information_id            := p_config_information_id;
314   l_rec.config_sequence                  := p_config_sequence;
315   l_rec.object_version_number            := p_object_version_number;
316   --
317   -- Return the plsql record structure.
318   --
319   Return(l_rec);
320 --
321 End convert_args;
322 --
323 end per_cni_shd;