DBA Data[Home] [Help]

PACKAGE BODY: APPS.PQP_VRE_UPD

Source


1 PACKAGE BODY pqp_vre_upd AS
2 /* $Header: pqvrerhi.pkb 120.1 2005/06/30 12:04:54 rpinjala noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  VARCHAR2(33) := '  pqp_vre_upd.';  -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |----------------------------< dt_update_dml >-----------------------------|
12 -- ----------------------------------------------------------------------------
13 -- {Start Of Comments}
14 --
15 -- Description:
16 --   This procedure controls the execution of dml from the datetrack mode
17 --   of CORRECTION only. It is important to note that the object version
18 --   number is only increment by 1 because the datetrack correction is
19 --   soley for one datetracked row.
20 --   This procedure controls the actual dml update logic. The functions of
21 --   this procedure are as follows:
22 --   1) Get the next object_version_number.
23 --   2) To set and unset the g_api_dml status as required (as we are about to
24 --      perform dml).
25 --   3) To update the specified row in the schema using the primary key in
26 --      the predicates.
27 --   4) To trap any constraint violations that may have occurred.
28 --   5) To raise any other errors.
29 --
30 -- Prerequisites:
31 --   This is an internal private procedure which must be called from the
32 --   update_dml procedure.
33 --
34 -- In Parameters:
35 --   A Pl/Sql record structure.
36 --
37 -- Post Success:
38 --   The specified row will be updated in the schema.
39 --
40 -- Post Failure:
41 --   On the update dml failure it is important to note that we always reset the
42 --   g_api_dml status to false.
43 --   If a check or unique integrity constraint violation is raised the
44 --   constraint_error procedure will be called.
45 --   If any other error is reported, the error will be raised after the
46 --   g_api_dml status is reset.
47 --
48 -- Developer Implementation Notes:
49 --   The update 'set' arguments list should be modified if any of your
50 --   attributes are not updateable.
51 --
52 -- Access Status:
53 --   Internal Row Handler Use Only.
54 --
55 -- {End Of Comments}
56 -- ----------------------------------------------------------------------------
57 PROCEDURE dt_update_dml
58   (p_rec                   IN OUT NOCOPY pqp_vre_shd.g_rec_type
59   ,p_effective_date        IN DATE
60   ,p_datetrack_mode        IN VARCHAR2
61   ,p_validation_start_date IN DATE
62   ,p_validation_end_date   IN DATE
63   ) IS
64 --
65   l_proc        varchar2(72) := g_package||'dt_update_dml';
66 --
67 BEGIN
68   hr_utility.set_location('Entering:'||l_proc, 5);
69   --
70   IF (p_datetrack_mode = hr_api.g_correction) THEN
71     hr_utility.set_location(l_proc, 10);
72     --
73     -- Because we are updating a row we must get the next object
74     -- version number.
75     --
76     p_rec.object_version_number :=
77       dt_api.get_object_version_number
78         (p_base_table_name => 'pqp_vehicle_repository_f'
79         ,p_base_key_column => 'vehicle_repository_id'
80         ,p_base_key_value  => p_rec.vehicle_repository_id
81         );
82     --
83     --
84     --
85     -- Update the pqp_vehicle_repository_f Row
86     --
87     UPDATE  pqp_vehicle_repository_f
88     SET
89      vehicle_repository_id                = p_rec.vehicle_repository_id
90     ,registration_number                  = p_rec.registration_number
91     ,vehicle_type                         = p_rec.vehicle_type
92     ,vehicle_id_number                    = p_rec.vehicle_id_number
93     ,business_group_id                    = p_rec.business_group_id
94     ,make                                 = p_rec.make
95     ,model                                = p_rec.model
96     ,initial_registration                 = p_rec.initial_registration
97     ,last_registration_renew_date         = p_rec.last_registration_renew_date
98     ,engine_capacity_in_cc                = p_rec.engine_capacity_in_cc
99     ,fuel_type                            = p_rec.fuel_type
100     ,currency_code                        = p_rec.currency_code
101     ,list_price                           = p_rec.list_price
102     ,accessory_value_at_startdate         = p_rec.accessory_value_at_startdate
103     ,accessory_value_added_later          = p_rec.accessory_value_added_later
104     ,market_value_classic_car             = p_rec.market_value_classic_car
105     ,fiscal_ratings                       = p_rec.fiscal_ratings
106     ,fiscal_ratings_uom                   = p_rec.fiscal_ratings_uom
107     ,vehicle_provider                     = p_rec.vehicle_provider
108     ,vehicle_ownership                    = p_rec.vehicle_ownership
109     ,shared_vehicle                       = p_rec.shared_vehicle
110     ,vehicle_status                       = p_rec.vehicle_status
111     ,vehicle_inactivity_reason            = p_rec.vehicle_inactivity_reason
112     ,asset_number                         = p_rec.asset_number
113     ,lease_contract_number                = p_rec.lease_contract_number
114     ,lease_contract_expiry_date           = p_rec.lease_contract_expiry_date
115     ,taxation_method                      = p_rec.taxation_method
116     ,fleet_info                           = p_rec.fleet_info
117     ,fleet_transfer_date                  = p_rec.fleet_transfer_date
118     ,object_version_number                = p_rec.object_version_number
119     ,color                                = p_rec.color
120     ,seating_capacity                     = p_rec.seating_capacity
121     ,weight                               = p_rec.weight
122     ,weight_uom                            = p_rec.weight_uom
123     ,model_year                           = p_rec.model_year
124     ,insurance_number                     = p_rec.insurance_number
125     ,insurance_expiry_date                = p_rec.insurance_expiry_date
126     ,comments                             = p_rec.comments
127     ,vre_attribute_category               = p_rec.vre_attribute_category
128     ,vre_attribute1                       = p_rec.vre_attribute1
129     ,vre_attribute2                       = p_rec.vre_attribute2
130     ,vre_attribute3                       = p_rec.vre_attribute3
131     ,vre_attribute4                       = p_rec.vre_attribute4
132     ,vre_attribute5                       = p_rec.vre_attribute5
133     ,vre_attribute6                       = p_rec.vre_attribute6
134     ,vre_attribute7                       = p_rec.vre_attribute7
135     ,vre_attribute8                       = p_rec.vre_attribute8
136     ,vre_attribute9                       = p_rec.vre_attribute9
137     ,vre_attribute10                      = p_rec.vre_attribute10
138     ,vre_attribute11                      = p_rec.vre_attribute11
139     ,vre_attribute12                      = p_rec.vre_attribute12
140     ,vre_attribute13                      = p_rec.vre_attribute13
141     ,vre_attribute14                      = p_rec.vre_attribute14
142     ,vre_attribute15                      = p_rec.vre_attribute15
143     ,vre_attribute16                      = p_rec.vre_attribute16
144     ,vre_attribute17                      = p_rec.vre_attribute17
145     ,vre_attribute18                      = p_rec.vre_attribute18
146     ,vre_attribute19                      = p_rec.vre_attribute19
147     ,vre_attribute20                      = p_rec.vre_attribute20
148     ,vre_information_category             = p_rec.vre_information_category
149     ,vre_information1                     = p_rec.vre_information1
150     ,vre_information2                     = p_rec.vre_information2
151     ,vre_information3                     = p_rec.vre_information3
152     ,vre_information4                     = p_rec.vre_information4
153     ,vre_information5                     = p_rec.vre_information5
154     ,vre_information6                     = p_rec.vre_information6
155     ,vre_information7                     = p_rec.vre_information7
156     ,vre_information8                     = p_rec.vre_information8
157     ,vre_information9                     = p_rec.vre_information9
158     ,vre_information10                    = p_rec.vre_information10
159     ,vre_information11                    = p_rec.vre_information11
160     ,vre_information12                    = p_rec.vre_information12
161     ,vre_information13                    = p_rec.vre_information13
162     ,vre_information14                    = p_rec.vre_information14
163     ,vre_information15                    = p_rec.vre_information15
164     ,vre_information16                    = p_rec.vre_information16
165     ,vre_information17                    = p_rec.vre_information17
166     ,vre_information18                    = p_rec.vre_information18
167     ,vre_information19                    = p_rec.vre_information19
168     ,vre_information20                    = p_rec.vre_information20
169     WHERE   vehicle_repository_id = p_rec.vehicle_repository_id
170     AND     effective_start_date  = p_validation_start_date
171     AND     effective_end_date    = p_validation_end_date;
172     --
173     --
174     --
175     -- Set the effective start and end dates
176     --
177     p_rec.effective_start_date := p_validation_start_date;
178     p_rec.effective_end_date   := p_validation_end_date;
179   END IF;
180 --
181 hr_utility.set_location(' Leaving:'||l_proc, 15);
182 EXCEPTION
183   WHEN hr_api.check_integrity_violated THEN
184     -- A check constraint has been violated
185     --
186     pqp_vre_shd.constraint_error
187       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
188   WHEN hr_api.unique_integrity_violated THEN
189     -- Unique integrity has been violated
190     --
191     pqp_vre_shd.constraint_error
192       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
193   WHEN OTHERS THEN
194     --
195     RAISE;
196 END dt_update_dml;
197 --
198 -- ----------------------------------------------------------------------------
199 -- |------------------------------< update_dml >------------------------------|
200 -- ----------------------------------------------------------------------------
201 -- {Start Of Comments}
202 --
203 -- Description:
204 --   This procedure calls the dt_update_dml control logic which handles
205 --   the actual datetrack dml.
206 --
207 -- Prerequisites:
208 --   This is an internal private procedure which must be called from the upd
209 --   procedure.
210 --
211 -- In Parameters:
212 --   A Pl/Sql record structre.
213 --
214 -- Post Success:
215 --   Processing contines.
216 --
217 -- Post Failure:
218 --   No specific error handling is required within this procedure.
219 --
220 -- Developer Implementation Notes:
221 --   The update 'set' arguments list should be modified if any of your
222 --   attributes are not updateable.
223 --
224 -- Access Status:
225 --   Internal Row Handler Use Only.
226 --
227 -- {End Of Comments}
228 -- ----------------------------------------------------------------------------
229 PROCEDURE update_dml
230   (p_rec                      IN OUT NOCOPY pqp_vre_shd.g_rec_type
231   ,p_effective_date           IN DATE
232   ,p_datetrack_mode           IN VARCHAR2
233   ,p_validation_start_date    IN DATE
234   ,p_validation_end_date      IN DATE
235   ) IS
236 --
237   l_proc        varchar2(72) := g_package||'update_dml';
238 --
239 BEGIN
240   hr_utility.set_location('Entering:'||l_proc, 5);
241   --
242   pqp_vre_upd.dt_update_dml
243     (p_rec                   => p_rec
244     ,p_effective_date        => p_effective_date
245     ,p_datetrack_mode        => p_datetrack_mode
246     ,p_validation_start_date => p_validation_start_date
247     ,p_validation_end_date   => p_validation_end_date
248     );
249   --
250   hr_utility.set_location(' Leaving:'||l_proc, 10);
251 END update_dml;
252 --
253 -- ----------------------------------------------------------------------------
254 -- |----------------------------< dt_pre_update >-----------------------------|
255 -- ----------------------------------------------------------------------------
256 -- {Start Of Comments}
257 --
258 -- Description:
259 --   The dt_pre_update procedure controls the execution
260 --   of dml for the datetrack modes of: UPDATE, UPDATE_OVERRIDE
261 --   and UPDATE_CHANGE_INSERT only. The execution required is as
262 --   follows:
263 --
264 --   1) Providing the datetrack update mode is not 'CORRECTION'
265 --      then set the effective end date of the current row (this
266 --      will be the validation_start_date - 1).
267 --   2) If the datetrack mode is 'UPDATE_OVERRIDE' then call the
268 --      corresponding delete_dml process to delete any future rows
269 --      where the effective_start_date is greater than or equal to
270 --      the validation_start_date.
271 --   3) Call the insert_dml process to insert the new updated row
272 --      details.
273 --
274 -- Prerequisites:
275 --   This is an internal procedure which is called from the
276 --   pre_update procedure.
277 --
278 -- In Parameters:
279 --
280 -- Post Success:
281 --   Processing continues.
282 --
283 -- Post Failure:
284 --   If an error has occurred, an error message and exception will be raised
285 --   but not handled.
286 --
287 -- Developer Implementation Notes:
288 --   This is an internal procedure which is required by Datetrack. Don't
289 --   remove or modify.
290 --
291 -- Access Status:
292 --   Internal Row Handler Use Only.
293 --
294 -- {End Of Comments}
295 -- ----------------------------------------------------------------------------
296 PROCEDURE dt_pre_update
297   (p_rec                     IN OUT  NOCOPY   pqp_vre_shd.g_rec_type
298   ,p_effective_date          IN DATE
299   ,p_datetrack_mode          IN VARCHAR2
300   ,p_validation_start_date   IN DATE
301   ,p_validation_end_date     IN DATE
302   ) IS
303 --
304   l_proc                 VARCHAR2(72) := g_package||'dt_pre_update';
305   l_dummy_version_number NUMBER;
306 --
307 BEGIN
308   hr_utility.set_location('Entering:'||l_proc, 5);
309   IF (p_datetrack_mode <> hr_api.g_correction) THEN
310     --
311     -- Update the current effective end date
312     --
313     pqp_vre_shd.upd_effective_end_date
314       (p_effective_date         => p_effective_date
315       ,p_base_key_value         => p_rec.vehicle_repository_id
316       ,p_new_effective_end_date => (p_validation_start_date - 1)
317       ,p_validation_start_date  => p_validation_start_date
318       ,p_validation_end_date    => p_validation_end_date
319       ,p_object_version_number  => l_dummy_version_number
320       );
321     --
322     IF (p_datetrack_mode = hr_api.g_update_override) THEN
323       --
324       -- As the datetrack mode is 'UPDATE_OVERRIDE' then we must
325       -- delete any future rows
326       --
327       pqp_vre_del.delete_dml
328         (p_rec                   => p_rec
329         ,p_effective_date        => p_effective_date
330         ,p_datetrack_mode        => p_datetrack_mode
331         ,p_validation_start_date => p_validation_start_date
332         ,p_validation_end_date   => p_validation_end_date
333         );
334     END IF;
335     --
336     -- We must now insert the updated row
337     --
338     pqp_vre_ins.insert_dml
339       (p_rec                    => p_rec
340       ,p_effective_date         => p_effective_date
341       ,p_datetrack_mode         => p_datetrack_mode
342       ,p_validation_start_date  => p_validation_start_date
343       ,p_validation_end_date    => p_validation_end_date
344       );
345   END IF;
346   hr_utility.set_location(' Leaving:'||l_proc, 20);
347 END dt_pre_update;
348 --
349 -- ----------------------------------------------------------------------------
350 -- |------------------------------< pre_update >------------------------------|
351 -- ----------------------------------------------------------------------------
352 -- {Start Of Comments}
353 --
354 -- Description:
355 --   This private procedure contains any processing which is required before
356 --   the update dml.
357 --
358 -- Prerequisites:
359 --   This is an internal procedure which is called from the upd procedure.
360 --
361 -- In Parameters:
362 --   A Pl/Sql record structure.
363 --
364 -- Post Success:
365 --   Processing continues.
366 --
367 -- Post Failure:
368 --   If an error has occurred, an error message and exception will be raised
369 --   but not handled.
370 -- Developer Implementation Notes:
371 --   Any pre-processing required before the update dml is issued should be
372 --   coded within this procedure. It is important to note that any 3rd party
373 --   maintenance should be reviewed before placing in this procedure. The call
374 --   to the dt_update_dml procedure should NOT be removed.
375 --
376 -- Access Status:
377 --   Internal Row Handler Use Only.
378 --
379 -- {End Of Comments}
380 -- ----------------------------------------------------------------------------
381 PROCEDURE pre_update
382   (p_rec                   IN OUT NOCOPY pqp_vre_shd.g_rec_type
383   ,p_effective_date        IN DATE
384   ,p_datetrack_mode        IN VARCHAR2
385   ,p_validation_start_date IN DATE
386   ,p_validation_end_date   IN DATE
387   ) IS
388 --
389   l_proc        varchar2(72) := g_package||'pre_update';
390 --
391 BEGIN
392   hr_utility.set_location('Entering:'||l_proc, 5);
393   --
394   --
395   --
396   dt_pre_update
397     (p_rec                   => p_rec
398     ,p_effective_date        => p_effective_date
399     ,p_datetrack_mode        => p_datetrack_mode
400     ,p_validation_start_date => p_validation_start_date
401     ,p_validation_end_date   => p_validation_end_date
402     );
403   --
404   hr_utility.set_location(' Leaving:'||l_proc, 10);
405 END pre_update;
406 --
407 -- ----------------------------------------------------------------------------
408 -- |----------------------------< post_update >-------------------------------|
409 -- ----------------------------------------------------------------------------
410 -- {Start Of Comments}
411 --
412 -- Description:
413 --   This private procedure contains any processing which is required after
414 --   the update dml.
415 --
416 -- Prerequisites:
417 --   This is an internal procedure which is called from the upd procedure.
418 --
419 -- In Parameters:
420 --   A Pl/Sql record structure.
421 --
422 -- Post Success:
423 --   Processing continues.
424 --
425 -- Post Failure:
426 --   If an error has occurred, an error message and exception will be raised
427 --   but not handled.
428 --
429 -- Developer Implementation Notes:
430 --   Any post-processing required after the update dml is issued should be
431 --   coded within this procedure. It is important to note that any 3rd party
432 --   maintenance should be reviewed before placing in this procedure.
433 --
434 -- Access Status:
435 --   Internal Row Handler Use Only.
436 --
437 -- {End Of Comments}
438 -- ----------------------------------------------------------------------------
439 PROCEDURE post_update
440   (p_rec                   IN pqp_vre_shd.g_rec_type
441   ,p_effective_date        IN DATE
442   ,p_datetrack_mode        IN VARCHAR2
443   ,p_validation_start_date IN DATE
444   ,p_validation_end_date   IN DATE
445   ) IS
446 --
447   l_proc        varchar2(72) := g_package||'post_update';
448 --
449 BEGIN
450   hr_utility.set_location('Entering:'||l_proc, 5);
451   BEGIN
452     --
453     pqp_vre_rku.after_update
454       (p_effective_date
455       => p_effective_date
456       ,p_datetrack_mode
457       => p_datetrack_mode
458       ,p_validation_start_date
459       => p_validation_start_date
460       ,p_validation_end_date
461       => p_validation_end_date
462       ,p_vehicle_repository_id
463       => p_rec.vehicle_repository_id
464       ,p_effective_start_date
465       => p_rec.effective_start_date
466       ,p_effective_end_date
467       => p_rec.effective_end_date
468       ,p_registration_number
469       => p_rec.registration_number
470       ,p_vehicle_type
471       => p_rec.vehicle_type
472       ,p_vehicle_id_number
473       => p_rec.vehicle_id_number
474       ,p_business_group_id
475       => p_rec.business_group_id
476       ,p_make
477       => p_rec.make
478       ,p_model
479       => p_rec.model
480       ,p_initial_registration
481       => p_rec.initial_registration
482       ,p_last_registration_renew_date
483       => p_rec.last_registration_renew_date
484       ,p_engine_capacity_in_cc
485       => p_rec.engine_capacity_in_cc
486       ,p_fuel_type
487       => p_rec.fuel_type
488       ,p_currency_code
489       => p_rec.currency_code
490       ,p_list_price
491       => p_rec.list_price
492       ,p_accessory_value_at_startdate
493       => p_rec.accessory_value_at_startdate
494       ,p_accessory_value_added_later
495       => p_rec.accessory_value_added_later
496       ,p_market_value_classic_car
497       => p_rec.market_value_classic_car
498       ,p_fiscal_ratings
499       => p_rec.fiscal_ratings
500       ,p_fiscal_ratings_uom
501       => p_rec.fiscal_ratings_uom
502       ,p_vehicle_provider
503       => p_rec.vehicle_provider
504       ,p_vehicle_ownership
505       => p_rec.vehicle_ownership
506       ,p_shared_vehicle
507       => p_rec.shared_vehicle
508       ,p_vehicle_status
509       => p_rec.vehicle_status
510       ,p_vehicle_inactivity_reason
511       => p_rec.vehicle_inactivity_reason
512       ,p_asset_number
513       => p_rec.asset_number
514       ,p_lease_contract_number
515       => p_rec.lease_contract_number
516       ,p_lease_contract_expiry_date
517       =>p_rec.lease_contract_expiry_date
518       ,p_taxation_method
519       => p_rec.taxation_method
520       ,p_fleet_info
521       => p_rec.fleet_info
522       ,p_fleet_transfer_date
523       => p_rec.fleet_transfer_date
524       ,p_object_version_number
525       => p_rec.object_version_number
526       ,p_color
527       => p_rec.color
528       ,p_seating_capacity
529       => p_rec.seating_capacity
530       ,p_weight
531       => p_rec.weight
532       ,p_weight_uom
533       => p_rec.weight_uom
534       ,p_model_year
535       => p_rec.model_year
536       ,p_insurance_number
537       => p_rec.insurance_number
538       ,p_insurance_expiry_date
539       => p_rec.insurance_expiry_date
540       ,p_comments
541       => p_rec.comments
542       ,p_vre_attribute_category
543       => p_rec.vre_attribute_category
544       ,p_vre_attribute1
545       => p_rec.vre_attribute1
546       ,p_vre_attribute2
547       => p_rec.vre_attribute2
548       ,p_vre_attribute3
549       => p_rec.vre_attribute3
550       ,p_vre_attribute4
551       => p_rec.vre_attribute4
552       ,p_vre_attribute5
553       => p_rec.vre_attribute5
554       ,p_vre_attribute6
555       => p_rec.vre_attribute6
556       ,p_vre_attribute7
557       => p_rec.vre_attribute7
558       ,p_vre_attribute8
559       => p_rec.vre_attribute8
560       ,p_vre_attribute9
561       => p_rec.vre_attribute9
562       ,p_vre_attribute10
563       => p_rec.vre_attribute10
564       ,p_vre_attribute11
565       => p_rec.vre_attribute11
566       ,p_vre_attribute12
567       => p_rec.vre_attribute12
568       ,p_vre_attribute13
569       => p_rec.vre_attribute13
570       ,p_vre_attribute14
571       => p_rec.vre_attribute14
572       ,p_vre_attribute15
573       => p_rec.vre_attribute15
574       ,p_vre_attribute16
575       => p_rec.vre_attribute16
576       ,p_vre_attribute17
577       => p_rec.vre_attribute17
578       ,p_vre_attribute18
579       => p_rec.vre_attribute18
580       ,p_vre_attribute19
581       => p_rec.vre_attribute19
582       ,p_vre_attribute20
583       => p_rec.vre_attribute20
584       ,p_vre_information_category
585       => p_rec.vre_information_category
586       ,p_vre_information1
587       => p_rec.vre_information1
588       ,p_vre_information2
589       => p_rec.vre_information2
590       ,p_vre_information3
591       => p_rec.vre_information3
592       ,p_vre_information4
593       => p_rec.vre_information4
594       ,p_vre_information5
595       => p_rec.vre_information5
596       ,p_vre_information6
597       => p_rec.vre_information6
598       ,p_vre_information7
599       => p_rec.vre_information7
600       ,p_vre_information8
601       => p_rec.vre_information8
602       ,p_vre_information9
603       => p_rec.vre_information9
604       ,p_vre_information10
605       => p_rec.vre_information10
606       ,p_vre_information11
607       => p_rec.vre_information11
608       ,p_vre_information12
609       => p_rec.vre_information12
610       ,p_vre_information13
611       => p_rec.vre_information13
612       ,p_vre_information14
613       => p_rec.vre_information14
614       ,p_vre_information15
615       => p_rec.vre_information15
616       ,p_vre_information16
617       => p_rec.vre_information16
618       ,p_vre_information17
619       => p_rec.vre_information17
620       ,p_vre_information18
621       => p_rec.vre_information18
622       ,p_vre_information19
623       => p_rec.vre_information19
624       ,p_vre_information20
625       => p_rec.vre_information20
626       ,p_effective_start_date_o
627       => pqp_vre_shd.g_old_rec.effective_start_date
628       ,p_effective_end_date_o
629       => pqp_vre_shd.g_old_rec.effective_end_date
630       ,p_registration_number_o
631       => pqp_vre_shd.g_old_rec.registration_number
632       ,p_vehicle_type_o
633       => pqp_vre_shd.g_old_rec.vehicle_type
634       ,p_vehicle_id_number_o
635       => pqp_vre_shd.g_old_rec.vehicle_id_number
636       ,p_business_group_id_o
637       => pqp_vre_shd.g_old_rec.business_group_id
638       ,p_make_o
639       => pqp_vre_shd.g_old_rec.make
640       ,p_model_o
641       => pqp_vre_shd.g_old_rec.model
642       ,p_initial_registration_o
643       => pqp_vre_shd.g_old_rec.initial_registration
644       ,p_last_registration_renew_da_o
645       => pqp_vre_shd.g_old_rec.last_registration_renew_date
646       ,p_engine_capacity_in_cc_o
647       => pqp_vre_shd.g_old_rec.engine_capacity_in_cc
648       ,p_fuel_type_o
649       => pqp_vre_shd.g_old_rec.fuel_type
650       ,p_currency_code_o
651       => pqp_vre_shd.g_old_rec.currency_code
652       ,p_list_price_o
653       => pqp_vre_shd.g_old_rec.list_price
654       ,p_accessory_value_at_startda_o
655       => pqp_vre_shd.g_old_rec.accessory_value_at_startdate
656       ,p_accessory_value_added_late_o
657       => pqp_vre_shd.g_old_rec.accessory_value_added_later
658       ,p_market_value_classic_car_o
659       => pqp_vre_shd.g_old_rec.market_value_classic_car
660       ,p_fiscal_ratings_o
661       => pqp_vre_shd.g_old_rec.fiscal_ratings
662       ,p_fiscal_ratings_uom_o
663       => pqp_vre_shd.g_old_rec.fiscal_ratings_uom
664       ,p_vehicle_provider_o
665       => pqp_vre_shd.g_old_rec.vehicle_provider
666       ,p_vehicle_ownership_o
667       => pqp_vre_shd.g_old_rec.vehicle_ownership
668       ,p_shared_vehicle_o
669       => pqp_vre_shd.g_old_rec.shared_vehicle
670       ,p_vehicle_status_o
671       => pqp_vre_shd.g_old_rec.vehicle_status
672       ,p_vehicle_inactivity_reason_o
673       => pqp_vre_shd.g_old_rec.vehicle_inactivity_reason
674       ,p_asset_number_o
675       => pqp_vre_shd.g_old_rec.asset_number
676       ,p_lease_contract_number_o
677       => pqp_vre_shd.g_old_rec.lease_contract_number
678       ,p_lease_contract_expiry_date_o
679       => pqp_vre_shd.g_old_rec.lease_contract_expiry_date
680       ,p_taxation_method_o
681       => pqp_vre_shd.g_old_rec.taxation_method
682       ,p_fleet_info_o
683       => pqp_vre_shd.g_old_rec.fleet_info
684       ,p_fleet_transfer_date_o
685       => pqp_vre_shd.g_old_rec.fleet_transfer_date
686       ,p_object_version_number_o
687       => pqp_vre_shd.g_old_rec.object_version_number
688       ,p_color_o
689       => pqp_vre_shd.g_old_rec.color
690       ,p_seating_capacity_o
691       => pqp_vre_shd.g_old_rec.seating_capacity
692       ,p_weight_o
693       => pqp_vre_shd.g_old_rec.weight
694       ,p_weight_uom_o
695       => pqp_vre_shd.g_old_rec.weight_uom
696       ,p_model_year_o
697       => pqp_vre_shd.g_old_rec.model_year
698       ,p_insurance_number_o
699       => pqp_vre_shd.g_old_rec.insurance_number
700       ,p_insurance_expiry_date_o
701       => pqp_vre_shd.g_old_rec.insurance_expiry_date
702       ,p_comments_o
703       => pqp_vre_shd.g_old_rec.comments
704       ,p_vre_attribute_category_o
705       => pqp_vre_shd.g_old_rec.vre_attribute_category
706       ,p_vre_attribute1_o
707       => pqp_vre_shd.g_old_rec.vre_attribute1
708       ,p_vre_attribute2_o
709       => pqp_vre_shd.g_old_rec.vre_attribute2
710       ,p_vre_attribute3_o
711       => pqp_vre_shd.g_old_rec.vre_attribute3
712       ,p_vre_attribute4_o
713       => pqp_vre_shd.g_old_rec.vre_attribute4
714       ,p_vre_attribute5_o
715       => pqp_vre_shd.g_old_rec.vre_attribute5
716       ,p_vre_attribute6_o
717       => pqp_vre_shd.g_old_rec.vre_attribute6
718       ,p_vre_attribute7_o
719       => pqp_vre_shd.g_old_rec.vre_attribute7
720       ,p_vre_attribute8_o
721       => pqp_vre_shd.g_old_rec.vre_attribute8
722       ,p_vre_attribute9_o
723       => pqp_vre_shd.g_old_rec.vre_attribute9
724       ,p_vre_attribute10_o
725       => pqp_vre_shd.g_old_rec.vre_attribute10
726       ,p_vre_attribute11_o
727       => pqp_vre_shd.g_old_rec.vre_attribute11
728       ,p_vre_attribute12_o
729       => pqp_vre_shd.g_old_rec.vre_attribute12
730       ,p_vre_attribute13_o
731       => pqp_vre_shd.g_old_rec.vre_attribute13
732       ,p_vre_attribute14_o
733       => pqp_vre_shd.g_old_rec.vre_attribute14
734       ,p_vre_attribute15_o
735       => pqp_vre_shd.g_old_rec.vre_attribute15
736       ,p_vre_attribute16_o
737       => pqp_vre_shd.g_old_rec.vre_attribute16
738       ,p_vre_attribute17_o
739       => pqp_vre_shd.g_old_rec.vre_attribute17
740       ,p_vre_attribute18_o
741       => pqp_vre_shd.g_old_rec.vre_attribute18
742       ,p_vre_attribute19_o
743       => pqp_vre_shd.g_old_rec.vre_attribute19
744       ,p_vre_attribute20_o
745       => pqp_vre_shd.g_old_rec.vre_attribute20
746       ,p_vre_information_category_o
747       => pqp_vre_shd.g_old_rec.vre_information_category
748       ,p_vre_information1_o
749       => pqp_vre_shd.g_old_rec.vre_information1
750       ,p_vre_information2_o
751       => pqp_vre_shd.g_old_rec.vre_information2
752       ,p_vre_information3_o
753       => pqp_vre_shd.g_old_rec.vre_information3
754       ,p_vre_information4_o
755       => pqp_vre_shd.g_old_rec.vre_information4
756       ,p_vre_information5_o
757       => pqp_vre_shd.g_old_rec.vre_information5
758       ,p_vre_information6_o
759       => pqp_vre_shd.g_old_rec.vre_information6
760       ,p_vre_information7_o
761       => pqp_vre_shd.g_old_rec.vre_information7
762       ,p_vre_information8_o
763       => pqp_vre_shd.g_old_rec.vre_information8
764       ,p_vre_information9_o
765       => pqp_vre_shd.g_old_rec.vre_information9
766       ,p_vre_information10_o
767       => pqp_vre_shd.g_old_rec.vre_information10
768       ,p_vre_information11_o
769       => pqp_vre_shd.g_old_rec.vre_information11
770       ,p_vre_information12_o
771       => pqp_vre_shd.g_old_rec.vre_information12
772       ,p_vre_information13_o
773       => pqp_vre_shd.g_old_rec.vre_information13
774       ,p_vre_information14_o
775       => pqp_vre_shd.g_old_rec.vre_information14
776       ,p_vre_information15_o
777       => pqp_vre_shd.g_old_rec.vre_information15
778       ,p_vre_information16_o
779       => pqp_vre_shd.g_old_rec.vre_information16
780       ,p_vre_information17_o
781       => pqp_vre_shd.g_old_rec.vre_information17
782       ,p_vre_information18_o
783       => pqp_vre_shd.g_old_rec.vre_information18
784       ,p_vre_information19_o
785       => pqp_vre_shd.g_old_rec.vre_information19
786       ,p_vre_information20_o
787       => pqp_vre_shd.g_old_rec.vre_information20
788       );
789     --
790   EXCEPTION
791     --
792     WHEN hr_api.cannot_find_prog_unit THEN
793       --
794       hr_api.cannot_find_prog_unit_error
795         (p_module_name => 'PQP_VEHICLE_REPOSITORY_F'
796         ,p_hook_type   => 'AU');
797       --
798   END;
799   --
800   hr_utility.set_location(' Leaving:'||l_proc, 10);
801 END post_update;
802 --
803 -- ----------------------------------------------------------------------------
804 -- |-----------------------------< convert_defs >-----------------------------|
805 -- ----------------------------------------------------------------------------
806 -- {Start Of Comments}
807 --
808 -- Description:
809 --   The Convert_Defs procedure has one very important function:
810 --   It must return the record structure for the row with all system defaulted
811 --   values converted into its corresponding parameter value for update. When
812 --   we attempt to update a row through the Upd process , certain
813 --   parameters can be defaulted which enables flexibility in the calling of
814 --   the upd process (e.g. only attributes which need to be updated need to be
815 --   specified). For the upd process to determine which attributes
816 --   have NOT been specified we need to check if the parameter has a reserved
817 --   system default value. Therefore, for all parameters which have a
818 --   corresponding reserved system default mechanism specified we need to
819 --   check if a system default is being used. If a system default is being
820 --   used then we convert the defaulted value into its corresponding attribute
821 --   value held in the g_old_rec data structure.
822 --
823 -- Prerequisites:
824 --   This private function can only be called from the upd process.
825 --
826 -- In Parameters:
827 --   A Pl/Sql record structure.
828 --
829 -- Post Success:
830 --   The record structure will be returned with all system defaulted parameter
831 --   values converted into its current row attribute value.
832 --
833 -- Post Failure:
834 --   No direct error handling is required within this function. Any possible
835 --   errors within this procedure will be a PL/SQL value error due to
836 --   conversion of datatypes or data lengths.
837 --
838 -- Developer Implementation Notes:
839 --   None.
840 --
841 -- Access Status:
842 --   Internal Row Handler Use Only.
843 --
844 -- {End Of Comments}
845 -- ----------------------------------------------------------------------------
846 PROCEDURE convert_defs
847   (p_rec in out nocopy pqp_vre_shd.g_rec_type
848   ) IS
849 --
850 BEGIN
851   --
852   -- We must now examine each argument value in the
853   -- p_rec plsql record structure
854   -- to see if a system default is being used. If a system default
855   -- is being used then we must set to the 'current' argument value.
856   --
857   IF (p_rec.registration_number = hr_api.g_varchar2) THEN
858       p_rec.registration_number :=
859       pqp_vre_shd.g_old_rec.registration_number;
860   END IF;
861   IF (p_rec.vehicle_type = hr_api.g_varchar2) THEN
862       p_rec.vehicle_type :=
863       pqp_vre_shd.g_old_rec.vehicle_type;
864   END IF;
865   IF (p_rec.vehicle_id_number = hr_api.g_varchar2) THEN
866       p_rec.vehicle_id_number :=
867       pqp_vre_shd.g_old_rec.vehicle_id_number;
868   END IF;
869   IF (p_rec.business_group_id = hr_api.g_number) THEN
870       p_rec.business_group_id :=
871       pqp_vre_shd.g_old_rec.business_group_id;
872   END IF;
873   IF (p_rec.make = hr_api.g_varchar2) THEN
874       p_rec.make :=
875       pqp_vre_shd.g_old_rec.make;
876   END IF;
877   IF (p_rec.model = hr_api.g_varchar2) THEN
878       p_rec.model :=
879       pqp_vre_shd.g_old_rec.model;
880   END IF;
881   IF (p_rec.initial_registration = hr_api.g_date) THEN
882       p_rec.initial_registration :=
883       pqp_vre_shd.g_old_rec.initial_registration;
884   END IF;
885   IF (p_rec.last_registration_renew_date = hr_api.g_date) THEN
886       p_rec.last_registration_renew_date :=
887       pqp_vre_shd.g_old_rec.last_registration_renew_date;
888   END IF;
889   IF (p_rec.engine_capacity_in_cc = hr_api.g_number) THEN
890       p_rec.engine_capacity_in_cc :=
891       pqp_vre_shd.g_old_rec.engine_capacity_in_cc;
892   END IF;
893   IF (p_rec.fuel_type = hr_api.g_varchar2) THEN
894       p_rec.fuel_type :=
895       pqp_vre_shd.g_old_rec.fuel_type;
896   END IF;
897   IF (p_rec.currency_code = hr_api.g_varchar2) THEN
898       p_rec.currency_code :=
899       pqp_vre_shd.g_old_rec.currency_code;
900   END IF;
901   IF (p_rec.list_price = hr_api.g_number) THEN
902       p_rec.list_price :=
903       pqp_vre_shd.g_old_rec.list_price;
904   END IF;
905   IF (p_rec.accessory_value_at_startdate = hr_api.g_number) THEN
906       p_rec.accessory_value_at_startdate :=
907       pqp_vre_shd.g_old_rec.accessory_value_at_startdate;
908   END IF;
909   IF (p_rec.accessory_value_added_later = hr_api.g_number) THEN
910       p_rec.accessory_value_added_later :=
911       pqp_vre_shd.g_old_rec.accessory_value_added_later;
912   END IF;
913   IF (p_rec.market_value_classic_car = hr_api.g_number) THEN
914       p_rec.market_value_classic_car :=
915       pqp_vre_shd.g_old_rec.market_value_classic_car;
916   END IF;
917   IF (p_rec.fiscal_ratings = hr_api.g_number) THEN
918       p_rec.fiscal_ratings :=
919       pqp_vre_shd.g_old_rec.fiscal_ratings;
920   END IF;
921   IF (p_rec.fiscal_ratings_uom = hr_api.g_varchar2) THEN
922       p_rec.fiscal_ratings_uom :=
923       pqp_vre_shd.g_old_rec.fiscal_ratings_uom;
924   END IF;
925   IF (p_rec.vehicle_provider = hr_api.g_varchar2) THEN
926       p_rec.vehicle_provider :=
927       pqp_vre_shd.g_old_rec.vehicle_provider;
928   END IF;
929   IF (p_rec.vehicle_ownership = hr_api.g_varchar2) THEN
930       p_rec.vehicle_ownership :=
931       pqp_vre_shd.g_old_rec.vehicle_ownership;
932   END IF;
933   IF (p_rec.shared_vehicle = hr_api.g_varchar2) THEN
934       p_rec.shared_vehicle :=
935       pqp_vre_shd.g_old_rec.shared_vehicle;
936   END IF;
937   IF (p_rec.vehicle_status = hr_api.g_varchar2) THEN
938       p_rec.vehicle_status :=
939       pqp_vre_shd.g_old_rec.vehicle_status;
940   END IF;
941   IF (p_rec.vehicle_inactivity_reason = hr_api.g_varchar2) THEN
942       p_rec.vehicle_inactivity_reason :=
943       pqp_vre_shd.g_old_rec.vehicle_inactivity_reason;
944   END IF;
945   IF (p_rec.asset_number = hr_api.g_varchar2) THEN
946       p_rec.asset_number :=
947       pqp_vre_shd.g_old_rec.asset_number;
948   END IF;
949   IF (p_rec.lease_contract_number = hr_api.g_varchar2) THEN
950       p_rec.lease_contract_number :=
951       pqp_vre_shd.g_old_rec.lease_contract_number;
952   END IF;
953   IF (p_rec.lease_contract_expiry_date = hr_api.g_date) THEN
954       p_rec.lease_contract_expiry_date :=
955       pqp_vre_shd.g_old_rec.lease_contract_expiry_date;
956   END IF;
957   IF (p_rec.taxation_method = hr_api.g_varchar2) THEN
958       p_rec.taxation_method :=
959       pqp_vre_shd.g_old_rec.taxation_method;
960   END IF;
961   IF (p_rec.fleet_info = hr_api.g_varchar2) THEN
962       p_rec.fleet_info :=
963       pqp_vre_shd.g_old_rec.fleet_info;
964   END IF;
965   IF (p_rec.fleet_transfer_date = hr_api.g_date) THEN
966       p_rec.fleet_transfer_date :=
967       pqp_vre_shd.g_old_rec.fleet_transfer_date;
968   END IF;
969   IF (p_rec.color = hr_api.g_varchar2) THEN
970       p_rec.color :=
971       pqp_vre_shd.g_old_rec.color;
972   END IF;
973   IF (p_rec.seating_capacity = hr_api.g_number) THEN
974       p_rec.seating_capacity :=
975       pqp_vre_shd.g_old_rec.seating_capacity;
976   END IF;
977   IF (p_rec.weight = hr_api.g_number) THEN
978       p_rec.weight :=
979       pqp_vre_shd.g_old_rec.weight;
980   END IF;
981   IF (p_rec.weight_uom = hr_api.g_varchar2) THEN
982       p_rec.weight_uom :=
983       pqp_vre_shd.g_old_rec.weight_uom;
984   END IF;
985   IF (p_rec.model_year = hr_api.g_number) THEN
986       p_rec.model_year :=
987       pqp_vre_shd.g_old_rec.model_year;
988   END IF;
989   IF (p_rec.insurance_number = hr_api.g_varchar2) THEN
990       p_rec.insurance_number :=
991       pqp_vre_shd.g_old_rec.insurance_number;
992   END IF;
993   IF (p_rec.insurance_expiry_date = hr_api.g_date) THEN
994       p_rec.insurance_expiry_date :=
995       pqp_vre_shd.g_old_rec.insurance_expiry_date;
996   END IF;
997   IF (p_rec.comments = hr_api.g_varchar2) THEN
998       p_rec.comments :=
999       pqp_vre_shd.g_old_rec.comments;
1000   END IF;
1001   IF (p_rec.vre_attribute_category = hr_api.g_varchar2) THEN
1002       p_rec.vre_attribute_category :=
1003       pqp_vre_shd.g_old_rec.vre_attribute_category;
1004   END IF;
1005   IF (p_rec.vre_attribute1 = hr_api.g_varchar2) THEN
1006       p_rec.vre_attribute1 :=
1007       pqp_vre_shd.g_old_rec.vre_attribute1;
1008   END IF;
1009   IF (p_rec.vre_attribute2 = hr_api.g_varchar2) THEN
1010       p_rec.vre_attribute2 :=
1011       pqp_vre_shd.g_old_rec.vre_attribute2;
1012   END IF;
1013   IF (p_rec.vre_attribute3 = hr_api.g_varchar2) THEN
1014       p_rec.vre_attribute3 :=
1015       pqp_vre_shd.g_old_rec.vre_attribute3;
1016   END IF;
1017   IF (p_rec.vre_attribute4 = hr_api.g_varchar2) THEN
1018       p_rec.vre_attribute4 :=
1019       pqp_vre_shd.g_old_rec.vre_attribute4;
1020   END IF;
1021   IF (p_rec.vre_attribute5 = hr_api.g_varchar2) THEN
1022       p_rec.vre_attribute5 :=
1023       pqp_vre_shd.g_old_rec.vre_attribute5;
1024   END IF;
1025   IF (p_rec.vre_attribute6 = hr_api.g_varchar2) THEN
1026       p_rec.vre_attribute6 :=
1027       pqp_vre_shd.g_old_rec.vre_attribute6;
1028   END IF;
1029   IF (p_rec.vre_attribute7 = hr_api.g_varchar2) THEN
1030       p_rec.vre_attribute7 :=
1031       pqp_vre_shd.g_old_rec.vre_attribute7;
1032   END IF;
1033   IF (p_rec.vre_attribute8 = hr_api.g_varchar2) THEN
1034       p_rec.vre_attribute8 :=
1035       pqp_vre_shd.g_old_rec.vre_attribute8;
1036   END IF;
1037   IF (p_rec.vre_attribute9 = hr_api.g_varchar2) THEN
1038       p_rec.vre_attribute9 :=
1039       pqp_vre_shd.g_old_rec.vre_attribute9;
1040   END IF;
1041   IF (p_rec.vre_attribute10 = hr_api.g_varchar2) THEN
1042       p_rec.vre_attribute10 :=
1043       pqp_vre_shd.g_old_rec.vre_attribute10;
1044   END IF;
1045   IF (p_rec.vre_attribute11 = hr_api.g_varchar2) THEN
1046       p_rec.vre_attribute11 :=
1047       pqp_vre_shd.g_old_rec.vre_attribute11;
1048   END IF;
1049   IF (p_rec.vre_attribute12 = hr_api.g_varchar2) THEN
1050       p_rec.vre_attribute12 :=
1051       pqp_vre_shd.g_old_rec.vre_attribute12;
1052   END IF;
1053   IF (p_rec.vre_attribute13 = hr_api.g_varchar2) THEN
1054       p_rec.vre_attribute13 :=
1055       pqp_vre_shd.g_old_rec.vre_attribute13;
1056   END IF;
1057   IF (p_rec.vre_attribute14 = hr_api.g_varchar2) THEN
1058       p_rec.vre_attribute14 :=
1059       pqp_vre_shd.g_old_rec.vre_attribute14;
1060   END IF;
1061   IF (p_rec.vre_attribute15 = hr_api.g_varchar2) THEN
1062       p_rec.vre_attribute15 :=
1063       pqp_vre_shd.g_old_rec.vre_attribute15;
1064   END IF;
1065   IF (p_rec.vre_attribute16 = hr_api.g_varchar2) THEN
1066       p_rec.vre_attribute16 :=
1067       pqp_vre_shd.g_old_rec.vre_attribute16;
1068   END IF;
1069   IF (p_rec.vre_attribute17 = hr_api.g_varchar2) THEN
1070       p_rec.vre_attribute17 :=
1071       pqp_vre_shd.g_old_rec.vre_attribute17;
1072   END IF;
1073   IF (p_rec.vre_attribute18 = hr_api.g_varchar2) THEN
1074       p_rec.vre_attribute18 :=
1075       pqp_vre_shd.g_old_rec.vre_attribute18;
1076   END IF;
1077   IF (p_rec.vre_attribute19 = hr_api.g_varchar2) THEN
1078       p_rec.vre_attribute19 :=
1079       pqp_vre_shd.g_old_rec.vre_attribute19;
1080   END IF;
1081   IF (p_rec.vre_attribute20 = hr_api.g_varchar2) THEN
1082       p_rec.vre_attribute20 :=
1083       pqp_vre_shd.g_old_rec.vre_attribute20;
1084   END IF;
1085   IF (p_rec.vre_information_category = hr_api.g_varchar2) THEN
1086       p_rec.vre_information_category :=
1087       pqp_vre_shd.g_old_rec.vre_information_category;
1088   END IF;
1089   IF (p_rec.vre_information1 = hr_api.g_varchar2) THEN
1090       p_rec.vre_information1 :=
1091       pqp_vre_shd.g_old_rec.vre_information1;
1092   END IF;
1093   IF (p_rec.vre_information2 = hr_api.g_varchar2) THEN
1094       p_rec.vre_information2 :=
1095       pqp_vre_shd.g_old_rec.vre_information2;
1096   END IF;
1097   IF (p_rec.vre_information3 = hr_api.g_varchar2) THEN
1098       p_rec.vre_information3 :=
1099       pqp_vre_shd.g_old_rec.vre_information3;
1100   END IF;
1101   IF (p_rec.vre_information4 = hr_api.g_varchar2) THEN
1102       p_rec.vre_information4 :=
1103       pqp_vre_shd.g_old_rec.vre_information4;
1104   END IF;
1105   IF (p_rec.vre_information5 = hr_api.g_varchar2) THEN
1106       p_rec.vre_information5 :=
1107       pqp_vre_shd.g_old_rec.vre_information5;
1108   END IF;
1109   IF (p_rec.vre_information6 = hr_api.g_varchar2) THEN
1110       p_rec.vre_information6 :=
1111       pqp_vre_shd.g_old_rec.vre_information6;
1112   END IF;
1113   IF (p_rec.vre_information7 = hr_api.g_varchar2) THEN
1114       p_rec.vre_information7 :=
1115       pqp_vre_shd.g_old_rec.vre_information7;
1116   END IF;
1117   IF (p_rec.vre_information8 = hr_api.g_varchar2) THEN
1118       p_rec.vre_information8 :=
1119       pqp_vre_shd.g_old_rec.vre_information8;
1120   END IF;
1121   IF (p_rec.vre_information9 = hr_api.g_varchar2) THEN
1122       p_rec.vre_information9 :=
1123       pqp_vre_shd.g_old_rec.vre_information9;
1124   END IF;
1125   IF (p_rec.vre_information10 = hr_api.g_varchar2) THEN
1126       p_rec.vre_information10 :=
1127       pqp_vre_shd.g_old_rec.vre_information10;
1128   END IF;
1129   IF (p_rec.vre_information11 = hr_api.g_varchar2) THEN
1130       p_rec.vre_information11 :=
1131       pqp_vre_shd.g_old_rec.vre_information11;
1132   END IF;
1133   IF (p_rec.vre_information12 = hr_api.g_varchar2) THEN
1134       p_rec.vre_information12 :=
1135       pqp_vre_shd.g_old_rec.vre_information12;
1136   END IF;
1137   IF (p_rec.vre_information13 = hr_api.g_varchar2) THEN
1138       p_rec.vre_information13 :=
1139       pqp_vre_shd.g_old_rec.vre_information13;
1140   END IF;
1141   IF (p_rec.vre_information14 = hr_api.g_varchar2) THEN
1142       p_rec.vre_information14 :=
1143       pqp_vre_shd.g_old_rec.vre_information14;
1144   END IF;
1145   IF (p_rec.vre_information15 = hr_api.g_varchar2) THEN
1146       p_rec.vre_information15 :=
1147       pqp_vre_shd.g_old_rec.vre_information15;
1148   END IF;
1149   IF (p_rec.vre_information16 = hr_api.g_varchar2) THEN
1150       p_rec.vre_information16 :=
1151       pqp_vre_shd.g_old_rec.vre_information16;
1152   END IF;
1153   IF (p_rec.vre_information17 = hr_api.g_varchar2) THEN
1154       p_rec.vre_information17 :=
1155       pqp_vre_shd.g_old_rec.vre_information17;
1156   END IF;
1157   IF (p_rec.vre_information18 = hr_api.g_varchar2) THEN
1158       p_rec.vre_information18 :=
1159       pqp_vre_shd.g_old_rec.vre_information18;
1160   END IF;
1161   IF (p_rec.vre_information19 = hr_api.g_varchar2) THEN
1162       p_rec.vre_information19 :=
1163       pqp_vre_shd.g_old_rec.vre_information19;
1164   END IF;
1165   IF (p_rec.vre_information20 = hr_api.g_varchar2) THEN
1166       p_rec.vre_information20 :=
1167       pqp_vre_shd.g_old_rec.vre_information20;
1168   END IF;
1169 
1170   --
1171 End convert_defs;
1172 --
1173 -- ----------------------------------------------------------------------------
1174 -- |---------------------------------< upd >----------------------------------|
1175 -- ----------------------------------------------------------------------------
1176 PROCEDURE upd
1177   (p_effective_date IN     DATE
1178   ,p_datetrack_mode IN     VARCHAR2
1179   ,p_rec            IN OUT NOCOPY pqp_vre_shd.g_rec_type
1180   ) IS
1181 --
1182   l_proc                        VARCHAR2(72) := g_package||'upd';
1183   l_validation_start_date       DATE;
1184   l_validation_end_date         DATE;
1185 --
1186 BEGIN
1187   hr_utility.set_location('Entering:'||l_proc, 5);
1188   --
1189   -- Ensure that the DateTrack update mode is valid
1190   --
1191   dt_api.validate_dt_upd_mode(p_datetrack_mode => p_datetrack_mode);
1192   --
1193   -- We must lock the row which we need to update.
1194   --
1195   pqp_vre_shd.lck
1196     (p_effective_date                   => p_effective_date
1197     ,p_datetrack_mode                   => p_datetrack_mode
1198     ,p_vehicle_repository_id            => p_rec.vehicle_repository_id
1199     ,p_object_version_number            => p_rec.object_version_number
1200     ,p_validation_start_date            => l_validation_start_date
1201     ,p_validation_end_date              => l_validation_end_date
1202     );
1203   --
1204   -- 1. During an update system defaults are used to determine if
1205   --    arguments have been defaulted or not. We must therefore
1206   --    derive the full record structure values to be updated.
1207   --
1208   -- 2. Call the supporting update validate operations.
1209   --
1210   pqp_vre_upd.convert_defs(p_rec);
1211   --
1212 
1213 
1214   pqp_vre_bus.update_validate
1215     (p_rec                              => p_rec
1216     ,p_effective_date                   => p_effective_date
1217     ,p_datetrack_mode                   => p_datetrack_mode
1218     ,p_validation_start_date            => l_validation_start_date
1219     ,p_validation_end_date              => l_validation_end_date
1220     );
1221   --
1222   -- Call to raise any errors on multi-message list
1223   hr_multi_message.end_validation_set;
1224   --
1225   -- Call the supporting pre-update operation
1226   --
1227   pre_update
1228     (p_rec                              => p_rec
1229     ,p_effective_date                   => p_effective_date
1230     ,p_datetrack_mode                   => p_datetrack_mode
1231     ,p_validation_start_date            => l_validation_start_date
1232     ,p_validation_end_date              => l_validation_end_date
1233     );
1234   --
1235   -- Update the row.
1236   --
1237   update_dml
1238     (p_rec                              => p_rec
1239     ,p_effective_date                   => p_effective_date
1240     ,p_datetrack_mode                   => p_datetrack_mode
1241     ,p_validation_start_date            => l_validation_start_date
1242     ,p_validation_end_date                  => l_validation_end_date
1243     );
1244   --
1245   -- Call the supporting post-update operation
1246   --
1247   post_update
1248     (p_rec                              => p_rec
1249     ,p_effective_date                   => p_effective_date
1250     ,p_datetrack_mode                   => p_datetrack_mode
1251     ,p_validation_start_date            => l_validation_start_date
1252     ,p_validation_end_date              => l_validation_end_date
1253     );
1254   --
1255   -- Call to raise any errors on multi-message list
1256   hr_multi_message.end_validation_set;
1257 END upd;
1258 --
1259 -- ----------------------------------------------------------------------------
1260 -- |------------------------------< upd >-------------------------------------|
1261 -- ----------------------------------------------------------------------------
1262 PROCEDURE upd
1263   (p_effective_date               IN     DATE
1264   ,p_datetrack_mode               IN     VARCHAR2
1265   ,p_vehicle_repository_id        IN     NUMBER
1266   ,p_object_version_number        IN OUT NOCOPY NUMBER
1267   ,p_registration_number          IN     VARCHAR2
1268   ,p_vehicle_type                 IN     VARCHAR2
1269   ,p_vehicle_id_number            IN     VARCHAR2
1270   ,p_business_group_id            IN     NUMBER
1271   ,p_make                         IN     VARCHAR2
1272   ,p_engine_capacity_in_cc        IN     NUMBER
1273   ,p_fuel_type                    IN     VARCHAR2
1274   ,p_currency_code                IN     VARCHAR2
1275   ,p_vehicle_status               IN     VARCHAR2
1276   ,p_vehicle_inactivity_reason    IN     VARCHAR2
1277   ,p_model                        IN     VARCHAR2
1278   ,p_initial_registration         IN     DATE
1279   ,p_last_registration_renew_date IN     DATE
1280   ,p_list_price                   IN     NUMBER
1281   ,p_accessory_value_at_startdate IN     NUMBER
1282   ,p_accessory_value_added_later  IN     NUMBER
1283   ,p_market_value_classic_car     IN     NUMBER
1284   ,p_fiscal_ratings               IN     NUMBER
1285   ,p_fiscal_ratings_uom           IN     VARCHAR2
1286   ,p_vehicle_provider             IN     VARCHAR2
1287   ,p_vehicle_ownership            IN     VARCHAR2
1288   ,p_shared_vehicle               IN     VARCHAR2
1289   ,p_asset_number                 IN     VARCHAR2
1290   ,p_lease_contract_number        IN     VARCHAR2
1291   ,p_lease_contract_expiry_date   IN     DATE
1292   ,p_taxation_method              IN     VARCHAR2
1293   ,p_fleet_info                   IN     VARCHAR2
1294   ,p_fleet_transfer_date          IN     DATE
1295   ,p_color                        IN     VARCHAR2
1296   ,p_seating_capacity             IN     NUMBER
1297   ,p_weight                       IN     NUMBER
1298   ,p_weight_uom                   IN     VARCHAR2
1299   ,p_model_year                   IN     NUMBER
1300   ,p_insurance_number             IN     VARCHAR2
1301   ,p_insurance_expiry_date        IN     DATE
1302   ,p_comments                     IN     VARCHAR2
1303   ,p_vre_attribute_category       IN     VARCHAR2
1304   ,p_vre_attribute1               IN     VARCHAR2
1305   ,p_vre_attribute2               IN     VARCHAR2
1306   ,p_vre_attribute3               IN     VARCHAR2
1307   ,p_vre_attribute4               IN     VARCHAR2
1308   ,p_vre_attribute5               IN     VARCHAR2
1309   ,p_vre_attribute6               IN     VARCHAR2
1310   ,p_vre_attribute7               IN     VARCHAR2
1311   ,p_vre_attribute8               IN     VARCHAR2
1312   ,p_vre_attribute9               IN     VARCHAR2
1313   ,p_vre_attribute10              IN     VARCHAR2
1314   ,p_vre_attribute11              IN     VARCHAR2
1315   ,p_vre_attribute12              IN     VARCHAR2
1316   ,p_vre_attribute13              IN     VARCHAR2
1317   ,p_vre_attribute14              IN     VARCHAR2
1318   ,p_vre_attribute15              IN     VARCHAR2
1319   ,p_vre_attribute16              IN     VARCHAR2
1320   ,p_vre_attribute17              IN     VARCHAR2
1321   ,p_vre_attribute18              IN     VARCHAR2
1322   ,p_vre_attribute19              IN     VARCHAR2
1323   ,p_vre_attribute20              IN     VARCHAR2
1324   ,p_vre_information_category     IN     VARCHAR2
1325   ,p_vre_information1             IN     VARCHAR2
1326   ,p_vre_information2             IN     VARCHAR2
1327   ,p_vre_information3             IN     VARCHAR2
1328   ,p_vre_information4             IN     VARCHAR2
1329   ,p_vre_information5             IN     VARCHAR2
1330   ,p_vre_information6             IN     VARCHAR2
1331   ,p_vre_information7             IN     VARCHAR2
1332   ,p_vre_information8             IN     VARCHAR2
1333   ,p_vre_information9             IN     VARCHAR2
1334   ,p_vre_information10            IN     VARCHAR2
1335   ,p_vre_information11            IN     VARCHAR2
1336   ,p_vre_information12            IN     VARCHAR2
1337   ,p_vre_information13            IN     VARCHAR2
1338   ,p_vre_information14            IN     VARCHAR2
1339   ,p_vre_information15            IN     VARCHAR2
1340   ,p_vre_information16            IN     VARCHAR2
1341   ,p_vre_information17            IN     VARCHAR2
1342   ,p_vre_information18            IN     VARCHAR2
1343   ,p_vre_information19            IN     VARCHAR2
1344   ,p_vre_information20            IN     VARCHAR2
1345   ,p_effective_start_date         OUT NOCOPY DATE
1346   ,p_effective_end_date           OUT NOCOPY DATE
1347   ) IS
1348 --
1349   l_rec         pqp_vre_shd.g_rec_type;
1350   l_proc        varchar2(72) := g_package||'upd';
1351 --
1352 BEGIN
1353   hr_utility.set_location('Entering:'||l_proc, 5);
1354   --
1355   -- Call conversion function to turn arguments into the
1356   -- l_rec structure.
1357   --
1358   l_rec :=
1359   pqp_vre_shd.convert_args
1360     (p_vehicle_repository_id
1361     ,null
1362     ,null
1363     ,p_registration_number
1364     ,p_vehicle_type
1365     ,p_vehicle_id_number
1366     ,p_business_group_id
1367     ,p_make
1368     ,p_model
1369     ,p_initial_registration
1370     ,p_last_registration_renew_date
1371     ,p_engine_capacity_in_cc
1372     ,p_fuel_type
1373     ,p_currency_code
1374     ,p_list_price
1375     ,p_accessory_value_at_startdate
1376     ,p_accessory_value_added_later
1377     ,p_market_value_classic_car
1378     ,p_fiscal_ratings
1379     ,p_fiscal_ratings_uom
1380     ,p_vehicle_provider
1381     ,p_vehicle_ownership
1382     ,p_shared_vehicle
1383     ,p_vehicle_status
1384     ,p_vehicle_inactivity_reason
1385     ,p_asset_number
1386     ,p_lease_contract_number
1387     ,p_lease_contract_expiry_date
1388     ,p_taxation_method
1389     ,p_fleet_info
1390     ,p_fleet_transfer_date
1391     ,p_object_version_number
1392     ,p_color
1393     ,p_seating_capacity
1394     ,p_weight
1395     ,p_weight_uom
1396     ,p_model_year
1397     ,p_insurance_number
1398     ,p_insurance_expiry_date
1399     ,p_comments
1400     ,p_vre_attribute_category
1401     ,p_vre_attribute1
1402     ,p_vre_attribute2
1403     ,p_vre_attribute3
1404     ,p_vre_attribute4
1405     ,p_vre_attribute5
1406     ,p_vre_attribute6
1407     ,p_vre_attribute7
1408     ,p_vre_attribute8
1409     ,p_vre_attribute9
1410     ,p_vre_attribute10
1411     ,p_vre_attribute11
1412     ,p_vre_attribute12
1413     ,p_vre_attribute13
1414     ,p_vre_attribute14
1415     ,p_vre_attribute15
1416     ,p_vre_attribute16
1417     ,p_vre_attribute17
1418     ,p_vre_attribute18
1419     ,p_vre_attribute19
1420     ,p_vre_attribute20
1421     ,p_vre_information_category
1422     ,p_vre_information1
1423     ,p_vre_information2
1424     ,p_vre_information3
1425     ,p_vre_information4
1426     ,p_vre_information5
1427     ,p_vre_information6
1428     ,p_vre_information7
1429     ,p_vre_information8
1430     ,p_vre_information9
1431     ,p_vre_information10
1432     ,p_vre_information11
1433     ,p_vre_information12
1434     ,p_vre_information13
1435     ,p_vre_information14
1436     ,p_vre_information15
1437     ,p_vre_information16
1438     ,p_vre_information17
1439     ,p_vre_information18
1440     ,p_vre_information19
1441     ,p_vre_information20
1442     );
1443   --
1444   -- Having converted the arguments into the
1445   -- plsql record structure we call the corresponding record
1446   -- business process.
1447   --
1448   pqp_vre_upd.upd
1449     (p_effective_date
1450     ,p_datetrack_mode
1451     ,l_rec
1452     );
1453   --
1454   -- Set the out parameters
1455   --
1456   p_object_version_number            := l_rec.object_version_number;
1457   p_effective_start_date             := l_rec.effective_start_date;
1458   p_effective_end_date               := l_rec.effective_end_date;
1459   --
1460   --
1461   hr_utility.set_location(' Leaving:'||l_proc, 10);
1462 END upd;
1463 --
1464 END pqp_vre_upd;