DBA Data[Home] [Help]

PACKAGE BODY: APPS.PQP_PVD_UPD

Source


4 -- ----------------------------------------------------------------------------
1 Package Body pqp_pvd_upd as
2 /* $Header: pqpvdrhi.pkb 115.6 2003/02/17 22:14:43 tmehra noship $ */
3 --
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  pqp_pvd_upd.';  -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |------------------------------< update_dml >------------------------------|
12 -- ----------------------------------------------------------------------------
13 -- {Start Of Comments}
14 --
15 -- Description:
16 --   This procedure controls the actual dml update logic. The processing of
17 --   this procedure is:
18 --   1) Increment the object_version_number by 1 if the object_version_number
19 --      is defined as an attribute for this entity.
20 --   2) To set and unset the g_api_dml status as required (as we are about to
21 --      perform dml).
22 --   3) To update the specified row in the schema using the primary key in
23 --      the predicates.
24 --   4) To trap any constraint violations that may have occurred.
25 --   5) To raise any other errors.
26 --
27 -- Prerequisites:
28 --   This is an internal private procedure which must be called from the upd
29 --   procedure.
30 --
31 -- In Parameters:
32 --   A Pl/Sql record structre.
33 --
34 -- Post Success:
35 --   The specified row will be updated in the schema.
36 --
37 -- Post Failure:
38 --   On the update dml failure it is important to note that we always reset the
39 --   g_api_dml status to false.
40 --   If a check, unique or parent integrity constraint violation is raised the
41 --   constraint_error procedure will be called.
42 --   If any other error is reported, the error will be raised after the
43 --   g_api_dml status is reset.
44 --
45 -- Developer Implementation Notes:
46 --   The update 'set' attribute list should be modified if any of your
47 --   attributes are not updateable.
48 --
49 -- Access Status:
50 --   Internal Row Handler Use Only.
51 --
52 -- {End Of Comments}
53 -- ----------------------------------------------------------------------------
54 Procedure update_dml
55   (p_rec in out nocopy pqp_pvd_shd.g_rec_type
56   ) is
57 --
58   l_proc  varchar2(72) := g_package||'update_dml';
59 --
60 Begin
61   hr_utility.set_location('Entering:'||l_proc, 5);
62   --
63   -- Increment the object version
64   p_rec.object_version_number := p_rec.object_version_number + 1;
65   --
66   pqp_pvd_shd.g_api_dml := true;  -- Set the api dml status
67   --
68   -- Update the pqp_vehicle_details Row
69   --
70   update pqp_vehicle_details
71     set
72      vehicle_details_id              = p_rec.vehicle_details_id
73     ,vehicle_type                    = p_rec.vehicle_type
74     ,business_group_id               = p_rec.business_group_id
75     ,registration_number             = p_rec.registration_number
76     ,make                            = p_rec.make
77     ,model                           = p_rec.model
78     ,date_first_registered           = p_rec.date_first_registered
79     ,engine_capacity_in_cc           = p_rec.engine_capacity_in_cc
80     ,fuel_type                       = p_rec.fuel_type
81     ,fuel_card                       = p_rec.fuel_card
82     ,currency_code                   = p_rec.currency_code
83     ,list_price                      = p_rec.list_price
84     ,accessory_value_at_startdate    = p_rec.accessory_value_at_startdate
85     ,accessory_value_added_later     = p_rec.accessory_value_added_later
86 --    ,capital_contributions           = p_rec.capital_contributions
87 --    ,private_use_contributions       = p_rec.private_use_contributions
88     ,market_value_classic_car        = p_rec.market_value_classic_car
89     ,co2_emissions                   = p_rec.co2_emissions
90     ,vehicle_provider                = p_rec.vehicle_provider
94     ,vhd_attribute_category          = p_rec.vhd_attribute_category
91     ,object_version_number           = p_rec.object_version_number
92     ,vehicle_identification_number   = p_rec.vehicle_identification_number
93     ,vehicle_ownership               = p_rec.vehicle_ownership
95     ,vhd_attribute1                  = p_rec.vhd_attribute1
96     ,vhd_attribute2                  = p_rec.vhd_attribute2
97     ,vhd_attribute3                  = p_rec.vhd_attribute3
98     ,vhd_attribute4                  = p_rec.vhd_attribute4
99     ,vhd_attribute5                  = p_rec.vhd_attribute5
100     ,vhd_attribute6                  = p_rec.vhd_attribute6
101     ,vhd_attribute7                  = p_rec.vhd_attribute7
102     ,vhd_attribute8                  = p_rec.vhd_attribute8
103     ,vhd_attribute9                  = p_rec.vhd_attribute9
104     ,vhd_attribute10                 = p_rec.vhd_attribute10
105     ,vhd_attribute11                 = p_rec.vhd_attribute11
106     ,vhd_attribute12                 = p_rec.vhd_attribute12
107     ,vhd_attribute13                 = p_rec.vhd_attribute13
108     ,vhd_attribute14                 = p_rec.vhd_attribute14
109     ,vhd_attribute15                 = p_rec.vhd_attribute15
110     ,vhd_attribute16                 = p_rec.vhd_attribute16
111     ,vhd_attribute17                 = p_rec.vhd_attribute17
112     ,vhd_attribute18                 = p_rec.vhd_attribute18
113     ,vhd_attribute19                 = p_rec.vhd_attribute19
114     ,vhd_attribute20                 = p_rec.vhd_attribute20
115     ,vhd_information_category        = p_rec.vhd_information_category
116     ,vhd_information1                = p_rec.vhd_information1
117     ,vhd_information2                = p_rec.vhd_information2
118     ,vhd_information3                = p_rec.vhd_information3
119     ,vhd_information4                = p_rec.vhd_information4
120     ,vhd_information5                = p_rec.vhd_information5
121     ,vhd_information6                = p_rec.vhd_information6
122     ,vhd_information7                = p_rec.vhd_information7
123     ,vhd_information8                = p_rec.vhd_information8
124     ,vhd_information9                = p_rec.vhd_information9
125     ,vhd_information10               = p_rec.vhd_information10
126     ,vhd_information11               = p_rec.vhd_information11
127     ,vhd_information12               = p_rec.vhd_information12
128     ,vhd_information13               = p_rec.vhd_information13
129     ,vhd_information14               = p_rec.vhd_information14
130     ,vhd_information15               = p_rec.vhd_information15
131     ,vhd_information16               = p_rec.vhd_information16
132     ,vhd_information17               = p_rec.vhd_information17
136     where vehicle_details_id = p_rec.vehicle_details_id;
133     ,vhd_information18               = p_rec.vhd_information18
134     ,vhd_information19               = p_rec.vhd_information19
135     ,vhd_information20               = p_rec.vhd_information20
137   --
138   pqp_pvd_shd.g_api_dml := false;   -- Unset the api dml status
139   --
140   hr_utility.set_location(' Leaving:'||l_proc, 10);
141 --
142 Exception
143   When hr_api.check_integrity_violated Then
144     -- A check constraint has been violated
145     pqp_pvd_shd.g_api_dml := false;   -- Unset the api dml status
146     pqp_pvd_shd.constraint_error
147       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
148   When hr_api.parent_integrity_violated Then
149     -- Parent integrity has been violated
150     pqp_pvd_shd.g_api_dml := false;   -- Unset the api dml status
151     pqp_pvd_shd.constraint_error
152       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
153   When hr_api.unique_integrity_violated Then
154     -- Unique integrity has been violated
155     pqp_pvd_shd.g_api_dml := false;   -- Unset the api dml status
156     pqp_pvd_shd.constraint_error
157       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
158   When Others Then
159     pqp_pvd_shd.g_api_dml := false;   -- Unset the api dml status
160     Raise;
161 End update_dml;
162 --
163 -- ----------------------------------------------------------------------------
164 -- |------------------------------< pre_update >------------------------------|
165 -- ----------------------------------------------------------------------------
166 -- {Start Of Comments}
167 --
168 -- Description:
169 --   This private procedure contains any processing which is required before
170 --   the update dml.
171 --
172 -- Prerequisites:
173 --   This is an internal procedure which is called from the upd procedure.
174 --
175 -- In Parameters:
176 --   A Pl/Sql record structure.
177 --
178 -- Post Success:
179 --   Processing continues.
180 --
181 -- Post Failure:
182 --   If an error has occurred, an error message and exception wil be raised
183 --   but not handled.
187 --   coded within this procedure. It is important to note that any 3rd party
184 --
185 -- Developer Implementation Notes:
186 --   Any pre-processing required before the update dml is issued should be
188 --   maintenance should be reviewed before placing in this procedure.
189 --
190 -- Access Status:
191 --   Internal Row Handler Use Only.
192 --
193 -- {End Of Comments}
194 -- ----------------------------------------------------------------------------
195 Procedure pre_update
196   (p_rec in pqp_pvd_shd.g_rec_type
197   ) is
198 --
199   l_proc  varchar2(72) := g_package||'pre_update';
200 --
201 Begin
202   hr_utility.set_location('Entering:'||l_proc, 5);
203   --
204   hr_utility.set_location(' Leaving:'||l_proc, 10);
205 End pre_update;
206 --
207 -- ----------------------------------------------------------------------------
208 -- |-----------------------------< post_update >------------------------------|
209 -- ----------------------------------------------------------------------------
210 -- {Start Of Comments}
211 --
212 -- Description:
213 --   This private procedure contains any processing which is required after the
214 --   update dml.
215 --
216 -- Prerequisites:
217 --   This is an internal procedure which is called from the upd procedure.
218 --
219 -- In Parameters:
220 --   A Pl/Sql record structure.
221 --
222 -- Post Success:
223 --   Processing continues.
224 --
225 -- Post Failure:
226 --   If an error has occurred, an error message and exception will be raised
227 --   but not handled.
228 --
229 -- Developer Implementation Notes:
230 --   Any post-processing required after the update dml is issued should be
231 --   coded within this procedure. It is important to note that any 3rd party
232 --   maintenance should be reviewed before placing in this procedure.
233 --
234 -- Access Status:
235 --   Internal Row Handler Use Only.
236 --
237 -- {End Of Comments}
238 -- ----------------------------------------------------------------------------
239 Procedure post_update
240   (p_effective_date               in date
241   ,p_rec                          in pqp_pvd_shd.g_rec_type
242   ) is
243 --
244   l_proc  varchar2(72) := g_package||'post_update';
245 --
246 Begin
247   hr_utility.set_location('Entering:'||l_proc, 5);
248   begin
249     --
250     pqp_pvd_rku.after_update
251       (p_effective_date              => p_effective_date
252       ,p_vehicle_details_id
253       => p_rec.vehicle_details_id
254       ,p_vehicle_type
255       => p_rec.vehicle_type
256       ,p_business_group_id
257       => p_rec.business_group_id
258       ,p_registration_number
259       => p_rec.registration_number
260       ,p_make
261       => p_rec.make
262       ,p_model
263       => p_rec.model
264       ,p_date_first_registered
265       => p_rec.date_first_registered
266       ,p_engine_capacity_in_cc
267       => p_rec.engine_capacity_in_cc
268       ,p_fuel_type
269       => p_rec.fuel_type
270       ,p_fuel_card
271       => p_rec.fuel_card
272       ,p_currency_code
273       => p_rec.currency_code
274       ,p_list_price
275       => p_rec.list_price
276       ,p_accessory_value_at_startdate
277       => p_rec.accessory_value_at_startdate
278       ,p_accessory_value_added_later
279       => p_rec.accessory_value_added_later
280 --      ,p_capital_contributions
281 --      => p_rec.capital_contributions
282 --      ,p_private_use_contributions
283 --      => p_rec.private_use_contributions
284       ,p_market_value_classic_car
285       => p_rec.market_value_classic_car
286       ,p_co2_emissions
287       => p_rec.co2_emissions
288       ,p_vehicle_provider
289       => p_rec.vehicle_provider
290       ,p_object_version_number
291       => p_rec.object_version_number
292       ,p_vehicle_identification_numbe
293       => p_rec.vehicle_identification_number
294       ,p_vehicle_ownership
295       => p_rec.vehicle_ownership
296       ,p_vhd_attribute_category
297       => p_rec.vhd_attribute_category
298       ,p_vhd_attribute1
299       => p_rec.vhd_attribute1
300       ,p_vhd_attribute2
301       => p_rec.vhd_attribute2
302       ,p_vhd_attribute3
303       => p_rec.vhd_attribute3
304       ,p_vhd_attribute4
305       => p_rec.vhd_attribute4
306       ,p_vhd_attribute5
307       => p_rec.vhd_attribute5
308       ,p_vhd_attribute6
309       => p_rec.vhd_attribute6
310       ,p_vhd_attribute7
311       => p_rec.vhd_attribute7
312       ,p_vhd_attribute8
313       => p_rec.vhd_attribute8
314       ,p_vhd_attribute9
315       => p_rec.vhd_attribute9
316       ,p_vhd_attribute10
317       => p_rec.vhd_attribute10
318       ,p_vhd_attribute11
319       => p_rec.vhd_attribute11
320       ,p_vhd_attribute12
321       => p_rec.vhd_attribute12
322       ,p_vhd_attribute13
323       => p_rec.vhd_attribute13
324       ,p_vhd_attribute14
325       => p_rec.vhd_attribute14
326       ,p_vhd_attribute15
327       => p_rec.vhd_attribute15
328       ,p_vhd_attribute16
329       => p_rec.vhd_attribute16
330       ,p_vhd_attribute17
331       => p_rec.vhd_attribute17
332       ,p_vhd_attribute18
333       => p_rec.vhd_attribute18
334       ,p_vhd_attribute19
335       => p_rec.vhd_attribute19
336       ,p_vhd_attribute20
340       ,p_vhd_information1
337       => p_rec.vhd_attribute20
338       ,p_vhd_information_category
339       => p_rec.vhd_information_category
341       => p_rec.vhd_information1
342       ,p_vhd_information2
343       => p_rec.vhd_information2
344       ,p_vhd_information3
345       => p_rec.vhd_information3
346       ,p_vhd_information4
347       => p_rec.vhd_information4
348       ,p_vhd_information5
349       => p_rec.vhd_information5
350       ,p_vhd_information6
351       => p_rec.vhd_information6
352       ,p_vhd_information7
353       => p_rec.vhd_information7
354       ,p_vhd_information8
355       => p_rec.vhd_information8
356       ,p_vhd_information9
357       => p_rec.vhd_information9
358       ,p_vhd_information10
359       => p_rec.vhd_information10
360       ,p_vhd_information11
361       => p_rec.vhd_information11
362       ,p_vhd_information12
363       => p_rec.vhd_information12
364       ,p_vhd_information13
365       => p_rec.vhd_information13
366       ,p_vhd_information14
367       => p_rec.vhd_information14
368       ,p_vhd_information15
369       => p_rec.vhd_information15
370       ,p_vhd_information16
371       => p_rec.vhd_information16
372       ,p_vhd_information17
373       => p_rec.vhd_information17
374       ,p_vhd_information18
375       => p_rec.vhd_information18
376       ,p_vhd_information19
377       => p_rec.vhd_information19
378       ,p_vhd_information20
379       => p_rec.vhd_information20
380       ,p_vehicle_type_o
381       => pqp_pvd_shd.g_old_rec.vehicle_type
382       ,p_business_group_id_o
383       => pqp_pvd_shd.g_old_rec.business_group_id
384       ,p_registration_number_o
385       => pqp_pvd_shd.g_old_rec.registration_number
386       ,p_make_o
387       => pqp_pvd_shd.g_old_rec.make
388       ,p_model_o
389       => pqp_pvd_shd.g_old_rec.model
390       ,p_date_first_registered_o
391       => pqp_pvd_shd.g_old_rec.date_first_registered
392       ,p_engine_capacity_in_cc_o
393       => pqp_pvd_shd.g_old_rec.engine_capacity_in_cc
394       ,p_fuel_type_o
395       => pqp_pvd_shd.g_old_rec.fuel_type
396       ,p_fuel_card_o
397       => pqp_pvd_shd.g_old_rec.fuel_card
398       ,p_currency_code_o
399       => pqp_pvd_shd.g_old_rec.currency_code
400       ,p_list_price_o
401       => pqp_pvd_shd.g_old_rec.list_price
402       ,p_accessory_value_at_startda_o
403       => pqp_pvd_shd.g_old_rec.accessory_value_at_startdate
404       ,p_accessory_value_added_late_o
405       => pqp_pvd_shd.g_old_rec.accessory_value_added_later
406 --      ,p_capital_contributions_o
407 --      => pqp_pvd_shd.g_old_rec.capital_contributions
408 --      ,p_private_use_contributions_o
409 --      => pqp_pvd_shd.g_old_rec.private_use_contributions
410       ,p_market_value_classic_car_o
411       => pqp_pvd_shd.g_old_rec.market_value_classic_car
412       ,p_co2_emissions_o
413       => pqp_pvd_shd.g_old_rec.co2_emissions
414       ,p_vehicle_provider_o
415       => pqp_pvd_shd.g_old_rec.vehicle_provider
416       ,p_object_version_number_o
417       => pqp_pvd_shd.g_old_rec.object_version_number
418       ,p_vehicle_identification_num_o
419       => pqp_pvd_shd.g_old_rec.vehicle_identification_number
420       ,p_vehicle_ownership_o
421       => pqp_pvd_shd.g_old_rec.vehicle_ownership
422       ,p_vhd_attribute_category_o
423       => pqp_pvd_shd.g_old_rec.vhd_attribute_category
424       ,p_vhd_attribute1_o
425       => pqp_pvd_shd.g_old_rec.vhd_attribute1
426       ,p_vhd_attribute2_o
427       => pqp_pvd_shd.g_old_rec.vhd_attribute2
428       ,p_vhd_attribute3_o
429       => pqp_pvd_shd.g_old_rec.vhd_attribute3
430       ,p_vhd_attribute4_o
431       => pqp_pvd_shd.g_old_rec.vhd_attribute4
432       ,p_vhd_attribute5_o
433       => pqp_pvd_shd.g_old_rec.vhd_attribute5
434       ,p_vhd_attribute6_o
435       => pqp_pvd_shd.g_old_rec.vhd_attribute6
436       ,p_vhd_attribute7_o
437       => pqp_pvd_shd.g_old_rec.vhd_attribute7
438       ,p_vhd_attribute8_o
439       => pqp_pvd_shd.g_old_rec.vhd_attribute8
440       ,p_vhd_attribute9_o
441       => pqp_pvd_shd.g_old_rec.vhd_attribute9
442       ,p_vhd_attribute10_o
443       => pqp_pvd_shd.g_old_rec.vhd_attribute10
444       ,p_vhd_attribute11_o
445       => pqp_pvd_shd.g_old_rec.vhd_attribute11
446       ,p_vhd_attribute12_o
447       => pqp_pvd_shd.g_old_rec.vhd_attribute12
448       ,p_vhd_attribute13_o
449       => pqp_pvd_shd.g_old_rec.vhd_attribute13
450       ,p_vhd_attribute14_o
451       => pqp_pvd_shd.g_old_rec.vhd_attribute14
452       ,p_vhd_attribute15_o
453       => pqp_pvd_shd.g_old_rec.vhd_attribute15
454       ,p_vhd_attribute16_o
455       => pqp_pvd_shd.g_old_rec.vhd_attribute16
456       ,p_vhd_attribute17_o
457       => pqp_pvd_shd.g_old_rec.vhd_attribute17
458       ,p_vhd_attribute18_o
459       => pqp_pvd_shd.g_old_rec.vhd_attribute18
460       ,p_vhd_attribute19_o
461       => pqp_pvd_shd.g_old_rec.vhd_attribute19
462       ,p_vhd_attribute20_o
463       => pqp_pvd_shd.g_old_rec.vhd_attribute20
464       ,p_vhd_information_category_o
465       => pqp_pvd_shd.g_old_rec.vhd_information_category
466       ,p_vhd_information1_o
467       => pqp_pvd_shd.g_old_rec.vhd_information1
468       ,p_vhd_information2_o
469       => pqp_pvd_shd.g_old_rec.vhd_information2
470       ,p_vhd_information3_o
471       => pqp_pvd_shd.g_old_rec.vhd_information3
472       ,p_vhd_information4_o
478       ,p_vhd_information7_o
473       => pqp_pvd_shd.g_old_rec.vhd_information4
474       ,p_vhd_information5_o
475       => pqp_pvd_shd.g_old_rec.vhd_information5
476       ,p_vhd_information6_o
477       => pqp_pvd_shd.g_old_rec.vhd_information6
479       => pqp_pvd_shd.g_old_rec.vhd_information7
480       ,p_vhd_information8_o
481       => pqp_pvd_shd.g_old_rec.vhd_information8
482       ,p_vhd_information9_o
483       => pqp_pvd_shd.g_old_rec.vhd_information9
484       ,p_vhd_information10_o
485       => pqp_pvd_shd.g_old_rec.vhd_information10
486       ,p_vhd_information11_o
487       => pqp_pvd_shd.g_old_rec.vhd_information11
488       ,p_vhd_information12_o
489       => pqp_pvd_shd.g_old_rec.vhd_information12
490       ,p_vhd_information13_o
491       => pqp_pvd_shd.g_old_rec.vhd_information13
492       ,p_vhd_information14_o
493       => pqp_pvd_shd.g_old_rec.vhd_information14
494       ,p_vhd_information15_o
495       => pqp_pvd_shd.g_old_rec.vhd_information15
496       ,p_vhd_information16_o
497       => pqp_pvd_shd.g_old_rec.vhd_information16
498       ,p_vhd_information17_o
499       => pqp_pvd_shd.g_old_rec.vhd_information17
500       ,p_vhd_information18_o
501       => pqp_pvd_shd.g_old_rec.vhd_information18
502       ,p_vhd_information19_o
503       => pqp_pvd_shd.g_old_rec.vhd_information19
504       ,p_vhd_information20_o
505       => pqp_pvd_shd.g_old_rec.vhd_information20
506       );
507     --
508   exception
509     --
510     when hr_api.cannot_find_prog_unit then
511       --
512       hr_api.cannot_find_prog_unit_error
513         (p_module_name => 'PQP_VEHICLE_DETAILS'
514         ,p_hook_type   => 'AU');
515       --
516   end;
517   --
518   hr_utility.set_location(' Leaving:'||l_proc, 10);
519 End post_update;
520 --
521 -- ----------------------------------------------------------------------------
522 -- |-----------------------------< convert_defs >-----------------------------|
523 -- ----------------------------------------------------------------------------
524 -- {Start Of Comments}
525 --
526 -- Description:
527 --   The Convert_Defs procedure has one very important function:
528 --   It must return the record structure for the row with all system defaulted
529 --   values converted into its corresponding parameter value for update. When
530 --   we attempt to update a row through the Upd process , certain
531 --   parameters can be defaulted which enables flexibility in the calling of
532 --   the upd process (e.g. only attributes which need to be updated need to be
533 --   specified). For the upd process to determine which attributes
534 --   have NOT been specified we need to check if the parameter has a reserved
535 --   system default value. Therefore, for all parameters which have a
536 --   corresponding reserved system default mechanism specified we need to
537 --   check if a system default is being used. If a system default is being
538 --   used then we convert the defaulted value into its corresponding attribute
539 --   value held in the g_old_rec data structure.
540 --
541 -- Prerequisites:
542 --   This private function can only be called from the upd process.
543 --
544 -- In Parameters:
545 --   A Pl/Sql record structure.
546 --
547 -- Post Success:
548 --   The record structure will be returned with all system defaulted parameter
549 --   values converted into its current row attribute value.
550 --
551 -- Post Failure:
552 --   No direct error handling is required within this function. Any possible
553 --   errors within this procedure will be a PL/SQL value error due to
554 --   conversion of datatypes or data lengths.
555 --
556 -- Developer Implementation Notes:
557 --   None.
558 --
559 -- Access Status:
560 --   Internal Row Handler Use Only.
561 --
562 -- {End Of Comments}
563 -- ----------------------------------------------------------------------------
564 Procedure convert_defs
565   (p_rec in out nocopy pqp_pvd_shd.g_rec_type
566   ) is
567 --
568 Begin
569   --
570   -- We must now examine each argument value in the
571   -- p_rec plsql record structure
572   -- to see if a system default is being used. If a system default
573   -- is being used then we must set to the 'current' argument value.
574   --
575   If (p_rec.vehicle_type = hr_api.g_varchar2) then
576     p_rec.vehicle_type :=
577     pqp_pvd_shd.g_old_rec.vehicle_type;
578   End If;
579   If (p_rec.business_group_id = hr_api.g_number) then
580     p_rec.business_group_id :=
581     pqp_pvd_shd.g_old_rec.business_group_id;
582   End If;
583   If (p_rec.registration_number = hr_api.g_varchar2) then
584     p_rec.registration_number :=
585     pqp_pvd_shd.g_old_rec.registration_number;
586   End If;
590   End If;
587   If (p_rec.make = hr_api.g_varchar2) then
588     p_rec.make :=
589     pqp_pvd_shd.g_old_rec.make;
591   If (p_rec.model = hr_api.g_varchar2) then
592     p_rec.model :=
593     pqp_pvd_shd.g_old_rec.model;
594   End If;
595   If (p_rec.date_first_registered = hr_api.g_date) then
596     p_rec.date_first_registered :=
597     pqp_pvd_shd.g_old_rec.date_first_registered;
598   End If;
599   If (p_rec.engine_capacity_in_cc = hr_api.g_number) then
600     p_rec.engine_capacity_in_cc :=
601     pqp_pvd_shd.g_old_rec.engine_capacity_in_cc;
602   End If;
603   If (p_rec.fuel_type = hr_api.g_varchar2) then
604     p_rec.fuel_type :=
605     pqp_pvd_shd.g_old_rec.fuel_type;
606   End If;
607   If (p_rec.fuel_card = hr_api.g_varchar2) then
608     p_rec.fuel_card :=
609     pqp_pvd_shd.g_old_rec.fuel_card;
610   End If;
611   If (p_rec.currency_code = hr_api.g_varchar2) then
612     p_rec.currency_code :=
613     pqp_pvd_shd.g_old_rec.currency_code;
614   End If;
615   If (p_rec.list_price = hr_api.g_number) then
616     p_rec.list_price :=
617     pqp_pvd_shd.g_old_rec.list_price;
618   End If;
619   If (p_rec.accessory_value_at_startdate = hr_api.g_number) then
620     p_rec.accessory_value_at_startdate :=
621     pqp_pvd_shd.g_old_rec.accessory_value_at_startdate;
622   End If;
623   If (p_rec.accessory_value_added_later = hr_api.g_number) then
624     p_rec.accessory_value_added_later :=
625     pqp_pvd_shd.g_old_rec.accessory_value_added_later;
626   End If;
627 --  If (p_rec.capital_contributions = hr_api.g_number) then
628 --    p_rec.capital_contributions :=
629 --    pqp_pvd_shd.g_old_rec.capital_contributions;
630 --  End If;
631 --  If (p_rec.private_use_contributions = hr_api.g_number) then
632 --    p_rec.private_use_contributions :=
633 --    pqp_pvd_shd.g_old_rec.private_use_contributions;
634 --  End If;
635   If (p_rec.market_value_classic_car = hr_api.g_number) then
639   If (p_rec.co2_emissions = hr_api.g_number) then
636     p_rec.market_value_classic_car :=
637     pqp_pvd_shd.g_old_rec.market_value_classic_car;
638   End If;
640     p_rec.co2_emissions :=
641     pqp_pvd_shd.g_old_rec.co2_emissions;
642   End If;
643   If (p_rec.vehicle_provider = hr_api.g_varchar2) then
644     p_rec.vehicle_provider :=
645     pqp_pvd_shd.g_old_rec.vehicle_provider;
646   End If;
647   If (p_rec.vehicle_identification_number = hr_api.g_varchar2) then
648     p_rec.vehicle_identification_number :=
649     pqp_pvd_shd.g_old_rec.vehicle_identification_number;
650   End If;
651   If (p_rec.vehicle_ownership = hr_api.g_varchar2) then
652     p_rec.vehicle_ownership :=
653     pqp_pvd_shd.g_old_rec.vehicle_ownership;
654   End If;
655   If (p_rec.vhd_attribute_category = hr_api.g_varchar2) then
656     p_rec.vhd_attribute_category :=
657     pqp_pvd_shd.g_old_rec.vhd_attribute_category;
658   End If;
659   If (p_rec.vhd_attribute1 = hr_api.g_varchar2) then
660     p_rec.vhd_attribute1 :=
661     pqp_pvd_shd.g_old_rec.vhd_attribute1;
662   End If;
663   If (p_rec.vhd_attribute2 = hr_api.g_varchar2) then
664     p_rec.vhd_attribute2 :=
665     pqp_pvd_shd.g_old_rec.vhd_attribute2;
666   End If;
667   If (p_rec.vhd_attribute3 = hr_api.g_varchar2) then
668     p_rec.vhd_attribute3 :=
669     pqp_pvd_shd.g_old_rec.vhd_attribute3;
670   End If;
671   If (p_rec.vhd_attribute4 = hr_api.g_varchar2) then
672     p_rec.vhd_attribute4 :=
673     pqp_pvd_shd.g_old_rec.vhd_attribute4;
674   End If;
675   If (p_rec.vhd_attribute5 = hr_api.g_varchar2) then
676     p_rec.vhd_attribute5 :=
677     pqp_pvd_shd.g_old_rec.vhd_attribute5;
678   End If;
679   If (p_rec.vhd_attribute6 = hr_api.g_varchar2) then
680     p_rec.vhd_attribute6 :=
681     pqp_pvd_shd.g_old_rec.vhd_attribute6;
682   End If;
683   If (p_rec.vhd_attribute7 = hr_api.g_varchar2) then
684     p_rec.vhd_attribute7 :=
685     pqp_pvd_shd.g_old_rec.vhd_attribute7;
686   End If;
687   If (p_rec.vhd_attribute8 = hr_api.g_varchar2) then
688     p_rec.vhd_attribute8 :=
689     pqp_pvd_shd.g_old_rec.vhd_attribute8;
690   End If;
691   If (p_rec.vhd_attribute9 = hr_api.g_varchar2) then
692     p_rec.vhd_attribute9 :=
693     pqp_pvd_shd.g_old_rec.vhd_attribute9;
694   End If;
695   If (p_rec.vhd_attribute10 = hr_api.g_varchar2) then
696     p_rec.vhd_attribute10 :=
697     pqp_pvd_shd.g_old_rec.vhd_attribute10;
698   End If;
699   If (p_rec.vhd_attribute11 = hr_api.g_varchar2) then
700     p_rec.vhd_attribute11 :=
701     pqp_pvd_shd.g_old_rec.vhd_attribute11;
702   End If;
703   If (p_rec.vhd_attribute12 = hr_api.g_varchar2) then
704     p_rec.vhd_attribute12 :=
705     pqp_pvd_shd.g_old_rec.vhd_attribute12;
706   End If;
707   If (p_rec.vhd_attribute13 = hr_api.g_varchar2) then
708     p_rec.vhd_attribute13 :=
709     pqp_pvd_shd.g_old_rec.vhd_attribute13;
710   End If;
711   If (p_rec.vhd_attribute14 = hr_api.g_varchar2) then
712     p_rec.vhd_attribute14 :=
713     pqp_pvd_shd.g_old_rec.vhd_attribute14;
714   End If;
715   If (p_rec.vhd_attribute15 = hr_api.g_varchar2) then
716     p_rec.vhd_attribute15 :=
717     pqp_pvd_shd.g_old_rec.vhd_attribute15;
718   End If;
719   If (p_rec.vhd_attribute16 = hr_api.g_varchar2) then
720     p_rec.vhd_attribute16 :=
721     pqp_pvd_shd.g_old_rec.vhd_attribute16;
722   End If;
723   If (p_rec.vhd_attribute17 = hr_api.g_varchar2) then
724     p_rec.vhd_attribute17 :=
725     pqp_pvd_shd.g_old_rec.vhd_attribute17;
726   End If;
727   If (p_rec.vhd_attribute18 = hr_api.g_varchar2) then
728     p_rec.vhd_attribute18 :=
729     pqp_pvd_shd.g_old_rec.vhd_attribute18;
730   End If;
731   If (p_rec.vhd_attribute19 = hr_api.g_varchar2) then
732     p_rec.vhd_attribute19 :=
733     pqp_pvd_shd.g_old_rec.vhd_attribute19;
734   End If;
735   If (p_rec.vhd_attribute20 = hr_api.g_varchar2) then
736     p_rec.vhd_attribute20 :=
737     pqp_pvd_shd.g_old_rec.vhd_attribute20;
738   End If;
739   If (p_rec.vhd_information_category = hr_api.g_varchar2) then
740     p_rec.vhd_information_category :=
741     pqp_pvd_shd.g_old_rec.vhd_information_category;
742   End If;
743   If (p_rec.vhd_information1 = hr_api.g_varchar2) then
744     p_rec.vhd_information1 :=
745     pqp_pvd_shd.g_old_rec.vhd_information1;
746   End If;
747   If (p_rec.vhd_information2 = hr_api.g_varchar2) then
748     p_rec.vhd_information2 :=
749     pqp_pvd_shd.g_old_rec.vhd_information2;
750   End If;
751   If (p_rec.vhd_information3 = hr_api.g_varchar2) then
752     p_rec.vhd_information3 :=
753     pqp_pvd_shd.g_old_rec.vhd_information3;
754   End If;
755   If (p_rec.vhd_information4 = hr_api.g_varchar2) then
756     p_rec.vhd_information4 :=
757     pqp_pvd_shd.g_old_rec.vhd_information4;
758   End If;
759   If (p_rec.vhd_information5 = hr_api.g_varchar2) then
760     p_rec.vhd_information5 :=
761     pqp_pvd_shd.g_old_rec.vhd_information5;
762   End If;
763   If (p_rec.vhd_information6 = hr_api.g_varchar2) then
764     p_rec.vhd_information6 :=
765     pqp_pvd_shd.g_old_rec.vhd_information6;
766   End If;
767   If (p_rec.vhd_information7 = hr_api.g_varchar2) then
768     p_rec.vhd_information7 :=
769     pqp_pvd_shd.g_old_rec.vhd_information7;
770   End If;
771   If (p_rec.vhd_information8 = hr_api.g_varchar2) then
772     p_rec.vhd_information8 :=
776     p_rec.vhd_information9 :=
773     pqp_pvd_shd.g_old_rec.vhd_information8;
774   End If;
775   If (p_rec.vhd_information9 = hr_api.g_varchar2) then
777     pqp_pvd_shd.g_old_rec.vhd_information9;
778   End If;
779   If (p_rec.vhd_information10 = hr_api.g_varchar2) then
780     p_rec.vhd_information10 :=
781     pqp_pvd_shd.g_old_rec.vhd_information10;
782   End If;
783   If (p_rec.vhd_information11 = hr_api.g_varchar2) then
784     p_rec.vhd_information11 :=
785     pqp_pvd_shd.g_old_rec.vhd_information11;
786   End If;
787   If (p_rec.vhd_information12 = hr_api.g_varchar2) then
788     p_rec.vhd_information12 :=
789     pqp_pvd_shd.g_old_rec.vhd_information12;
790   End If;
791   If (p_rec.vhd_information13 = hr_api.g_varchar2) then
792     p_rec.vhd_information13 :=
793     pqp_pvd_shd.g_old_rec.vhd_information13;
794   End If;
795   If (p_rec.vhd_information14 = hr_api.g_varchar2) then
796     p_rec.vhd_information14 :=
797     pqp_pvd_shd.g_old_rec.vhd_information14;
798   End If;
799   If (p_rec.vhd_information15 = hr_api.g_varchar2) then
800     p_rec.vhd_information15 :=
801     pqp_pvd_shd.g_old_rec.vhd_information15;
802   End If;
803   If (p_rec.vhd_information16 = hr_api.g_varchar2) then
804     p_rec.vhd_information16 :=
805     pqp_pvd_shd.g_old_rec.vhd_information16;
806   End If;
807   If (p_rec.vhd_information17 = hr_api.g_varchar2) then
808     p_rec.vhd_information17 :=
809     pqp_pvd_shd.g_old_rec.vhd_information17;
810   End If;
811   If (p_rec.vhd_information18 = hr_api.g_varchar2) then
812     p_rec.vhd_information18 :=
813     pqp_pvd_shd.g_old_rec.vhd_information18;
814   End If;
815   If (p_rec.vhd_information19 = hr_api.g_varchar2) then
816     p_rec.vhd_information19 :=
817     pqp_pvd_shd.g_old_rec.vhd_information19;
818   End If;
819   If (p_rec.vhd_information20 = hr_api.g_varchar2) then
820     p_rec.vhd_information20 :=
821     pqp_pvd_shd.g_old_rec.vhd_information20;
822   End If;
823   --
824 End convert_defs;
825 --
826 -- ----------------------------------------------------------------------------
827 -- |---------------------------------< upd >----------------------------------|
828 -- ----------------------------------------------------------------------------
829 Procedure upd
830   (p_effective_date               in date
831   ,p_rec                          in out nocopy pqp_pvd_shd.g_rec_type
832   ) is
833 --
834   l_proc  varchar2(72) := g_package||'upd';
835 --
836 Begin
837   hr_utility.set_location('Entering:'||l_proc, 5);
838   --
839   -- We must lock the row which we need to update.
840   --
841   pqp_pvd_shd.lck
842     (p_rec.vehicle_details_id
843     ,p_rec.object_version_number
844     );
845   --
846   -- 1. During an update system defaults are used to determine if
847   --    arguments have been defaulted or not. We must therefore
848   --    derive the full record structure values to be updated.
849   --
850   -- 2. Call the supporting update validate operations.
851   --
852   convert_defs(p_rec);
853   pqp_pvd_bus.update_validate
854      (p_effective_date
855      ,p_rec
856      );
857   --
858   -- Call the supporting pre-update operation
859   --
860   pqp_pvd_upd.pre_update(p_rec);
861   --
862   -- Update the row.
863   --
864   pqp_pvd_upd.update_dml(p_rec);
865   --
866   -- Call the supporting post-update operation
867   --
868   pqp_pvd_upd.post_update
869      (p_effective_date
870      ,p_rec
871      );
872 End upd;
873 --
874 -- ----------------------------------------------------------------------------
875 -- |---------------------------------< upd >----------------------------------|
876 -- ----------------------------------------------------------------------------
877 Procedure upd
878   (p_effective_date               in     date
879   ,p_vehicle_details_id           in     number
880   ,p_object_version_number        in out nocopy number
881   ,p_vehicle_type                 in     varchar2  default hr_api.g_varchar2
882   ,p_registration_number          in     varchar2  default hr_api.g_varchar2
883   ,p_make                         in     varchar2  default hr_api.g_varchar2
884   ,p_model                        in     varchar2  default hr_api.g_varchar2
885   ,p_date_first_registered        in     date      default hr_api.g_date
886   ,p_engine_capacity_in_cc        in     number    default hr_api.g_number
887   ,p_fuel_type                    in     varchar2  default hr_api.g_varchar2
888   ,p_fuel_card                    in     varchar2  default hr_api.g_varchar2
889   ,p_currency_code                in     varchar2  default hr_api.g_varchar2
890   ,p_list_price                   in     number    default hr_api.g_number
891   ,p_business_group_id            in     number    default hr_api.g_number
892   ,p_accessory_value_at_startdate in     number    default hr_api.g_number
893   ,p_accessory_value_added_later  in     number    default hr_api.g_number
894 --  ,p_capital_contributions        in     number    default hr_api.g_number
895 --  ,p_private_use_contributions    in     number    default hr_api.g_number
896   ,p_market_value_classic_car     in     number    default hr_api.g_number
897   ,p_co2_emissions                in     number    default hr_api.g_number
898   ,p_vehicle_provider             in     varchar2  default hr_api.g_varchar2
899   ,p_vehicle_identification_numbe in     varchar2  default hr_api.g_varchar2
900   ,p_vehicle_ownership            in     varchar2  default hr_api.g_varchar2
904   ,p_vhd_attribute3               in     varchar2  default hr_api.g_varchar2
901   ,p_vhd_attribute_category       in     varchar2  default hr_api.g_varchar2
902   ,p_vhd_attribute1               in     varchar2  default hr_api.g_varchar2
903   ,p_vhd_attribute2               in     varchar2  default hr_api.g_varchar2
905   ,p_vhd_attribute4               in     varchar2  default hr_api.g_varchar2
906   ,p_vhd_attribute5               in     varchar2  default hr_api.g_varchar2
907   ,p_vhd_attribute6               in     varchar2  default hr_api.g_varchar2
908   ,p_vhd_attribute7               in     varchar2  default hr_api.g_varchar2
909   ,p_vhd_attribute8               in     varchar2  default hr_api.g_varchar2
910   ,p_vhd_attribute9               in     varchar2  default hr_api.g_varchar2
911   ,p_vhd_attribute10              in     varchar2  default hr_api.g_varchar2
912   ,p_vhd_attribute11              in     varchar2  default hr_api.g_varchar2
913   ,p_vhd_attribute12              in     varchar2  default hr_api.g_varchar2
914   ,p_vhd_attribute13              in     varchar2  default hr_api.g_varchar2
915   ,p_vhd_attribute14              in     varchar2  default hr_api.g_varchar2
916   ,p_vhd_attribute15              in     varchar2  default hr_api.g_varchar2
917   ,p_vhd_attribute16              in     varchar2  default hr_api.g_varchar2
918   ,p_vhd_attribute17              in     varchar2  default hr_api.g_varchar2
919   ,p_vhd_attribute18              in     varchar2  default hr_api.g_varchar2
920   ,p_vhd_attribute19              in     varchar2  default hr_api.g_varchar2
921   ,p_vhd_attribute20              in     varchar2  default hr_api.g_varchar2
922   ,p_vhd_information_category     in     varchar2  default hr_api.g_varchar2
923   ,p_vhd_information1             in     varchar2  default hr_api.g_varchar2
924   ,p_vhd_information2             in     varchar2  default hr_api.g_varchar2
925   ,p_vhd_information3             in     varchar2  default hr_api.g_varchar2
926   ,p_vhd_information4             in     varchar2  default hr_api.g_varchar2
927   ,p_vhd_information5             in     varchar2  default hr_api.g_varchar2
928   ,p_vhd_information6             in     varchar2  default hr_api.g_varchar2
929   ,p_vhd_information7             in     varchar2  default hr_api.g_varchar2
930   ,p_vhd_information8             in     varchar2  default hr_api.g_varchar2
931   ,p_vhd_information9             in     varchar2  default hr_api.g_varchar2
932   ,p_vhd_information10            in     varchar2  default hr_api.g_varchar2
933   ,p_vhd_information11            in     varchar2  default hr_api.g_varchar2
934   ,p_vhd_information12            in     varchar2  default hr_api.g_varchar2
935   ,p_vhd_information13            in     varchar2  default hr_api.g_varchar2
936   ,p_vhd_information14            in     varchar2  default hr_api.g_varchar2
937   ,p_vhd_information15            in     varchar2  default hr_api.g_varchar2
938   ,p_vhd_information16            in     varchar2  default hr_api.g_varchar2
939   ,p_vhd_information17            in     varchar2  default hr_api.g_varchar2
940   ,p_vhd_information18            in     varchar2  default hr_api.g_varchar2
941   ,p_vhd_information19            in     varchar2  default hr_api.g_varchar2
942   ,p_vhd_information20            in     varchar2  default hr_api.g_varchar2
943   ) is
944 --
945   l_rec	  pqp_pvd_shd.g_rec_type;
946   l_proc  varchar2(72) := g_package||'upd';
947 --
948 Begin
949   hr_utility.set_location('Entering:'||l_proc, 5);
950   --
951   -- Call conversion function to turn arguments into the
952   -- l_rec structure.
953   --
954   l_rec :=
955   pqp_pvd_shd.convert_args
956   (p_vehicle_details_id
957   ,p_vehicle_type
958   ,p_business_group_id
959   ,p_registration_number
960   ,p_make
961   ,p_model
962   ,p_date_first_registered
963   ,p_engine_capacity_in_cc
964   ,p_fuel_type
965   ,p_fuel_card
966   ,p_currency_code
967   ,p_list_price
968   ,p_accessory_value_at_startdate
969   ,p_accessory_value_added_later
970 --  ,p_capital_contributions
971 --  ,p_private_use_contributions
972   ,p_market_value_classic_car
973   ,p_co2_emissions
974   ,p_vehicle_provider
975   ,p_object_version_number
976   ,p_vehicle_identification_numbe
977   ,p_vehicle_ownership
978   ,p_vhd_attribute_category
979   ,p_vhd_attribute1
980   ,p_vhd_attribute2
981   ,p_vhd_attribute3
982   ,p_vhd_attribute4
983   ,p_vhd_attribute5
984   ,p_vhd_attribute6
985   ,p_vhd_attribute7
986   ,p_vhd_attribute8
987   ,p_vhd_attribute9
988   ,p_vhd_attribute10
989   ,p_vhd_attribute11
990   ,p_vhd_attribute12
991   ,p_vhd_attribute13
992   ,p_vhd_attribute14
993   ,p_vhd_attribute15
994   ,p_vhd_attribute16
995   ,p_vhd_attribute17
996   ,p_vhd_attribute18
997   ,p_vhd_attribute19
998   ,p_vhd_attribute20
999   ,p_vhd_information_category
1000   ,p_vhd_information1
1001   ,p_vhd_information2
1002   ,p_vhd_information3
1003   ,p_vhd_information4
1004   ,p_vhd_information5
1005   ,p_vhd_information6
1006   ,p_vhd_information7
1007   ,p_vhd_information8
1008   ,p_vhd_information9
1009   ,p_vhd_information10
1010   ,p_vhd_information11
1011   ,p_vhd_information12
1012   ,p_vhd_information13
1013   ,p_vhd_information14
1014   ,p_vhd_information15
1015   ,p_vhd_information16
1016   ,p_vhd_information17
1017   ,p_vhd_information18
1018   ,p_vhd_information19
1019   ,p_vhd_information20
1020   );
1021   --
1022   -- Having converted the arguments into the
1023   -- plsql record structure we call the corresponding record
1024   -- business process.
1025   --
1026   pqp_pvd_upd.upd
1027      (p_effective_date
1028      ,l_rec
1029      );
1030   p_object_version_number := l_rec.object_version_number;
1031   --
1032   hr_utility.set_location(' Leaving:'||l_proc, 10);
1033 End upd;
1034 --
1035 end pqp_pvd_upd;