[Home] [Help]
PACKAGE BODY: APPS.PQP_VRI_BUS
Source
1 Package Body pqp_vri_bus 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_bus.'; -- Global package name
9 --
10 -- The following two global variables are only to be
11 -- used by the return_legislation_code function.
12 --
13 g_legislation_code varchar2(150) default null;
14 g_veh_repos_extra_info_id number default null;
15 g_vehicle_repository_id number default null;
16
17 --
18 -- ---------------------------------------------------------------------------
19 -- |----------------------< set_security_group_id >--------------------------|
20 -- ---------------------------------------------------------------------------
21 --
22 Procedure set_security_group_id
23 (p_veh_repos_extra_info_id in number
24 ,p_associated_column1 in varchar2 default null
25 ) is
26 --
27 -- Declare cursor
28 --
29 -- EDIT_HERE In the following cursor statement add join(s) between
30 -- pqp_veh_repos_extra_info and PER_BUSINESS_GROUPS_PERF
31 -- so that the security_group_id for
32 -- the current business group context can be derived.
33 -- Remove this comment when the edit has been completed.
34 cursor csr_sec_grp is
35 select pbg.security_group_id,
36 pbg.legislation_code
37 from per_business_groups_perf pbg
38 , pqp_veh_repos_extra_info vri
39 -- , EDIT_HERE table_name(s) 333
40 where vri.veh_repos_extra_info_id = p_veh_repos_extra_info_id;
41 -- and pbg.business_group_id = EDIT_HERE 333.business_group_id;
42 --
43 -- Declare local variables
44 --
45 l_security_group_id number;
46 l_proc varchar2(72) := g_package||'set_security_group_id';
47 l_legislation_code varchar2(150);
48 --
49 begin
50 --
51 hr_utility.set_location('Entering:'|| l_proc, 10);
52 --
53 -- Ensure that all the mandatory parameter are not null
54 --
55 hr_api.mandatory_arg_error
56 (p_api_name => l_proc
57 ,p_argument => 'veh_repos_extra_info_id'
58 ,p_argument_value => p_veh_repos_extra_info_id
59 );
60 --
61 open csr_sec_grp;
62 fetch csr_sec_grp into l_security_group_id
63 , l_legislation_code;
64 --
65 if csr_sec_grp%notfound then
66 --
67 close csr_sec_grp;
68 --
69 -- The primary key is invalid therefore we must error
70 --
71 fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
72 hr_multi_message.add
73 (p_associated_column1
74 => nvl(p_associated_column1,'VEH_REPOS_EXTRA_INFO_ID')
75 );
76 --
77 else
78 close csr_sec_grp;
79 --
80 -- Set the security_group_id in CLIENT_INFO
81 --
82 hr_api.set_security_group_id
83 (p_security_group_id => l_security_group_id
84 );
85 --
86 -- Set the sessions legislation context in HR_SESSION_DATA
87 --
88 hr_api.set_legislation_context(l_legislation_code);
89 end if;
90 --
91 hr_utility.set_location(' Leaving:'|| l_proc, 20);
92 --
93 end set_security_group_id;
94 --
95 -- ---------------------------------------------------------------------------
96 -- |---------------------< return_veh_legislation_code >-------------------------|
97 -- ---------------------------------------------------------------------------
98 -- used to get legislation code for Vehicle repository Id
99 --
100 FUNCTION return_veh_legislation_code
101 ( p_vehicle_repository_id IN NUMBER
102 ) RETURN VARCHAR2 IS
103 --
104 -- Declare cursor
105 --
106 CURSOR csr_leg_code IS
107 SELECT pbg.legislation_code
108 FROM per_business_groups_perf pbg
109 ,pqp_vehicle_repository_f vre
110 WHERE vre.vehicle_repository_id = p_vehicle_repository_id
111 AND pbg.business_group_id=vre.business_group_id ;
112 --
113 -- Declare local variables
114 --
115 l_legislation_code varchar2(150);
116 l_proc varchar2(72) := g_package||'return_veh_legislation_code';
117 --
118 Begin
119 --
120 hr_utility.set_location('Entering:'|| l_proc, 10);
121 --
122 -- Ensure that all the mandatory parameter are not null
123 --
124 hr_api.mandatory_arg_error
125 (p_api_name => l_proc
126 ,p_argument => 'vehicle_repository_id'
127 ,p_argument_value => p_vehicle_repository_id
128 );
129 --
130 IF ( nvl(pqp_vri_bus.g_vehicle_repository_id, hr_api.g_number)
131 = p_vehicle_repository_id) THEN
132 --
133 -- The legislation code has already been found with a previous
134 -- call to this function. Just return the value in the global
135 -- variable.
136 --
137 l_legislation_code := pqp_vri_bus.g_legislation_code;
138 hr_utility.set_location(l_proc, 20);
139 ELSE
140 --
141 -- The ID is different to the last call to this function
142 -- or this is the first call to this function.
143 --
144 OPEN csr_leg_code;
145 FETCH csr_leg_code into l_legislation_code;
146 --
147 IF csr_leg_code%notfound THEN
148 --
149 -- The primary key is invalid therefore we must error
150 --
151 CLOSE csr_leg_code;
152 fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
153 fnd_message.raise_error;
154 END IF;
155 hr_utility.set_location(l_proc,30);
156 --
157 -- Set the global variables so the values are
158 -- available for the next call to this function.
159 --
160 CLOSE csr_leg_code;
161 pqp_vri_bus.g_vehicle_repository_id := g_vehicle_repository_id;
162 pqp_vri_bus.g_legislation_code := l_legislation_code;
163 END IF;
164 hr_utility.set_location(' Leaving:'|| l_proc, 40);
165 return l_legislation_code;
166 END return_veh_legislation_code;
167
168 --
169 -- ---------------------------------------------------------------------------
170 -- |---------------------< return_legislation_code >-------------------------|
171 -- ---------------------------------------------------------------------------
172 --
173 Function return_legislation_code
174 (p_vehicle_repository_id in number
175 )
176 Return Varchar2 Is
177 --
178 -- Declare cursor
179 --
180 cursor csr_leg_code is
181 select pbg.legislation_code
182 from per_business_groups_perf pbg
183 ,pqp_vehicle_repository_f vre
184 where vre.vehicle_repository_id = p_vehicle_repository_id
185 and pbg.business_group_id = vre.business_group_id ;
186 --
187 -- Declare local variables
188 --
189 l_legislation_code varchar2(150);
190 l_proc varchar2(72) := g_package||'return_legislation_code';
191 --
192 Begin
193 --
194 hr_utility.set_location('Entering:'|| l_proc, 10);
195 --
196 -- Ensure that all the mandatory parameter are not null
197 --
198 hr_api.mandatory_arg_error
199 (p_api_name => l_proc
200 ,p_argument => 'vehicle_repository_id'
201 ,p_argument_value => p_vehicle_repository_id
202 );
203 --
204 if ( nvl(pqp_vri_bus.g_vehicle_repository_id, hr_api.g_number)
205 = p_vehicle_repository_id) then
206 --
207 -- The legislation code has already been found with a previous
208 -- call to this function. Just return the value in the global
209 -- variable.
210 --
211 l_legislation_code := pqp_vri_bus.g_legislation_code;
212 hr_utility.set_location(l_proc, 20);
213 else
214 --
215 -- The ID is different to the last call to this function
216 -- or this is the first call to this function.
217 --
218 open csr_leg_code;
219 fetch csr_leg_code into l_legislation_code;
220 --
221 if csr_leg_code%notfound then
222 --
223 -- The primary key is invalid therefore we must error
224 --
225 close csr_leg_code;
226 fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
227 fnd_message.raise_error;
228 end if;
229 hr_utility.set_location(l_proc,30);
230 --
231 -- Set the global variables so the values are
232 -- available for the next call to this function.
233 --
234 close csr_leg_code;
235 pqp_vri_bus.g_vehicle_repository_id := p_vehicle_repository_id;
236 pqp_vri_bus.g_legislation_code := l_legislation_code;
237 end if;
238
239 hr_utility.set_location(' Leaving:'|| l_proc, 40);
240 return l_legislation_code;
241 end return_legislation_code;
242 --
243 -- ----------------------------------------------------------------------------
244 -- |-----------------------------< chk_ddf >----------------------------------|
245 -- ----------------------------------------------------------------------------
246 --
247 -- Description:
248 -- Validates all the Developer Descriptive Flexfield values.
249 --
250 -- Prerequisites:
251 -- All other columns have been validated. Must be called as the
252 -- last step from insert_validate and update_validate.
253 --
254 -- In Arguments:
255 -- p_rec
256 --
257 -- Post Success:
258 -- If the Developer Descriptive Flexfield structure column and data values
259 -- are all valid this procedure will end normally and processing will
260 -- continue.
261 --
262 -- Post Failure:
263 -- If the Developer Descriptive Flexfield structure column value or any of
264 -- the data values are invalid then an application error is raised as
265 -- a PL/SQL exception.
266 --
267 -- Access Status:
268 -- Internal Row Handler Use Only.
269 --
270 -- ----------------------------------------------------------------------------
271 procedure chk_ddf
272 (p_rec in pqp_vri_shd.g_rec_type
273 ) is
274 --
275 l_proc varchar2(72) := g_package || 'chk_ddf';
276 --
277 begin
278 hr_utility.set_location('Entering:'||l_proc,10);
279 --
280 if ((p_rec.veh_repos_extra_info_id is not null) and (
281 nvl(pqp_vri_shd.g_old_rec.information_type, hr_api.g_varchar2) <>
282 nvl(p_rec.information_type, hr_api.g_varchar2) or
283 nvl(pqp_vri_shd.g_old_rec.vrei_information_category, hr_api.g_varchar2) <>
284 nvl(p_rec.vrei_information_category, hr_api.g_varchar2) or
285 nvl(pqp_vri_shd.g_old_rec.vrei_information1, hr_api.g_varchar2) <>
286 nvl(p_rec.vrei_information1, hr_api.g_varchar2) or
287 nvl(pqp_vri_shd.g_old_rec.vrei_information2, hr_api.g_varchar2) <>
288 nvl(p_rec.vrei_information2, hr_api.g_varchar2) or
289 nvl(pqp_vri_shd.g_old_rec.vrei_information3, hr_api.g_varchar2) <>
290 nvl(p_rec.vrei_information3, hr_api.g_varchar2) or
291 nvl(pqp_vri_shd.g_old_rec.vrei_information4, hr_api.g_varchar2) <>
292 nvl(p_rec.vrei_information4, hr_api.g_varchar2) or
293 nvl(pqp_vri_shd.g_old_rec.vrei_information5, hr_api.g_varchar2) <>
294 nvl(p_rec.vrei_information5, hr_api.g_varchar2) or
295 nvl(pqp_vri_shd.g_old_rec.vrei_information6, hr_api.g_varchar2) <>
296 nvl(p_rec.vrei_information6, hr_api.g_varchar2) or
297 nvl(pqp_vri_shd.g_old_rec.vrei_information7, hr_api.g_varchar2) <>
298 nvl(p_rec.vrei_information7, hr_api.g_varchar2) or
299 nvl(pqp_vri_shd.g_old_rec.vrei_information8, hr_api.g_varchar2) <>
300 nvl(p_rec.vrei_information8, hr_api.g_varchar2) or
301 nvl(pqp_vri_shd.g_old_rec.vrei_information9, hr_api.g_varchar2) <>
302 nvl(p_rec.vrei_information9, hr_api.g_varchar2) or
303 nvl(pqp_vri_shd.g_old_rec.vrei_information10, hr_api.g_varchar2) <>
304 nvl(p_rec.vrei_information10, hr_api.g_varchar2) or
305 nvl(pqp_vri_shd.g_old_rec.vrei_information11, hr_api.g_varchar2) <>
306 nvl(p_rec.vrei_information11, hr_api.g_varchar2) or
307 nvl(pqp_vri_shd.g_old_rec.vrei_information12, hr_api.g_varchar2) <>
308 nvl(p_rec.vrei_information12, hr_api.g_varchar2) or
309 nvl(pqp_vri_shd.g_old_rec.vrei_information13, hr_api.g_varchar2) <>
310 nvl(p_rec.vrei_information13, hr_api.g_varchar2) or
311 nvl(pqp_vri_shd.g_old_rec.vrei_information14, hr_api.g_varchar2) <>
312 nvl(p_rec.vrei_information14, hr_api.g_varchar2) or
313 nvl(pqp_vri_shd.g_old_rec.vrei_information15, hr_api.g_varchar2) <>
314 nvl(p_rec.vrei_information15, hr_api.g_varchar2) or
315 nvl(pqp_vri_shd.g_old_rec.vrei_information16, hr_api.g_varchar2) <>
316 nvl(p_rec.vrei_information16, hr_api.g_varchar2) or
317 nvl(pqp_vri_shd.g_old_rec.vrei_information17, hr_api.g_varchar2) <>
318 nvl(p_rec.vrei_information17, hr_api.g_varchar2) or
319 nvl(pqp_vri_shd.g_old_rec.vrei_information18, hr_api.g_varchar2) <>
320 nvl(p_rec.vrei_information18, hr_api.g_varchar2) or
321 nvl(pqp_vri_shd.g_old_rec.vrei_information19, hr_api.g_varchar2) <>
322 nvl(p_rec.vrei_information19, hr_api.g_varchar2) or
323 nvl(pqp_vri_shd.g_old_rec.vrei_information20, hr_api.g_varchar2) <>
324 nvl(p_rec.vrei_information20, hr_api.g_varchar2) or
325 nvl(pqp_vri_shd.g_old_rec.vrei_information21, hr_api.g_varchar2) <>
326 nvl(p_rec.vrei_information21, hr_api.g_varchar2) or
327 nvl(pqp_vri_shd.g_old_rec.vrei_information22, hr_api.g_varchar2) <>
328 nvl(p_rec.vrei_information22, hr_api.g_varchar2) or
329 nvl(pqp_vri_shd.g_old_rec.vrei_information23, hr_api.g_varchar2) <>
330 nvl(p_rec.vrei_information23, hr_api.g_varchar2) or
331 nvl(pqp_vri_shd.g_old_rec.vrei_information24, hr_api.g_varchar2) <>
332 nvl(p_rec.vrei_information24, hr_api.g_varchar2) or
333 nvl(pqp_vri_shd.g_old_rec.vrei_information25, hr_api.g_varchar2) <>
334 nvl(p_rec.vrei_information25, hr_api.g_varchar2) or
335 nvl(pqp_vri_shd.g_old_rec.vrei_information26, hr_api.g_varchar2) <>
336 nvl(p_rec.vrei_information26, hr_api.g_varchar2) or
337 nvl(pqp_vri_shd.g_old_rec.vrei_information27, hr_api.g_varchar2) <>
338 nvl(p_rec.vrei_information27, hr_api.g_varchar2) or
339 nvl(pqp_vri_shd.g_old_rec.vrei_information28, hr_api.g_varchar2) <>
340 nvl(p_rec.vrei_information28, hr_api.g_varchar2) or
341 nvl(pqp_vri_shd.g_old_rec.vrei_information29, hr_api.g_varchar2) <>
342 nvl(p_rec.vrei_information29, hr_api.g_varchar2) or
343 nvl(pqp_vri_shd.g_old_rec.vrei_information30, hr_api.g_varchar2) <>
344 nvl(p_rec.vrei_information30, hr_api.g_varchar2) ))
345 or (p_rec.veh_repos_extra_info_id is null) then
346 --
347 -- Only execute the validation if absolutely necessary:
348 -- a) During update, the structure column value or any
349 -- of the attribute values have actually changed.
350 -- b) During insert.
351 --
352 hr_dflex_utility.ins_or_upd_descflex_attribs
353 (p_appl_short_name => 'PQP'
354 ,p_descflex_name => 'Vehicle Repos Extra Info DDF'
355 ,p_attribute_category => p_rec.vrei_information_category
356 ,p_attribute1_name => 'VREI_INFORMATION1'
357 ,p_attribute1_value => p_rec.vrei_information1
358 ,p_attribute2_name => 'VREI_INFORMATION2'
359 ,p_attribute2_value => p_rec.vrei_information2
360 ,p_attribute3_name => 'VREI_INFORMATION3'
361 ,p_attribute3_value => p_rec.vrei_information3
362 ,p_attribute4_name => 'VREI_INFORMATION4'
363 ,p_attribute4_value => p_rec.vrei_information4
364 ,p_attribute5_name => 'VREI_INFORMATION5'
365 ,p_attribute5_value => p_rec.vrei_information5
366 ,p_attribute6_name => 'VREI_INFORMATION6'
367 ,p_attribute6_value => p_rec.vrei_information6
368 ,p_attribute7_name => 'VREI_INFORMATION7'
369 ,p_attribute7_value => p_rec.vrei_information7
370 ,p_attribute8_name => 'VREI_INFORMATION8'
371 ,p_attribute8_value => p_rec.vrei_information8
372 ,p_attribute9_name => 'VREI_INFORMATION9'
373 ,p_attribute9_value => p_rec.vrei_information9
374 ,p_attribute10_name => 'VREI_INFORMATION10'
375 ,p_attribute10_value => p_rec.vrei_information10
376 ,p_attribute11_name => 'VREI_INFORMATION11'
377 ,p_attribute11_value => p_rec.vrei_information11
378 ,p_attribute12_name => 'VREI_INFORMATION12'
379 ,p_attribute12_value => p_rec.vrei_information12
380 ,p_attribute13_name => 'VREI_INFORMATION13'
381 ,p_attribute13_value => p_rec.vrei_information13
382 ,p_attribute14_name => 'VREI_INFORMATION14'
383 ,p_attribute14_value => p_rec.vrei_information14
384 ,p_attribute15_name => 'VREI_INFORMATION15'
385 ,p_attribute15_value => p_rec.vrei_information15
386 ,p_attribute16_name => 'VREI_INFORMATION16'
387 ,p_attribute16_value => p_rec.vrei_information16
388 ,p_attribute17_name => 'VREI_INFORMATION17'
389 ,p_attribute17_value => p_rec.vrei_information17
390 ,p_attribute18_name => 'VREI_INFORMATION18'
391 ,p_attribute18_value => p_rec.vrei_information18
392 ,p_attribute19_name => 'VREI_INFORMATION19'
393 ,p_attribute19_value => p_rec.vrei_information19
394 ,p_attribute20_name => 'VREI_INFORMATION20'
395 ,p_attribute20_value => p_rec.vrei_information20
396 ,p_attribute21_name => 'VREI_INFORMATION21'
397 ,p_attribute21_value => p_rec.vrei_information21
398 ,p_attribute22_name => 'VREI_INFORMATION22'
399 ,p_attribute22_value => p_rec.vrei_information22
400 ,p_attribute23_name => 'VREI_INFORMATION23'
401 ,p_attribute23_value => p_rec.vrei_information23
402 ,p_attribute24_name => 'VREI_INFORMATION24'
403 ,p_attribute24_value => p_rec.vrei_information24
404 ,p_attribute25_name => 'VREI_INFORMATION25'
405 ,p_attribute25_value => p_rec.vrei_information25
406 ,p_attribute26_name => 'VREI_INFORMATION26'
407 ,p_attribute26_value => p_rec.vrei_information26
408 ,p_attribute27_name => 'VREI_INFORMATION27'
409 ,p_attribute27_value => p_rec.vrei_information27
410 ,p_attribute28_name => 'VREI_INFORMATION28'
411 ,p_attribute28_value => p_rec.vrei_information28
412 ,p_attribute29_name => 'VREI_INFORMATION29'
413 ,p_attribute29_value => p_rec.vrei_information29
414 ,p_attribute30_name => 'VREI_INFORMATION30'
415 ,p_attribute30_value => p_rec.vrei_information30
416 );
417 end if;
418 --
419 hr_utility.set_location(' Leaving:'||l_proc,20);
420 end chk_ddf;
421 --
422 -- ----------------------------------------------------------------------------
423 -- |------------------------------< chk_df >----------------------------------|
424 -- ----------------------------------------------------------------------------
425 --
426 -- Description:
427 -- Validates all the Descriptive Flexfield values.
428 --
429 -- Prerequisites:
430 -- All other columns have been validated. Must be called as the
431 -- last step from insert_validate and update_validate.
432 --
433 -- In Arguments:
434 -- p_rec
435 --
436 -- Post Success:
437 -- If the Descriptive Flexfield structure column and data values are
438 -- all valid this procedure will end normally and processing will
439 -- continue.
440 --
441 -- Post Failure:
442 -- If the Descriptive Flexfield structure column value or any of
443 -- the data values are invalid then an application error is raised as
444 -- a PL/SQL exception.
445 --
446 -- Access Status:
447 -- Internal Row Handler Use Only.
448 --
449 -- ----------------------------------------------------------------------------
450 procedure chk_df
451 (p_rec in pqp_vri_shd.g_rec_type
452 ) is
453 --
454 l_proc varchar2(72) := g_package || 'chk_df';
455 --
456 begin
457 hr_utility.set_location('Entering:'||l_proc,10);
458 --
459 if ((p_rec.veh_repos_extra_info_id is not null) and (
460 nvl(pqp_vri_shd.g_old_rec.vrei_attribute_category, hr_api.g_varchar2) <>
461 nvl(p_rec.vrei_attribute_category, hr_api.g_varchar2) or
462 nvl(pqp_vri_shd.g_old_rec.vrei_attribute1, hr_api.g_varchar2) <>
463 nvl(p_rec.vrei_attribute1, hr_api.g_varchar2) or
464 nvl(pqp_vri_shd.g_old_rec.vrei_attribute2, hr_api.g_varchar2) <>
465 nvl(p_rec.vrei_attribute2, hr_api.g_varchar2) or
466 nvl(pqp_vri_shd.g_old_rec.vrei_attribute3, hr_api.g_varchar2) <>
467 nvl(p_rec.vrei_attribute3, hr_api.g_varchar2) or
468 nvl(pqp_vri_shd.g_old_rec.vrei_attribute4, hr_api.g_varchar2) <>
469 nvl(p_rec.vrei_attribute4, hr_api.g_varchar2) or
470 nvl(pqp_vri_shd.g_old_rec.vrei_attribute5, hr_api.g_varchar2) <>
471 nvl(p_rec.vrei_attribute5, hr_api.g_varchar2) or
472 nvl(pqp_vri_shd.g_old_rec.vrei_attribute6, hr_api.g_varchar2) <>
476 nvl(pqp_vri_shd.g_old_rec.vrei_attribute8, hr_api.g_varchar2) <>
473 nvl(p_rec.vrei_attribute6, hr_api.g_varchar2) or
474 nvl(pqp_vri_shd.g_old_rec.vrei_attribute7, hr_api.g_varchar2) <>
475 nvl(p_rec.vrei_attribute7, hr_api.g_varchar2) or
477 nvl(p_rec.vrei_attribute8, hr_api.g_varchar2) or
478 nvl(pqp_vri_shd.g_old_rec.vrei_attribute9, hr_api.g_varchar2) <>
479 nvl(p_rec.vrei_attribute9, hr_api.g_varchar2) or
480 nvl(pqp_vri_shd.g_old_rec.vrei_attribute10, hr_api.g_varchar2) <>
481 nvl(p_rec.vrei_attribute10, hr_api.g_varchar2) or
482 nvl(pqp_vri_shd.g_old_rec.vrei_attribute11, hr_api.g_varchar2) <>
483 nvl(p_rec.vrei_attribute11, hr_api.g_varchar2) or
484 nvl(pqp_vri_shd.g_old_rec.vrei_attribute12, hr_api.g_varchar2) <>
485 nvl(p_rec.vrei_attribute12, hr_api.g_varchar2) or
486 nvl(pqp_vri_shd.g_old_rec.vrei_attribute13, hr_api.g_varchar2) <>
487 nvl(p_rec.vrei_attribute13, hr_api.g_varchar2) or
488 nvl(pqp_vri_shd.g_old_rec.vrei_attribute14, hr_api.g_varchar2) <>
489 nvl(p_rec.vrei_attribute14, hr_api.g_varchar2) or
490 nvl(pqp_vri_shd.g_old_rec.vrei_attribute15, hr_api.g_varchar2) <>
491 nvl(p_rec.vrei_attribute15, hr_api.g_varchar2) or
492 nvl(pqp_vri_shd.g_old_rec.vrei_attribute16, hr_api.g_varchar2) <>
493 nvl(p_rec.vrei_attribute16, hr_api.g_varchar2) or
494 nvl(pqp_vri_shd.g_old_rec.vrei_attribute17, hr_api.g_varchar2) <>
495 nvl(p_rec.vrei_attribute17, hr_api.g_varchar2) or
496 nvl(pqp_vri_shd.g_old_rec.vrei_attribute18, hr_api.g_varchar2) <>
497 nvl(p_rec.vrei_attribute18, hr_api.g_varchar2) or
498 nvl(pqp_vri_shd.g_old_rec.vrei_attribute19, hr_api.g_varchar2) <>
499 nvl(p_rec.vrei_attribute19, hr_api.g_varchar2) or
500 nvl(pqp_vri_shd.g_old_rec.vrei_attribute20, hr_api.g_varchar2) <>
501 nvl(p_rec.vrei_attribute20, hr_api.g_varchar2) ))
502 or (p_rec.veh_repos_extra_info_id is null) then
503 --
504 -- Only execute the validation if absolutely necessary:
505 -- a) During update, the structure column value or any
506 -- of the attribute values have actually changed.
507 -- b) During insert.
508 --
509 hr_dflex_utility.ins_or_upd_descflex_attribs
510 (p_appl_short_name => 'PQP'
511 ,p_descflex_name => 'Vehicle Repos Extra Info DF'
512 ,p_attribute_category => p_rec.vrei_attribute_category
513 ,p_attribute1_name => 'VREI_ATTRIBUTE1'
514 ,p_attribute1_value => p_rec.vrei_attribute1
515 ,p_attribute2_name => 'VREI_ATTRIBUTE2'
516 ,p_attribute2_value => p_rec.vrei_attribute2
517 ,p_attribute3_name => 'VREI_ATTRIBUTE3'
518 ,p_attribute3_value => p_rec.vrei_attribute3
519 ,p_attribute4_name => 'VREI_ATTRIBUTE4'
520 ,p_attribute4_value => p_rec.vrei_attribute4
521 ,p_attribute5_name => 'VREI_ATTRIBUTE5'
522 ,p_attribute5_value => p_rec.vrei_attribute5
523 ,p_attribute6_name => 'VREI_ATTRIBUTE6'
524 ,p_attribute6_value => p_rec.vrei_attribute6
525 ,p_attribute7_name => 'VREI_ATTRIBUTE7'
526 ,p_attribute7_value => p_rec.vrei_attribute7
527 ,p_attribute8_name => 'VREI_ATTRIBUTE8'
528 ,p_attribute8_value => p_rec.vrei_attribute8
529 ,p_attribute9_name => 'VREI_ATTRIBUTE9'
530 ,p_attribute9_value => p_rec.vrei_attribute9
531 ,p_attribute10_name => 'VREI_ATTRIBUTE10'
532 ,p_attribute10_value => p_rec.vrei_attribute10
533 ,p_attribute11_name => 'VREI_ATTRIBUTE11'
534 ,p_attribute11_value => p_rec.vrei_attribute11
535 ,p_attribute12_name => 'VREI_ATTRIBUTE12'
536 ,p_attribute12_value => p_rec.vrei_attribute12
537 ,p_attribute13_name => 'VREI_ATTRIBUTE13'
538 ,p_attribute13_value => p_rec.vrei_attribute13
539 ,p_attribute14_name => 'VREI_ATTRIBUTE14'
540 ,p_attribute14_value => p_rec.vrei_attribute14
541 ,p_attribute15_name => 'VREI_ATTRIBUTE15'
542 ,p_attribute15_value => p_rec.vrei_attribute15
543 ,p_attribute16_name => 'VREI_ATTRIBUTE16'
544 ,p_attribute16_value => p_rec.vrei_attribute16
545 ,p_attribute17_name => 'VREI_ATTRIBUTE17'
546 ,p_attribute17_value => p_rec.vrei_attribute17
547 ,p_attribute18_name => 'VREI_ATTRIBUTE18'
548 ,p_attribute18_value => p_rec.vrei_attribute18
549 ,p_attribute19_name => 'VREI_ATTRIBUTE19'
550 ,p_attribute19_value => p_rec.vrei_attribute19
551 ,p_attribute20_name => 'VREI_ATTRIBUTE20'
552 ,p_attribute20_value => p_rec.vrei_attribute20
553 );
554 end if;
555 --
556 hr_utility.set_location(' Leaving:'||l_proc,20);
557 end chk_df;
558 --
559 -- ----------------------------------------------------------------------------
560 -- |-----------------------< chk_non_updateable_args >------------------------|
561 -- ----------------------------------------------------------------------------
562 -- {Start Of Comments}
563 --
564 -- Description:
565 -- This procedure is used to ensure that non updateable attributes have
566 -- not been updated. If an attribute has been updated an error is generated.
567 --
568 -- Pre Conditions:
569 -- g_old_rec has been populated with details of the values currently in
570 -- the database.
571 --
572 -- In Arguments:
573 -- p_rec has been populated with the updated values the user would like the
574 -- record set to.
575 --
576 -- Post Success:
577 -- Processing continues if all the non updateable attributes have not
578 -- changed.
579 --
580 -- Post Failure:
581 -- An application error is raised if any of the non updatable attributes
582 -- have been altered.
583 --
584 -- {End Of Comments}
585 -- ----------------------------------------------------------------------------
586 Procedure chk_non_updateable_args
587 (p_rec in pqp_vri_shd.g_rec_type
588 ) IS
589 --
590 l_proc varchar2(72) := g_package || 'chk_non_updateable_args';
591 --
592 Begin
593 --
594 -- Only proceed with the validation if a row exists for the current
595 -- record in the HR Schema.
596 --
597 IF NOT pqp_vri_shd.api_updating
598 (p_veh_repos_extra_info_id => p_rec.veh_repos_extra_info_id
599 ,p_object_version_number => p_rec.object_version_number
600 ) THEN
601 fnd_message.set_name('PER', 'HR_6153_ALL_PROCEDURE_FAIL');
602 fnd_message.set_token('PROCEDURE ', l_proc);
603 fnd_message.set_token('STEP ', '5');
604 fnd_message.raise_error;
605 END IF;
606 --
607 -- EDIT_HERE: Add checks to ensure non-updateable args have
608 -- not been updated.
609 --
610 End chk_non_updateable_args;
611 --
612 -- ----------------------------------------------------------------------------
613 -- |---------------------------< insert_validate >----------------------------|
614 -- ----------------------------------------------------------------------------
615 Procedure insert_validate
616 (p_rec in pqp_vri_shd.g_rec_type
617 ) is
618 --
619 l_proc varchar2(72) := g_package||'insert_validate';
620 --
621 Begin
622 hr_utility.set_location('Entering:'||l_proc, 5);
623 --
624 -- Call all supporting business operations
625 --
626 --
627 -- EDIT_HERE: As this table does not have a mandatory business_group_id
628 -- column, ensure client_info is populated by calling a suitable
629 -- ???_???_bus.set_security_group_id procedure, or add one of the following
630 -- comments:
631 -- "-- No business group context. HR_STANDARD_LOOKUPS used for validation."
632 -- "-- CLIENT_INFO not set. No lookup validation or joins to HR_LOOKUPS."
633 --
634 -- Validate Dependent Attributes
635 --
636 --
637 pqp_vri_bus.chk_ddf(p_rec);
638 --
639 pqp_vri_bus.chk_df(p_rec);
640 --
641 hr_utility.set_location(' Leaving:'||l_proc, 10);
642 End insert_validate;
643 --
644 -- ----------------------------------------------------------------------------
645 -- |---------------------------< update_validate >----------------------------|
646 -- ----------------------------------------------------------------------------
647 Procedure update_validate
648 (p_rec in pqp_vri_shd.g_rec_type
649 ) is
650 --
651 l_proc varchar2(72) := g_package||'update_validate';
652 --
653 Begin
654 hr_utility.set_location('Entering:'||l_proc, 5);
655 --
656 -- Call all supporting business operations
657 --
658 --
659 -- EDIT_HERE: As this table does not have a mandatory business_group_id
660 -- column, ensure client_info is populated by calling a suitable
661 -- ???_???_bus.set_security_group_id procedure, or add one of the following
662 -- comments:
663 -- "-- No business group context. HR_STANDARD_LOOKUPS used for validation."
664 -- "-- CLIENT_INFO not set. No lookup validation or joins to HR_LOOKUPS."
665 --
666 -- Validate Dependent Attributes
667 --
668 chk_non_updateable_args
669 (p_rec => p_rec
670 );
671 --
672 --
673 pqp_vri_bus.chk_ddf(p_rec);
674 --
675 pqp_vri_bus.chk_df(p_rec);
676 --
677 hr_utility.set_location(' Leaving:'||l_proc, 10);
678 End update_validate;
679 --
680 -- ----------------------------------------------------------------------------
681 -- |---------------------------< delete_validate >----------------------------|
682 -- ----------------------------------------------------------------------------
683 Procedure delete_validate
684 (p_rec in pqp_vri_shd.g_rec_type
685 ) is
686 --
687 l_proc varchar2(72) := g_package||'delete_validate';
688 --
689 Begin
690 hr_utility.set_location('Entering:'||l_proc, 5);
691 --
692 -- Call all supporting business operations
693 --
694 hr_utility.set_location(' Leaving:'||l_proc, 10);
695 End delete_validate;
696 --
697 end pqp_vri_bus;