DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_EST_UPD

Source


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