DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_PHN_UPD

Source


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