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