[Home] [Help]
PACKAGE BODY: APPS.PQP_VRI_SHD
Source
1 Package Body pqp_vri_shd as
2 /* $Header: pqvrirhi.pkb 120.0.12010000.2 2008/08/08 07:24:11 ubhat ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' pqp_vri_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 --
21 -- ----------------------------------------------------------------------------
22 -- |---------------------------< constraint_error >---------------------------|
23 -- ----------------------------------------------------------------------------
24 Procedure constraint_error
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 = 'PQP_VEH_REPOS_EXTRA_INFO_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 Else
38 fnd_message.set_name('PAY', 'HR_7877_API_INVALID_CONSTRAINT');
39 fnd_message.set_token('PROCEDURE', l_proc);
40 fnd_message.set_token('CONSTRAINT_NAME', p_constraint_name);
41 fnd_message.raise_error;
42 End If;
43 --
44 End constraint_error;
45 --
46 -- ----------------------------------------------------------------------------
47 -- |-----------------------------< api_updating >-----------------------------|
48 -- ----------------------------------------------------------------------------
49 Function api_updating
50 (p_veh_repos_extra_info_id in number
51 ,p_object_version_number in number
52 )
53 Return Boolean Is
54 --
55 --
56 -- Cursor selects the 'current' row from the HR Schema
57 --
58 Cursor C_Sel1 is
59 select
60 veh_repos_extra_info_id
61 ,vehicle_repository_id
62 ,information_type
63 ,vrei_attribute_category
64 ,vrei_attribute1
65 ,vrei_attribute2
66 ,vrei_attribute3
67 ,vrei_attribute4
68 ,vrei_attribute5
69 ,vrei_attribute6
70 ,vrei_attribute7
71 ,vrei_attribute8
72 ,vrei_attribute9
73 ,vrei_attribute10
74 ,vrei_attribute11
75 ,vrei_attribute12
76 ,vrei_attribute13
77 ,vrei_attribute14
78 ,vrei_attribute15
79 ,vrei_attribute16
80 ,vrei_attribute17
81 ,vrei_attribute18
82 ,vrei_attribute19
83 ,vrei_attribute20
84 ,vrei_information_category
85 ,vrei_information1
86 ,vrei_information2
87 ,vrei_information3
88 ,vrei_information4
89 ,vrei_information5
90 ,vrei_information6
91 ,vrei_information7
92 ,vrei_information8
93 ,vrei_information9
94 ,vrei_information10
95 ,vrei_information11
96 ,vrei_information12
97 ,vrei_information13
98 ,vrei_information14
99 ,vrei_information15
100 ,vrei_information16
101 ,vrei_information17
102 ,vrei_information18
103 ,vrei_information19
104 ,vrei_information20
105 ,vrei_information21
106 ,vrei_information22
107 ,vrei_information23
108 ,vrei_information24
109 ,vrei_information25
110 ,vrei_information26
111 ,vrei_information27
112 ,vrei_information28
113 ,vrei_information29
114 ,vrei_information30
115 ,object_version_number
116 ,request_id
117 ,program_application_id
118 ,program_id
119 ,program_update_date
120 from pqp_veh_repos_extra_info
121 where veh_repos_extra_info_id = p_veh_repos_extra_info_id;
122 --
123 l_fct_ret boolean;
124 --
125 Begin
126 --
127 If (p_veh_repos_extra_info_id is null and
128 p_object_version_number is null
129 ) Then
130 --
131 -- One of the primary key arguments is null therefore we must
132 -- set the returning function value to false
133 --
134 l_fct_ret := false;
135 Else
136 If (p_veh_repos_extra_info_id
137 = pqp_vri_shd.g_old_rec.veh_repos_extra_info_id and
138 p_object_version_number
139 = pqp_vri_shd.g_old_rec.object_version_number
140 ) Then
141 --
142 -- The g_old_rec is current therefore we must
143 -- set the returning function to true
144 --
145 l_fct_ret := true;
146 Else
147 --
148 -- Select the current row into g_old_rec
149 --
150 Open C_Sel1;
151 Fetch C_Sel1 Into pqp_vri_shd.g_old_rec;
152 If C_Sel1%notfound Then
153 Close C_Sel1;
154 --
155 -- The primary key is invalid therefore we must error
156 --
157 fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
158 fnd_message.raise_error;
159 End If;
160 Close C_Sel1;
161 If (p_object_version_number
162 <> pqp_vri_shd.g_old_rec.object_version_number) Then
163 fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
164 fnd_message.raise_error;
165 End If;
166 l_fct_ret := true;
167 End If;
168 End If;
169 Return (l_fct_ret);
170 --
171 End api_updating;
172 --
173 -- ----------------------------------------------------------------------------
174 -- |---------------------------------< lck >----------------------------------|
175 -- ----------------------------------------------------------------------------
176 Procedure lck
177 (p_veh_repos_extra_info_id in number
178 ,p_object_version_number in number
179 ) is
180 --
181 -- Cursor selects the 'current' row from the HR Schema
182 --
183 Cursor C_Sel1 is
184 select
185 veh_repos_extra_info_id
186 ,vehicle_repository_id
187 ,information_type
188 ,vrei_attribute_category
189 ,vrei_attribute1
190 ,vrei_attribute2
191 ,vrei_attribute3
192 ,vrei_attribute4
193 ,vrei_attribute5
194 ,vrei_attribute6
195 ,vrei_attribute7
196 ,vrei_attribute8
197 ,vrei_attribute9
198 ,vrei_attribute10
199 ,vrei_attribute11
200 ,vrei_attribute12
201 ,vrei_attribute13
202 ,vrei_attribute14
203 ,vrei_attribute15
204 ,vrei_attribute16
205 ,vrei_attribute17
206 ,vrei_attribute18
207 ,vrei_attribute19
208 ,vrei_attribute20
209 ,vrei_information_category
210 ,vrei_information1
211 ,vrei_information2
212 ,vrei_information3
213 ,vrei_information4
214 ,vrei_information5
215 ,vrei_information6
216 ,vrei_information7
217 ,vrei_information8
218 ,vrei_information9
219 ,vrei_information10
220 ,vrei_information11
221 ,vrei_information12
222 ,vrei_information13
223 ,vrei_information14
224 ,vrei_information15
225 ,vrei_information16
226 ,vrei_information17
227 ,vrei_information18
228 ,vrei_information19
229 ,vrei_information20
230 ,vrei_information21
231 ,vrei_information22
232 ,vrei_information23
233 ,vrei_information24
234 ,vrei_information25
235 ,vrei_information26
236 ,vrei_information27
237 ,vrei_information28
238 ,vrei_information29
239 ,vrei_information30
240 ,object_version_number
241 ,request_id
242 ,program_application_id
243 ,program_id
244 ,program_update_date
245 from pqp_veh_repos_extra_info
246 where veh_repos_extra_info_id = p_veh_repos_extra_info_id
247 for update nowait;
248 --
249 l_proc varchar2(72) := g_package||'lck';
250 --
251 Begin
252 hr_utility.set_location('Entering:'||l_proc, 5);
253 --
254 hr_api.mandatory_arg_error
255 (p_api_name => l_proc
256 ,p_argument => 'VEH_REPOS_EXTRA_INFO_ID'
257 ,p_argument_value => p_veh_repos_extra_info_id
258 );
259 hr_utility.set_location(l_proc,6);
260 hr_api.mandatory_arg_error
261 (p_api_name => l_proc
262 ,p_argument => 'OBJECT_VERSION_NUMBER'
263 ,p_argument_value => p_object_version_number
264 );
265 --
266 Open C_Sel1;
267 Fetch C_Sel1 Into pqp_vri_shd.g_old_rec;
268 If C_Sel1%notfound then
269 Close C_Sel1;
270 --
271 -- The primary key is invalid therefore we must error
272 --
273 fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
274 fnd_message.raise_error;
275 End If;
276 Close C_Sel1;
277 If (p_object_version_number
278 <> pqp_vri_shd.g_old_rec.object_version_number) Then
279 fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
280 fnd_message.raise_error;
281 End If;
282 --
283 hr_utility.set_location(' Leaving:'||l_proc, 10);
284 --
285 -- We need to trap the ORA LOCK exception
286 --
287 Exception
288 When HR_Api.Object_Locked then
289 --
290 -- The object is locked therefore we need to supply a meaningful
291 -- error message.
292 --
293 fnd_message.set_name('PAY', 'HR_7165_OBJECT_LOCKED');
294 fnd_message.set_token('TABLE_NAME', 'pqp_veh_repos_extra_info');
295 fnd_message.raise_error;
296 End lck;
297 --
298 -- ----------------------------------------------------------------------------
299 -- |-----------------------------< convert_args >-----------------------------|
300 -- ----------------------------------------------------------------------------
301 Function convert_args
302 (p_veh_repos_extra_info_id in number
303 ,p_vehicle_repository_id in number
304 ,p_information_type in varchar2
305 ,p_vrei_attribute_category in varchar2
306 ,p_vrei_attribute1 in varchar2
307 ,p_vrei_attribute2 in varchar2
308 ,p_vrei_attribute3 in varchar2
309 ,p_vrei_attribute4 in varchar2
310 ,p_vrei_attribute5 in varchar2
311 ,p_vrei_attribute6 in varchar2
312 ,p_vrei_attribute7 in varchar2
313 ,p_vrei_attribute8 in varchar2
314 ,p_vrei_attribute9 in varchar2
315 ,p_vrei_attribute10 in varchar2
316 ,p_vrei_attribute11 in varchar2
317 ,p_vrei_attribute12 in varchar2
318 ,p_vrei_attribute13 in varchar2
319 ,p_vrei_attribute14 in varchar2
320 ,p_vrei_attribute15 in varchar2
321 ,p_vrei_attribute16 in varchar2
322 ,p_vrei_attribute17 in varchar2
323 ,p_vrei_attribute18 in varchar2
324 ,p_vrei_attribute19 in varchar2
325 ,p_vrei_attribute20 in varchar2
326 ,p_vrei_information_category in varchar2
327 ,p_vrei_information1 in varchar2
328 ,p_vrei_information2 in varchar2
329 ,p_vrei_information3 in varchar2
330 ,p_vrei_information4 in varchar2
331 ,p_vrei_information5 in varchar2
332 ,p_vrei_information6 in varchar2
333 ,p_vrei_information7 in varchar2
334 ,p_vrei_information8 in varchar2
335 ,p_vrei_information9 in varchar2
336 ,p_vrei_information10 in varchar2
337 ,p_vrei_information11 in varchar2
338 ,p_vrei_information12 in varchar2
339 ,p_vrei_information13 in varchar2
340 ,p_vrei_information14 in varchar2
341 ,p_vrei_information15 in varchar2
342 ,p_vrei_information16 in varchar2
343 ,p_vrei_information17 in varchar2
344 ,p_vrei_information18 in varchar2
345 ,p_vrei_information19 in varchar2
346 ,p_vrei_information20 in varchar2
347 ,p_vrei_information21 in varchar2
348 ,p_vrei_information22 in varchar2
349 ,p_vrei_information23 in varchar2
350 ,p_vrei_information24 in varchar2
351 ,p_vrei_information25 in varchar2
352 ,p_vrei_information26 in varchar2
353 ,p_vrei_information27 in varchar2
354 ,p_vrei_information28 in varchar2
355 ,p_vrei_information29 in varchar2
356 ,p_vrei_information30 in varchar2
357 ,p_object_version_number in number
358 ,p_request_id in number
359 ,p_program_application_id in number
360 ,p_program_id in number
361 ,p_program_update_date in date
362 )
363 Return g_rec_type is
364 --
365 l_rec g_rec_type;
366 --
367 Begin
368 --
369 -- Convert arguments into local l_rec structure.
370 --
371 l_rec.veh_repos_extra_info_id := p_veh_repos_extra_info_id;
372 l_rec.vehicle_repository_id := p_vehicle_repository_id;
373 l_rec.information_type := p_information_type;
374 l_rec.vrei_attribute_category := p_vrei_attribute_category;
375 l_rec.vrei_attribute1 := p_vrei_attribute1;
376 l_rec.vrei_attribute2 := p_vrei_attribute2;
377 l_rec.vrei_attribute3 := p_vrei_attribute3;
378 l_rec.vrei_attribute4 := p_vrei_attribute4;
379 l_rec.vrei_attribute5 := p_vrei_attribute5;
380 l_rec.vrei_attribute6 := p_vrei_attribute6;
381 l_rec.vrei_attribute7 := p_vrei_attribute7;
382 l_rec.vrei_attribute8 := p_vrei_attribute8;
383 l_rec.vrei_attribute9 := p_vrei_attribute9;
384 l_rec.vrei_attribute10 := p_vrei_attribute10;
385 l_rec.vrei_attribute11 := p_vrei_attribute11;
386 l_rec.vrei_attribute12 := p_vrei_attribute12;
387 l_rec.vrei_attribute13 := p_vrei_attribute13;
388 l_rec.vrei_attribute14 := p_vrei_attribute14;
389 l_rec.vrei_attribute15 := p_vrei_attribute15;
390 l_rec.vrei_attribute16 := p_vrei_attribute16;
391 l_rec.vrei_attribute17 := p_vrei_attribute17;
392 l_rec.vrei_attribute18 := p_vrei_attribute18;
393 l_rec.vrei_attribute19 := p_vrei_attribute19;
394 l_rec.vrei_attribute20 := p_vrei_attribute20;
395 l_rec.vrei_information_category := p_vrei_information_category;
396 l_rec.vrei_information1 := p_vrei_information1;
397 l_rec.vrei_information2 := p_vrei_information2;
398 l_rec.vrei_information3 := p_vrei_information3;
399 l_rec.vrei_information4 := p_vrei_information4;
400 l_rec.vrei_information5 := p_vrei_information5;
401 l_rec.vrei_information6 := p_vrei_information6;
402 l_rec.vrei_information7 := p_vrei_information7;
403 l_rec.vrei_information8 := p_vrei_information8;
404 l_rec.vrei_information9 := p_vrei_information9;
405 l_rec.vrei_information10 := p_vrei_information10;
406 l_rec.vrei_information11 := p_vrei_information11;
407 l_rec.vrei_information12 := p_vrei_information12;
408 l_rec.vrei_information13 := p_vrei_information13;
409 l_rec.vrei_information14 := p_vrei_information14;
410 l_rec.vrei_information15 := p_vrei_information15;
411 l_rec.vrei_information16 := p_vrei_information16;
412 l_rec.vrei_information17 := p_vrei_information17;
413 l_rec.vrei_information18 := p_vrei_information18;
414 l_rec.vrei_information19 := p_vrei_information19;
415 l_rec.vrei_information20 := p_vrei_information20;
416 l_rec.vrei_information21 := p_vrei_information21;
417 l_rec.vrei_information22 := p_vrei_information22;
418 l_rec.vrei_information23 := p_vrei_information23;
419 l_rec.vrei_information24 := p_vrei_information24;
420 l_rec.vrei_information25 := p_vrei_information25;
421 l_rec.vrei_information26 := p_vrei_information26;
422 l_rec.vrei_information27 := p_vrei_information27;
423 l_rec.vrei_information28 := p_vrei_information28;
424 l_rec.vrei_information29 := p_vrei_information29;
425 l_rec.vrei_information30 := p_vrei_information30;
426 l_rec.object_version_number := p_object_version_number;
427 l_rec.request_id := p_request_id;
428 l_rec.program_application_id := p_program_application_id;
429 l_rec.program_id := p_program_id;
430 l_rec.program_update_date := p_program_update_date;
431 --
432 -- Return the plsql record structure.
433 --
434 Return(l_rec);
435 --
436 End convert_args;
437 --
438 end pqp_vri_shd;