DBA Data[Home] [Help]

PACKAGE BODY: APPS.OTA_TMT_UPD

Source


1 Package Body ota_tmt_upd as
2 /* $Header: ottmtrhi.pkb 115.6 2002/11/26 17:09:48 hwinsor noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ota_tmt_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 ota_tmt_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   --
67   --
68   -- Update the ota_tp_measurement_types Row
69   --
70   update ota_tp_measurement_types
71     set
72      tp_measurement_type_id          = p_rec.tp_measurement_type_id
73     ,unit                            = p_rec.unit
74     ,reporting_sequence              = p_rec.reporting_sequence
75     ,budget_level                    = p_rec.budget_level
76     ,cost_level                      = p_rec.cost_level
77     ,many_budget_values_flag         = p_rec.many_budget_values_flag
78     ,item_type_usage_id              = p_rec.item_type_usage_id
79     ,object_version_number           = p_rec.object_version_number
80     ,attribute_category              = p_rec.attribute_category
81     ,attribute1                      = p_rec.attribute1
82     ,attribute2                      = p_rec.attribute2
83     ,attribute3                      = p_rec.attribute3
84     ,attribute4                      = p_rec.attribute4
85     ,attribute5                      = p_rec.attribute5
86     ,attribute6                      = p_rec.attribute6
87     ,attribute7                      = p_rec.attribute7
88     ,attribute8                      = p_rec.attribute8
89     ,attribute9                      = p_rec.attribute9
90     ,attribute10                     = p_rec.attribute10
91     ,attribute11                     = p_rec.attribute11
92     ,attribute12                     = p_rec.attribute12
93     ,attribute13                     = p_rec.attribute13
94     ,attribute14                     = p_rec.attribute14
95     ,attribute15                     = p_rec.attribute15
96     ,attribute16                     = p_rec.attribute16
97     ,attribute17                     = p_rec.attribute17
98     ,attribute18                     = p_rec.attribute18
99     ,attribute19                     = p_rec.attribute19
100     ,attribute20                     = p_rec.attribute20
101     ,attribute21                     = p_rec.attribute21
102     ,attribute22                     = p_rec.attribute22
103     ,attribute23                     = p_rec.attribute23
104     ,attribute24                     = p_rec.attribute24
105     ,attribute25                     = p_rec.attribute25
106     ,attribute26                     = p_rec.attribute26
107     ,attribute27                     = p_rec.attribute27
108     ,attribute28                     = p_rec.attribute28
109     ,attribute29                     = p_rec.attribute29
110     ,attribute30                     = p_rec.attribute30
111     where tp_measurement_type_id = p_rec.tp_measurement_type_id;
112   --
113   --
114   --
115   hr_utility.set_location(' Leaving:'||l_proc, 10);
116 --
117 Exception
118   When hr_api.check_integrity_violated Then
119     -- A check constraint has been violated
120     --
121     ota_tmt_shd.constraint_error
122       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
123   When hr_api.parent_integrity_violated Then
124     -- Parent integrity has been violated
125     --
126     ota_tmt_shd.constraint_error
127       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
128   When hr_api.unique_integrity_violated Then
129     -- Unique integrity has been violated
130     --
131     ota_tmt_shd.constraint_error
132       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
133   When Others Then
134     --
135     Raise;
136 End update_dml;
137 --
138 -- ----------------------------------------------------------------------------
139 -- |------------------------------< pre_update >------------------------------|
140 -- ----------------------------------------------------------------------------
141 -- {Start Of Comments}
142 --
143 -- Description:
144 --   This private procedure contains any processing which is required before
145 --   the update dml.
146 --
147 -- Prerequisites:
148 --   This is an internal procedure which is called from the upd procedure.
149 --
150 -- In Parameters:
151 --   A Pl/Sql record structure.
152 --
153 -- Post Success:
154 --   Processing continues.
155 --
156 -- Post Failure:
157 --   If an error has occurred, an error message and exception wil be raised
158 --   but not handled.
159 --
160 -- Developer Implementation Notes:
161 --   Any pre-processing required before the update dml is issued should be
162 --   coded within this procedure. It is important to note that any 3rd party
163 --   maintenance should be reviewed before placing in this procedure.
164 --
165 -- Access Status:
166 --   Internal Row Handler Use Only.
167 --
168 -- {End Of Comments}
169 -- ----------------------------------------------------------------------------
170 Procedure pre_update
171   (p_rec in ota_tmt_shd.g_rec_type
172   ) is
173 --
174   l_proc  varchar2(72) := g_package||'pre_update';
175 --
176 Begin
177   hr_utility.set_location('Entering:'||l_proc, 5);
178   --
179   hr_utility.set_location(' Leaving:'||l_proc, 10);
180 End pre_update;
181 --
182 -- ----------------------------------------------------------------------------
183 -- |-----------------------------< post_update >------------------------------|
184 -- ----------------------------------------------------------------------------
185 -- {Start Of Comments}
186 --
187 -- Description:
188 --   This private procedure contains any processing which is required after the
189 --   update dml.
190 --
191 -- Prerequisites:
192 --   This is an internal procedure which is called from the upd procedure.
193 --
194 -- In Parameters:
195 --   A Pl/Sql record structure.
196 --
197 -- Post Success:
198 --   Processing continues.
199 --
200 -- Post Failure:
201 --   If an error has occurred, an error message and exception will be raised
202 --   but not handled.
203 --
204 -- Developer Implementation Notes:
205 --   Any post-processing required after the update dml is issued should be
206 --   coded within this procedure. It is important to note that any 3rd party
207 --   maintenance should be reviewed before placing in this procedure.
208 --
209 -- Access Status:
210 --   Internal Row Handler Use Only.
211 --
212 -- {End Of Comments}
213 -- ----------------------------------------------------------------------------
214 Procedure post_update
215   (p_effective_date               in date
216   ,p_rec                          in ota_tmt_shd.g_rec_type
217   ) is
218 --
219   l_proc  varchar2(72) := g_package||'post_update';
220 --
221 Begin
222   hr_utility.set_location('Entering:'||l_proc, 5);
223   begin
224     --
225     ota_tmt_rku.after_update
226       (p_effective_date              => p_effective_date
227       ,p_tp_measurement_type_id
228       => p_rec.tp_measurement_type_id
229       ,p_tp_measurement_code
230       => p_rec.tp_measurement_code
231       ,p_unit
232       => p_rec.unit
233       ,p_reporting_sequence
234       => p_rec.reporting_sequence
235       ,p_budget_level
236       => p_rec.budget_level
237       ,p_cost_level
238       => p_rec.cost_level
239       ,p_many_budget_values_flag
240       => p_rec.many_budget_values_flag
241       ,p_item_type_usage_id
242       => p_rec.item_type_usage_id
243       ,p_business_group_id
244       => p_rec.business_group_id
245       ,p_object_version_number
246       => p_rec.object_version_number
247       ,p_attribute_category
248       => p_rec.attribute_category
249       ,p_attribute1
250       => p_rec.attribute1
251       ,p_attribute2
252       => p_rec.attribute2
253       ,p_attribute3
254       => p_rec.attribute3
255       ,p_attribute4
256       => p_rec.attribute4
257       ,p_attribute5
258       => p_rec.attribute5
259       ,p_attribute6
260       => p_rec.attribute6
261       ,p_attribute7
262       => p_rec.attribute7
263       ,p_attribute8
264       => p_rec.attribute8
265       ,p_attribute9
266       => p_rec.attribute9
267       ,p_attribute10
268       => p_rec.attribute10
269       ,p_attribute11
270       => p_rec.attribute11
271       ,p_attribute12
272       => p_rec.attribute12
273       ,p_attribute13
274       => p_rec.attribute13
275       ,p_attribute14
276       => p_rec.attribute14
277       ,p_attribute15
278       => p_rec.attribute15
279       ,p_attribute16
280       => p_rec.attribute16
281       ,p_attribute17
282       => p_rec.attribute17
283       ,p_attribute18
284       => p_rec.attribute18
285       ,p_attribute19
286       => p_rec.attribute19
287       ,p_attribute20
288       => p_rec.attribute20
289       ,p_attribute21
290       => p_rec.attribute21
291       ,p_attribute22
292       => p_rec.attribute22
293       ,p_attribute23
294       => p_rec.attribute23
295       ,p_attribute24
296       => p_rec.attribute24
297       ,p_attribute25
298       => p_rec.attribute25
299       ,p_attribute26
300       => p_rec.attribute26
301       ,p_attribute27
302       => p_rec.attribute27
303       ,p_attribute28
304       => p_rec.attribute28
305       ,p_attribute29
306       => p_rec.attribute29
307       ,p_attribute30
308       => p_rec.attribute30
309       ,p_tp_measurement_code_o
310       => ota_tmt_shd.g_old_rec.tp_measurement_code
311       ,p_unit_o
312       => ota_tmt_shd.g_old_rec.unit
313       ,p_reporting_sequence_o
314       => ota_tmt_shd.g_old_rec.reporting_sequence
315       ,p_budget_level_o
316       => ota_tmt_shd.g_old_rec.budget_level
317       ,p_cost_level_o
318       => ota_tmt_shd.g_old_rec.cost_level
319       ,p_many_budget_values_flag_o
320       => ota_tmt_shd.g_old_rec.many_budget_values_flag
321       ,p_item_type_usage_id_o
322       => ota_tmt_shd.g_old_rec.item_type_usage_id
323       ,p_business_group_id_o
324       => ota_tmt_shd.g_old_rec.business_group_id
325       ,p_object_version_number_o
326       => ota_tmt_shd.g_old_rec.object_version_number
327       ,p_attribute_category_o
328       => ota_tmt_shd.g_old_rec.attribute_category
329       ,p_attribute1_o
330       => ota_tmt_shd.g_old_rec.attribute1
331       ,p_attribute2_o
332       => ota_tmt_shd.g_old_rec.attribute2
333       ,p_attribute3_o
334       => ota_tmt_shd.g_old_rec.attribute3
335       ,p_attribute4_o
336       => ota_tmt_shd.g_old_rec.attribute4
337       ,p_attribute5_o
338       => ota_tmt_shd.g_old_rec.attribute5
339       ,p_attribute6_o
340       => ota_tmt_shd.g_old_rec.attribute6
341       ,p_attribute7_o
342       => ota_tmt_shd.g_old_rec.attribute7
343       ,p_attribute8_o
344       => ota_tmt_shd.g_old_rec.attribute8
345       ,p_attribute9_o
346       => ota_tmt_shd.g_old_rec.attribute9
347       ,p_attribute10_o
348       => ota_tmt_shd.g_old_rec.attribute10
349       ,p_attribute11_o
350       => ota_tmt_shd.g_old_rec.attribute11
351       ,p_attribute12_o
352       => ota_tmt_shd.g_old_rec.attribute12
353       ,p_attribute13_o
354       => ota_tmt_shd.g_old_rec.attribute13
355       ,p_attribute14_o
356       => ota_tmt_shd.g_old_rec.attribute14
357       ,p_attribute15_o
358       => ota_tmt_shd.g_old_rec.attribute15
359       ,p_attribute16_o
360       => ota_tmt_shd.g_old_rec.attribute16
361       ,p_attribute17_o
362       => ota_tmt_shd.g_old_rec.attribute17
363       ,p_attribute18_o
364       => ota_tmt_shd.g_old_rec.attribute18
365       ,p_attribute19_o
366       => ota_tmt_shd.g_old_rec.attribute19
367       ,p_attribute20_o
368       => ota_tmt_shd.g_old_rec.attribute20
369       ,p_attribute21_o
370       => ota_tmt_shd.g_old_rec.attribute21
371       ,p_attribute22_o
372       => ota_tmt_shd.g_old_rec.attribute22
373       ,p_attribute23_o
374       => ota_tmt_shd.g_old_rec.attribute23
375       ,p_attribute24_o
376       => ota_tmt_shd.g_old_rec.attribute24
377       ,p_attribute25_o
378       => ota_tmt_shd.g_old_rec.attribute25
379       ,p_attribute26_o
380       => ota_tmt_shd.g_old_rec.attribute26
381       ,p_attribute27_o
382       => ota_tmt_shd.g_old_rec.attribute27
383       ,p_attribute28_o
384       => ota_tmt_shd.g_old_rec.attribute28
385       ,p_attribute29_o
386       => ota_tmt_shd.g_old_rec.attribute29
387       ,p_attribute30_o
388       => ota_tmt_shd.g_old_rec.attribute30
389       );
390     --
391   exception
392     --
393     when hr_api.cannot_find_prog_unit then
394       --
395       hr_api.cannot_find_prog_unit_error
396         (p_module_name => 'OTA_TP_MEASUREMENT_TYPES'
397         ,p_hook_type   => 'AU');
398       --
399   end;
400   --
401   hr_utility.set_location(' Leaving:'||l_proc, 10);
402 End post_update;
403 --
404 -- ----------------------------------------------------------------------------
405 -- |-----------------------------< convert_defs >-----------------------------|
406 -- ----------------------------------------------------------------------------
407 -- {Start Of Comments}
408 --
409 -- Description:
410 --   The Convert_Defs procedure has one very important function:
411 --   It must return the record structure for the row with all system defaulted
412 --   values converted into its corresponding parameter value for update. When
413 --   we attempt to update a row through the Upd process , certain
414 --   parameters can be defaulted which enables flexibility in the calling of
415 --   the upd process (e.g. only attributes which need to be updated need to be
416 --   specified). For the upd process to determine which attributes
417 --   have NOT been specified we need to check if the parameter has a reserved
418 --   system default value. Therefore, for all parameters which have a
419 --   corresponding reserved system default mechanism specified we need to
420 --   check if a system default is being used. If a system default is being
421 --   used then we convert the defaulted value into its corresponding attribute
422 --   value held in the g_old_rec data structure.
423 --
424 -- Prerequisites:
425 --   This private function can only be called from the upd process.
426 --
427 -- In Parameters:
428 --   A Pl/Sql record structure.
429 --
430 -- Post Success:
431 --   The record structure will be returned with all system defaulted parameter
432 --   values converted into its current row attribute value.
433 --
434 -- Post Failure:
435 --   No direct error handling is required within this function. Any possible
436 --   errors within this procedure will be a PL/SQL value error due to
437 --   conversion of datatypes or data lengths.
438 --
439 -- Developer Implementation Notes:
440 --   None.
441 --
442 -- Access Status:
443 --   Internal Row Handler Use Only.
444 --
445 -- {End Of Comments}
446 -- ----------------------------------------------------------------------------
447 Procedure convert_defs
448   (p_rec in out nocopy ota_tmt_shd.g_rec_type
449   ) is
450 --
451 Begin
452   --
453   -- We must now examine each argument value in the
454   -- p_rec plsql record structure
455   -- to see if a system default is being used. If a system default
456   -- is being used then we must set to the 'current' argument value.
457   --
458   If (p_rec.tp_measurement_code = hr_api.g_varchar2) then
459     p_rec.tp_measurement_code :=
460     ota_tmt_shd.g_old_rec.tp_measurement_code;
461   End If;
462   If (p_rec.unit = hr_api.g_varchar2) then
463     p_rec.unit :=
464     ota_tmt_shd.g_old_rec.unit;
465   End If;
466   If (p_rec.reporting_sequence = hr_api.g_number) then
467     p_rec.reporting_sequence :=
468     ota_tmt_shd.g_old_rec.reporting_sequence;
469   End If;
470   If (p_rec.budget_level = hr_api.g_varchar2) then
471     p_rec.budget_level :=
472     ota_tmt_shd.g_old_rec.budget_level;
473   End If;
474   If (p_rec.cost_level = hr_api.g_varchar2) then
475     p_rec.cost_level :=
476     ota_tmt_shd.g_old_rec.cost_level;
477   End If;
478   If (p_rec.many_budget_values_flag = hr_api.g_varchar2) then
479     p_rec.many_budget_values_flag :=
480     ota_tmt_shd.g_old_rec.many_budget_values_flag;
481   End If;
482   If (p_rec.item_type_usage_id = hr_api.g_number) then
483     p_rec.item_type_usage_id :=
484     ota_tmt_shd.g_old_rec.item_type_usage_id;
485   End If;
486   If (p_rec.business_group_id = hr_api.g_number) then
487     p_rec.business_group_id :=
488     ota_tmt_shd.g_old_rec.business_group_id;
489   End If;
490   If (p_rec.attribute_category = hr_api.g_varchar2) then
491     p_rec.attribute_category :=
492     ota_tmt_shd.g_old_rec.attribute_category;
493   End If;
494   If (p_rec.attribute1 = hr_api.g_varchar2) then
495     p_rec.attribute1 :=
496     ota_tmt_shd.g_old_rec.attribute1;
497   End If;
498   If (p_rec.attribute2 = hr_api.g_varchar2) then
499     p_rec.attribute2 :=
500     ota_tmt_shd.g_old_rec.attribute2;
501   End If;
502   If (p_rec.attribute3 = hr_api.g_varchar2) then
503     p_rec.attribute3 :=
504     ota_tmt_shd.g_old_rec.attribute3;
505   End If;
506   If (p_rec.attribute4 = hr_api.g_varchar2) then
507     p_rec.attribute4 :=
508     ota_tmt_shd.g_old_rec.attribute4;
509   End If;
510   If (p_rec.attribute5 = hr_api.g_varchar2) then
511     p_rec.attribute5 :=
512     ota_tmt_shd.g_old_rec.attribute5;
513   End If;
514   If (p_rec.attribute6 = hr_api.g_varchar2) then
515     p_rec.attribute6 :=
516     ota_tmt_shd.g_old_rec.attribute6;
517   End If;
518   If (p_rec.attribute7 = hr_api.g_varchar2) then
519     p_rec.attribute7 :=
520     ota_tmt_shd.g_old_rec.attribute7;
521   End If;
522   If (p_rec.attribute8 = hr_api.g_varchar2) then
523     p_rec.attribute8 :=
524     ota_tmt_shd.g_old_rec.attribute8;
525   End If;
526   If (p_rec.attribute9 = hr_api.g_varchar2) then
527     p_rec.attribute9 :=
528     ota_tmt_shd.g_old_rec.attribute9;
529   End If;
530   If (p_rec.attribute10 = hr_api.g_varchar2) then
531     p_rec.attribute10 :=
532     ota_tmt_shd.g_old_rec.attribute10;
533   End If;
534   If (p_rec.attribute11 = hr_api.g_varchar2) then
535     p_rec.attribute11 :=
536     ota_tmt_shd.g_old_rec.attribute11;
537   End If;
538   If (p_rec.attribute12 = hr_api.g_varchar2) then
539     p_rec.attribute12 :=
540     ota_tmt_shd.g_old_rec.attribute12;
541   End If;
542   If (p_rec.attribute13 = hr_api.g_varchar2) then
543     p_rec.attribute13 :=
544     ota_tmt_shd.g_old_rec.attribute13;
545   End If;
546   If (p_rec.attribute14 = hr_api.g_varchar2) then
547     p_rec.attribute14 :=
548     ota_tmt_shd.g_old_rec.attribute14;
549   End If;
550   If (p_rec.attribute15 = hr_api.g_varchar2) then
551     p_rec.attribute15 :=
552     ota_tmt_shd.g_old_rec.attribute15;
553   End If;
554   If (p_rec.attribute16 = hr_api.g_varchar2) then
555     p_rec.attribute16 :=
556     ota_tmt_shd.g_old_rec.attribute16;
557   End If;
558   If (p_rec.attribute17 = hr_api.g_varchar2) then
559     p_rec.attribute17 :=
560     ota_tmt_shd.g_old_rec.attribute17;
561   End If;
562   If (p_rec.attribute18 = hr_api.g_varchar2) then
563     p_rec.attribute18 :=
564     ota_tmt_shd.g_old_rec.attribute18;
565   End If;
566   If (p_rec.attribute19 = hr_api.g_varchar2) then
567     p_rec.attribute19 :=
568     ota_tmt_shd.g_old_rec.attribute19;
569   End If;
570   If (p_rec.attribute20 = hr_api.g_varchar2) then
571     p_rec.attribute20 :=
572     ota_tmt_shd.g_old_rec.attribute20;
573   End If;
574   If (p_rec.attribute21 = hr_api.g_varchar2) then
575     p_rec.attribute21 :=
576     ota_tmt_shd.g_old_rec.attribute21;
577   End If;
578   If (p_rec.attribute22 = hr_api.g_varchar2) then
579     p_rec.attribute22 :=
580     ota_tmt_shd.g_old_rec.attribute22;
581   End If;
582   If (p_rec.attribute23 = hr_api.g_varchar2) then
583     p_rec.attribute23 :=
584     ota_tmt_shd.g_old_rec.attribute23;
585   End If;
586   If (p_rec.attribute24 = hr_api.g_varchar2) then
587     p_rec.attribute24 :=
588     ota_tmt_shd.g_old_rec.attribute24;
589   End If;
590   If (p_rec.attribute25 = hr_api.g_varchar2) then
591     p_rec.attribute25 :=
592     ota_tmt_shd.g_old_rec.attribute25;
593   End If;
594   If (p_rec.attribute26 = hr_api.g_varchar2) then
595     p_rec.attribute26 :=
596     ota_tmt_shd.g_old_rec.attribute26;
597   End If;
598   If (p_rec.attribute27 = hr_api.g_varchar2) then
599     p_rec.attribute27 :=
600     ota_tmt_shd.g_old_rec.attribute27;
601   End If;
602   If (p_rec.attribute28 = hr_api.g_varchar2) then
603     p_rec.attribute28 :=
604     ota_tmt_shd.g_old_rec.attribute28;
605   End If;
606   If (p_rec.attribute29 = hr_api.g_varchar2) then
607     p_rec.attribute29 :=
608     ota_tmt_shd.g_old_rec.attribute29;
609   End If;
610   If (p_rec.attribute30 = hr_api.g_varchar2) then
611     p_rec.attribute30 :=
612     ota_tmt_shd.g_old_rec.attribute30;
613   End If;
614   --
615 End convert_defs;
616 --
617 -- ----------------------------------------------------------------------------
618 -- |---------------------------------< upd >----------------------------------|
619 -- ----------------------------------------------------------------------------
620 Procedure upd
621   (p_effective_date               in date
622   ,p_rec                          in out nocopy ota_tmt_shd.g_rec_type
623   ) is
624 --
625   l_proc  varchar2(72) := g_package||'upd';
626 --
627 Begin
628   hr_utility.set_location('Entering:'||l_proc, 5);
629   --
630   -- We must lock the row which we need to update.
631   --
632   ota_tmt_shd.lck
633     (p_rec.tp_measurement_type_id
634     ,p_rec.object_version_number
635     );
636   --
637   -- 1. During an update system defaults are used to determine if
638   --    arguments have been defaulted or not. We must therefore
639   --    derive the full record structure values to be updated.
640   --
641   -- 2. Call the supporting update validate operations.
642   --
643   convert_defs(p_rec);
644   ota_tmt_bus.update_validate
645      (p_effective_date
646      ,p_rec
647      );
648   --
649   -- Call the supporting pre-update operation
650   --
651   ota_tmt_upd.pre_update(p_rec);
652   --
653   -- Update the row.
654   --
655   ota_tmt_upd.update_dml(p_rec);
656   --
657   -- Call the supporting post-update operation
658   --
659   ota_tmt_upd.post_update
660      (p_effective_date
661      ,p_rec
662      );
663 End upd;
664 --
665 -- ----------------------------------------------------------------------------
666 -- |---------------------------------< upd >----------------------------------|
667 -- ----------------------------------------------------------------------------
668 Procedure upd
669   (p_effective_date               in     date
670   ,p_tp_measurement_type_id       in     number
671   ,p_object_version_number        in out nocopy number
672   ,p_unit                         in     varchar2  default hr_api.g_varchar2
673   ,p_budget_level                 in     varchar2  default hr_api.g_varchar2
674   ,p_cost_level                   in     varchar2  default hr_api.g_varchar2
675   ,p_many_budget_values_flag      in     varchar2  default hr_api.g_varchar2
676   ,p_reporting_sequence           in     number    default hr_api.g_number
677   ,p_item_type_usage_id           in     number    default hr_api.g_number
678   ,p_attribute_category           in     varchar2  default hr_api.g_varchar2
679   ,p_attribute1                   in     varchar2  default hr_api.g_varchar2
680   ,p_attribute2                   in     varchar2  default hr_api.g_varchar2
681   ,p_attribute3                   in     varchar2  default hr_api.g_varchar2
682   ,p_attribute4                   in     varchar2  default hr_api.g_varchar2
683   ,p_attribute5                   in     varchar2  default hr_api.g_varchar2
684   ,p_attribute6                   in     varchar2  default hr_api.g_varchar2
685   ,p_attribute7                   in     varchar2  default hr_api.g_varchar2
686   ,p_attribute8                   in     varchar2  default hr_api.g_varchar2
687   ,p_attribute9                   in     varchar2  default hr_api.g_varchar2
688   ,p_attribute10                  in     varchar2  default hr_api.g_varchar2
689   ,p_attribute11                  in     varchar2  default hr_api.g_varchar2
690   ,p_attribute12                  in     varchar2  default hr_api.g_varchar2
691   ,p_attribute13                  in     varchar2  default hr_api.g_varchar2
692   ,p_attribute14                  in     varchar2  default hr_api.g_varchar2
693   ,p_attribute15                  in     varchar2  default hr_api.g_varchar2
694   ,p_attribute16                  in     varchar2  default hr_api.g_varchar2
695   ,p_attribute17                  in     varchar2  default hr_api.g_varchar2
696   ,p_attribute18                  in     varchar2  default hr_api.g_varchar2
697   ,p_attribute19                  in     varchar2  default hr_api.g_varchar2
698   ,p_attribute20                  in     varchar2  default hr_api.g_varchar2
699   ,p_attribute21                  in     varchar2  default hr_api.g_varchar2
700   ,p_attribute22                  in     varchar2  default hr_api.g_varchar2
701   ,p_attribute23                  in     varchar2  default hr_api.g_varchar2
702   ,p_attribute24                  in     varchar2  default hr_api.g_varchar2
703   ,p_attribute25                  in     varchar2  default hr_api.g_varchar2
704   ,p_attribute26                  in     varchar2  default hr_api.g_varchar2
705   ,p_attribute27                  in     varchar2  default hr_api.g_varchar2
706   ,p_attribute28                  in     varchar2  default hr_api.g_varchar2
707   ,p_attribute29                  in     varchar2  default hr_api.g_varchar2
708   ,p_attribute30                  in     varchar2  default hr_api.g_varchar2
709   ) is
710 --
711   l_rec	  ota_tmt_shd.g_rec_type;
712   l_proc  varchar2(72) := g_package||'upd';
713 --
714 Begin
715   hr_utility.set_location('Entering:'||l_proc, 5);
716   --
717   -- Call conversion function to turn arguments into the
718   -- l_rec structure.
719   --
720   l_rec :=
721   ota_tmt_shd.convert_args
722   (p_tp_measurement_type_id
723   ,hr_api.g_varchar2
724   ,p_unit
725   ,p_reporting_sequence
726   ,p_budget_level
727   ,p_cost_level
728   ,p_many_budget_values_flag
729   ,p_item_type_usage_id
730   ,hr_api.g_number
731   ,p_object_version_number
732   ,p_attribute_category
733   ,p_attribute1
734   ,p_attribute2
735   ,p_attribute3
736   ,p_attribute4
737   ,p_attribute5
738   ,p_attribute6
739   ,p_attribute7
740   ,p_attribute8
741   ,p_attribute9
742   ,p_attribute10
743   ,p_attribute11
744   ,p_attribute12
745   ,p_attribute13
746   ,p_attribute14
747   ,p_attribute15
748   ,p_attribute16
749   ,p_attribute17
750   ,p_attribute18
751   ,p_attribute19
752   ,p_attribute20
753   ,p_attribute21
754   ,p_attribute22
755   ,p_attribute23
756   ,p_attribute24
757   ,p_attribute25
758   ,p_attribute26
759   ,p_attribute27
760   ,p_attribute28
761   ,p_attribute29
762   ,p_attribute30
763   );
764   --
765   -- Having converted the arguments into the
766   -- plsql record structure we call the corresponding record
767   -- business process.
768   --
769   hr_utility.set_location(' Step:'||l_proc, 7);
770   ota_tmt_upd.upd
771      (p_effective_date
772      ,l_rec
773      );
774   p_object_version_number := l_rec.object_version_number;
775   --
776   hr_utility.set_location(' Leaving:'||l_proc, 10);
777 End upd;
778 --
779 end ota_tmt_upd;