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