DBA Data[Home] [Help]

PACKAGE BODY: APPS.PQH_REI_UPD

Source


1 Package Body pqh_rei_upd as
2 /* $Header: pqreirhi.pkb 115.3 2002/12/03 20:42:51 rpasapul noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  pqh_rei_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 pqh_rei_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 pqh_role_extra_info Row
69   --
70   update pqh_role_extra_info
71     set
72      role_extra_info_id              = p_rec.role_extra_info_id
73     ,role_id                         = p_rec.role_id
74     ,information_type                = p_rec.information_type
75     ,request_id                      = p_rec.request_id
76     ,program_application_id          = p_rec.program_application_id
77     ,program_id                      = p_rec.program_id
78     ,program_update_date             = p_rec.program_update_date
79     ,attribute_category         = p_rec.attribute_category
80     ,attribute1                 = p_rec.attribute1
81     ,attribute2                 = p_rec.attribute2
82     ,attribute3                 = p_rec.attribute3
83     ,attribute4                 = p_rec.attribute4
84     ,attribute5                 = p_rec.attribute5
85     ,attribute6                 = p_rec.attribute6
86     ,attribute7                 = p_rec.attribute7
87     ,attribute8                 = p_rec.attribute8
88     ,attribute9                 = p_rec.attribute9
89     ,attribute10                = p_rec.attribute10
90     ,attribute11                = p_rec.attribute11
91     ,attribute12                = p_rec.attribute12
92     ,attribute13                = p_rec.attribute13
93     ,attribute14                = p_rec.attribute14
94     ,attribute15                = p_rec.attribute15
95     ,attribute16                = p_rec.attribute16
96     ,attribute17                = p_rec.attribute17
97     ,attribute18                = p_rec.attribute18
98     ,attribute19                = p_rec.attribute19
99     ,attribute20                = p_rec.attribute20
100     ,attribute21     	 	= p_rec.attribute21
101     ,attribute22     	 	= p_rec.attribute22
102     ,attribute23     	 	= p_rec.attribute23
103     ,attribute24     	 	= p_rec.attribute24
104     ,attribute25     	 	= p_rec.attribute25
105     ,attribute26     		= p_rec.attribute26
106     ,attribute27     		= p_rec.attribute27
107     ,attribute28     		= p_rec.attribute28
108     ,attribute29     		= p_rec.attribute29
109     ,attribute30     		= p_rec.attribute30
110     ,information_category       = p_rec.information_category
111     ,information1               = p_rec.information1
112     ,information2               = p_rec.information2
113     ,information3               = p_rec.information3
114     ,information4               = p_rec.information4
115     ,information5               = p_rec.information5
116     ,information6               = p_rec.information6
117     ,information7               = p_rec.information7
118     ,information8               = p_rec.information8
119     ,information9               = p_rec.information9
120     ,information10              = p_rec.information10
121     ,information11              = p_rec.information11
122     ,information12              = p_rec.information12
123     ,information13              = p_rec.information13
124     ,information14              = p_rec.information14
125     ,information15              = p_rec.information15
126     ,information16              = p_rec.information16
127     ,information17              = p_rec.information17
128     ,information18              = p_rec.information18
129     ,information19              = p_rec.information19
130     ,information20              = p_rec.information20
131     ,information21              = p_rec.information21
132     ,information22              = p_rec.information22
133     ,information23              = p_rec.information23
134     ,information24              = p_rec.information24
135     ,information25              = p_rec.information25
136     ,information26              = p_rec.information26
137     ,information27              = p_rec.information27
138     ,information28              = p_rec.information28
139     ,information29              = p_rec.information29
140     ,information30              = p_rec.information30
141     ,object_version_number           = p_rec.object_version_number
142     where role_extra_info_id = p_rec.role_extra_info_id;
143   --
144   --
145   --
146   hr_utility.set_location(' Leaving:'||l_proc, 10);
147 --
148 Exception
149   When hr_api.check_integrity_violated Then
150     -- A check constraint has been violated
151     --
152     pqh_rei_shd.constraint_error
153       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
154   When hr_api.parent_integrity_violated Then
155     -- Parent integrity has been violated
156     --
157     pqh_rei_shd.constraint_error
158       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
159   When hr_api.unique_integrity_violated Then
160     -- Unique integrity has been violated
161     --
162     pqh_rei_shd.constraint_error
163       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
164   When Others Then
165     --
166     Raise;
167 End update_dml;
168 --
169 -- ----------------------------------------------------------------------------
170 -- |------------------------------< pre_update >------------------------------|
171 -- ----------------------------------------------------------------------------
172 -- {Start Of Comments}
173 --
174 -- Description:
175 --   This private procedure contains any processing which is required before
176 --   the update dml.
177 --
178 -- Prerequisites:
179 --   This is an internal procedure which is called from the upd procedure.
180 --
181 -- In Parameters:
182 --   A Pl/Sql record structure.
183 --
184 -- Post Success:
185 --   Processing continues.
186 --
187 -- Post Failure:
188 --   If an error has occurred, an error message and exception wil be raised
189 --   but not handled.
190 --
191 -- Developer Implementation Notes:
192 --   Any pre-processing required before the update dml is issued should be
193 --   coded within this procedure. It is important to note that any 3rd party
194 --   maintenance should be reviewed before placing in this procedure.
195 --
196 -- Access Status:
197 --   Internal Row Handler Use Only.
198 --
199 -- {End Of Comments}
200 -- ----------------------------------------------------------------------------
201 Procedure pre_update
202   (p_rec in pqh_rei_shd.g_rec_type
203   ) is
204 --
205   l_proc  varchar2(72) := g_package||'pre_update';
206 --
207 Begin
208   hr_utility.set_location('Entering:'||l_proc, 5);
209   --
210   hr_utility.set_location(' Leaving:'||l_proc, 10);
211 End pre_update;
212 --
213 -- ----------------------------------------------------------------------------
214 -- |-----------------------------< post_update >------------------------------|
215 -- ----------------------------------------------------------------------------
216 -- {Start Of Comments}
217 --
218 -- Description:
219 --   This private procedure contains any processing which is required after
220 --   the update dml.
221 --
222 -- Prerequisites:
223 --   This is an internal procedure which is called from the upd procedure.
224 --
225 -- In Parameters:
226 --   A Pl/Sql record structure.
227 --
228 -- Post Success:
229 --   Processing continues.
230 --
231 -- Post Failure:
232 --   If an error has occurred, an error message and exception will be raised
233 --   but not handled.
234 --
235 -- Developer Implementation Notes:
236 --   Any post-processing required after the update dml is issued should be
237 --   coded within this procedure. It is important to note that any 3rd party
238 --   maintenance should be reviewed before placing in this procedure.
239 --
240 -- Access Status:
241 --   Internal Row Handler Use Only.
242 --
243 -- {End Of Comments}
244 -- ----------------------------------------------------------------------------
245 Procedure post_update
246   (p_rec                          in pqh_rei_shd.g_rec_type
247   ) is
248 --
249   l_proc  varchar2(72) := g_package||'post_update';
250 --
251 Begin
252   hr_utility.set_location('Entering:'||l_proc, 5);
253   begin
254     --
255     pqh_rei_rku.after_update
256       (p_role_extra_info_id       	=> p_rec.role_extra_info_id
257       ,p_role_id       			=> p_rec.role_id
258       ,p_information_type       	=> p_rec.information_type
259       ,p_request_id       		=> p_rec.request_id
260       ,p_program_application_id         => p_rec.program_application_id
261       ,p_program_id     	        => p_rec.program_id
262       ,p_program_update_date            => p_rec.program_update_date
263       ,p_attribute_category             => p_rec.attribute_category
264       ,p_attribute1       		=> p_rec.attribute1
265       ,p_attribute2       		=> p_rec.attribute2
266       ,p_attribute3                     => p_rec.attribute3
267       ,p_attribute4       		=> p_rec.attribute4
268       ,p_attribute5       		=> p_rec.attribute5
269       ,p_attribute6       		=> p_rec.attribute6
270       ,p_attribute7      	        => p_rec.attribute7
271       ,p_attribute8       		=> p_rec.attribute8
272       ,p_attribute9       		=> p_rec.attribute9
273       ,p_attribute10       		=> p_rec.attribute10
274       ,p_attribute11       		=> p_rec.attribute11
275       ,p_attribute12       		=> p_rec.attribute12
276       ,p_attribute13       		=> p_rec.attribute13
277       ,p_attribute14       		=> p_rec.attribute14
278       ,p_attribute15                    => p_rec.attribute15
279       ,p_attribute16       		=> p_rec.attribute16
280       ,p_attribute17       		=> p_rec.attribute17
281       ,p_attribute18       		=> p_rec.attribute18
282       ,p_attribute19       		=> p_rec.attribute19
283       ,p_attribute20       		=> p_rec.attribute20
284       ,p_attribute21       		=> p_rec.attribute21
285       ,p_attribute22       		=> p_rec.attribute22
286       ,p_attribute23       		=> p_rec.attribute23
287       ,p_attribute24       		=> p_rec.attribute24
288       ,p_attribute25       		=> p_rec.attribute25
289       ,p_attribute26       		=> p_rec.attribute26
290       ,p_attribute27       		=> p_rec.attribute27
291       ,p_attribute28       		=> p_rec.attribute28
292       ,p_attribute29       		=> p_rec.attribute29
293       ,p_attribute30       		=> p_rec.attribute30
294       ,p_information_category           => p_rec.information_category
295       ,p_information1       		=> p_rec.information1
296       ,p_information2     	        => p_rec.information2
297       ,p_information3       		=> p_rec.information3
298       ,p_information4       		=> p_rec.information4
299       ,p_information5       		=> p_rec.information5
300       ,p_information6       		=> p_rec.information6
301       ,p_information7       		=> p_rec.information7
302       ,p_information8       		=> p_rec.information8
303       ,p_information9       		=> p_rec.information9
304       ,p_information10       		=> p_rec.information10
305       ,p_information11       		=> p_rec.information11
306       ,p_information12       		=> p_rec.information12
307       ,p_information13       		=> p_rec.information13
308       ,p_information14       		=> p_rec.information14
309       ,p_information15       		=> p_rec.information15
310       ,p_information16       		=> p_rec.information16
311       ,p_information17       		=> p_rec.information17
312       ,p_information18       		=> p_rec.information18
313       ,p_information19       		=> p_rec.information19
314       ,p_information20       		=> p_rec.information20
315       ,p_information21       		=> p_rec.information21
316       ,p_information22       		=> p_rec.information22
317       ,p_information23       		=> p_rec.information23
318       ,p_information24      	        => p_rec.information24
319       ,p_information25       		=> p_rec.information25
320       ,p_information26       		=> p_rec.information26
321       ,p_information27       		=> p_rec.information27
322       ,p_information28      		=> p_rec.information28
323       ,p_information29      		=> p_rec.information29
324       ,p_information30       		=> p_rec.information30
325       ,p_object_version_number          => p_rec.object_version_number
326       ,p_role_id_o      		=> pqh_rei_shd.g_old_rec.role_id
327       ,p_information_type_o       	=> pqh_rei_shd.g_old_rec.information_type
328       ,p_request_id_o       		=> pqh_rei_shd.g_old_rec.request_id
329       ,p_program_application_id_o       => pqh_rei_shd.g_old_rec.program_application_id
330       ,p_program_id_o       		=> pqh_rei_shd.g_old_rec.program_id
331       ,p_program_update_date_o       	=> pqh_rei_shd.g_old_rec.program_update_date
332       ,p_attribute_category_o      	=> pqh_rei_shd.g_old_rec.attribute_category
333       ,p_attribute1_o      		=> pqh_rei_shd.g_old_rec.attribute1
334       ,p_attribute2_o      		=> pqh_rei_shd.g_old_rec.attribute2
335       ,p_attribute3_o       		=> pqh_rei_shd.g_old_rec.attribute3
336       ,p_attribute4_o       		=> pqh_rei_shd.g_old_rec.attribute4
337       ,p_attribute5_o       		=> pqh_rei_shd.g_old_rec.attribute5
338       ,p_attribute6_o       		=> pqh_rei_shd.g_old_rec.attribute6
339       ,p_attribute7_o       		=> pqh_rei_shd.g_old_rec.attribute7
340       ,p_attribute8_o       		=> pqh_rei_shd.g_old_rec.attribute8
341       ,p_attribute9_o       		=> pqh_rei_shd.g_old_rec.attribute9
342       ,p_attribute10_o      		=> pqh_rei_shd.g_old_rec.attribute10
343       ,p_attribute11_o       		=> pqh_rei_shd.g_old_rec.attribute11
344       ,p_attribute12_o       		=> pqh_rei_shd.g_old_rec.attribute12
345       ,p_attribute13_o       		=> pqh_rei_shd.g_old_rec.attribute13
346       ,p_attribute14_o       		=> pqh_rei_shd.g_old_rec.attribute14
347       ,p_attribute15_o       		=> pqh_rei_shd.g_old_rec.attribute15
348       ,p_attribute16_o       		=> pqh_rei_shd.g_old_rec.attribute16
349       ,p_attribute17_o       		=> pqh_rei_shd.g_old_rec.attribute17
350       ,p_attribute18_o       		=> pqh_rei_shd.g_old_rec.attribute18
351       ,p_attribute19_o       		=> pqh_rei_shd.g_old_rec.attribute19
352       ,p_attribute20_o       		=> pqh_rei_shd.g_old_rec.attribute20
353       ,p_attribute21_o       		=> pqh_rei_shd.g_old_rec.attribute21
354       ,p_attribute22_o       		=> pqh_rei_shd.g_old_rec.attribute22
355       ,p_attribute23_o       		=> pqh_rei_shd.g_old_rec.attribute23
356       ,p_attribute24_o       		=> pqh_rei_shd.g_old_rec.attribute24
357       ,p_attribute25_o       		=> pqh_rei_shd.g_old_rec.attribute25
358       ,p_attribute26_o       		=> pqh_rei_shd.g_old_rec.attribute26
359       ,p_attribute27_o       		=> pqh_rei_shd.g_old_rec.attribute27
360       ,p_attribute28_o       		=> pqh_rei_shd.g_old_rec.attribute28
361       ,p_attribute29_o       		=> pqh_rei_shd.g_old_rec.attribute29
362       ,p_attribute30_o       		=> pqh_rei_shd.g_old_rec.attribute30
363       ,p_information_category_o         => pqh_rei_shd.g_old_rec.information_category
364       ,p_information1_o       		=> pqh_rei_shd.g_old_rec.information1
365       ,p_information2_o       		=> pqh_rei_shd.g_old_rec.information2
366       ,p_information3_o       		=> pqh_rei_shd.g_old_rec.information3
367       ,p_information4_o       		=> pqh_rei_shd.g_old_rec.information4
368       ,p_information5_o       		=> pqh_rei_shd.g_old_rec.information5
369       ,p_information6_o       		=> pqh_rei_shd.g_old_rec.information6
370       ,p_information7_o       		=> pqh_rei_shd.g_old_rec.information7
371       ,p_information8_o       		=> pqh_rei_shd.g_old_rec.information8
372       ,p_information9_o       		=> pqh_rei_shd.g_old_rec.information9
373       ,p_information10_o       		=> pqh_rei_shd.g_old_rec.information10
374       ,p_information11_o       		=> pqh_rei_shd.g_old_rec.information11
375       ,p_information12_o       		=> pqh_rei_shd.g_old_rec.information12
376       ,p_information13_o       		=> pqh_rei_shd.g_old_rec.information13
377       ,p_information14_o       		=> pqh_rei_shd.g_old_rec.information14
378       ,p_information15_o       		=> pqh_rei_shd.g_old_rec.information15
379       ,p_information16_o       		=> pqh_rei_shd.g_old_rec.information16
380       ,p_information17_o       		=> pqh_rei_shd.g_old_rec.information17
381       ,p_information18_o       		=> pqh_rei_shd.g_old_rec.information18
382       ,p_information19_o       		=> pqh_rei_shd.g_old_rec.information19
383       ,p_information20_o       		=> pqh_rei_shd.g_old_rec.information20
384       ,p_information21_o       		=> pqh_rei_shd.g_old_rec.information21
385       ,p_information22_o       		=> pqh_rei_shd.g_old_rec.information22
386       ,p_information23_o       		=> pqh_rei_shd.g_old_rec.information23
387       ,p_information24_o       		=> pqh_rei_shd.g_old_rec.information24
388       ,p_information25_o       		=> pqh_rei_shd.g_old_rec.information25
389       ,p_information26_o       		=> pqh_rei_shd.g_old_rec.information26
390       ,p_information27_o       		=> pqh_rei_shd.g_old_rec.information27
391       ,p_information28_o       		=> pqh_rei_shd.g_old_rec.information28
392       ,p_information29_o       		=> pqh_rei_shd.g_old_rec.information29
393       ,p_information30_o       		=> pqh_rei_shd.g_old_rec.information30
394       ,p_object_version_number_o        => pqh_rei_shd.g_old_rec.object_version_number
395       );
396     --
397   exception
398     --
399     when hr_api.cannot_find_prog_unit then
400       --
401       hr_api.cannot_find_prog_unit_error
402         (p_module_name => 'PQH_ROLE_EXTRA_INFO'
403         ,p_hook_type   => 'AU');
404       --
405   end;
406   --
407   hr_utility.set_location(' Leaving:'||l_proc, 10);
408 End post_update;
409 --
410 -- ----------------------------------------------------------------------------
411 -- |-----------------------------< convert_defs >-----------------------------|
412 -- ----------------------------------------------------------------------------
413 -- {Start Of Comments}
414 --
415 -- Description:
416 --   The Convert_Defs procedure has one very important function:
417 --   It must return the record structure for the row with all system defaulted
418 --   values converted into its corresponding parameter value for update. When
419 --   we attempt to update a row through the Upd process , certain
420 --   parameters can be defaulted which enables flexibility in the calling of
421 --   the upd process (e.g. only attributes which need to be updated need to be
422 --   specified). For the upd process to determine which attributes
423 --   have NOT been specified we need to check if the parameter has a reserved
424 --   system default value. Therefore, for all parameters which have a
425 --   corresponding reserved system default mechanism specified we need to
426 --   check if a system default is being used. If a system default is being
427 --   used then we convert the defaulted value into its corresponding attribute
428 --   value held in the g_old_rec data structure.
429 --
430 -- Prerequisites:
431 --   This private function can only be called from the upd process.
432 --
433 -- In Parameters:
434 --   A Pl/Sql record structure.
435 --
436 -- Post Success:
437 --   The record structure will be returned with all system defaulted parameter
438 --   values converted into its current row attribute value.
439 --
440 -- Post Failure:
441 --   No direct error handling is required within this function. Any possible
442 --   errors within this procedure will be a PL/SQL value error due to
443 --   conversion of datatypes or data lengths.
444 --
445 -- Developer Implementation Notes:
446 --   None.
447 --
448 -- Access Status:
449 --   Internal Row Handler Use Only.
450 --
451 -- {End Of Comments}
452 -- ----------------------------------------------------------------------------
453 Procedure convert_defs
454   (p_rec in out nocopy pqh_rei_shd.g_rec_type
455   ) is
456 --
457 Begin
458   --
459   -- We must now examine each argument value in the
460   -- p_rec plsql record structure
461   -- to see if a system default is being used. If a system default
462   -- is being used then we must set to the 'current' argument value.
463   --
464   If (p_rec.role_id = hr_api.g_number) then
465     p_rec.role_id :=
466     pqh_rei_shd.g_old_rec.role_id;
467   End If;
468   If (p_rec.information_type = hr_api.g_varchar2) then
469     p_rec.information_type :=
470     pqh_rei_shd.g_old_rec.information_type;
471   End If;
472   If (p_rec.request_id = hr_api.g_number) then
473     p_rec.request_id :=
474     pqh_rei_shd.g_old_rec.request_id;
475   End If;
476   If (p_rec.program_application_id = hr_api.g_number) then
477     p_rec.program_application_id :=
478     pqh_rei_shd.g_old_rec.program_application_id;
479   End If;
480   If (p_rec.program_id = hr_api.g_number) then
481     p_rec.program_id :=
482     pqh_rei_shd.g_old_rec.program_id;
483   End If;
484   If (p_rec.program_update_date = hr_api.g_date) then
485     p_rec.program_update_date :=
486     pqh_rei_shd.g_old_rec.program_update_date;
487   End If;
488   If (p_rec.attribute_category = hr_api.g_varchar2) then
489     p_rec.attribute_category :=
490     pqh_rei_shd.g_old_rec.attribute_category;
491   End If;
492   If (p_rec.attribute1 = hr_api.g_varchar2) then
493     p_rec.attribute1 :=
494     pqh_rei_shd.g_old_rec.attribute1;
495   End If;
496   If (p_rec.attribute2 = hr_api.g_varchar2) then
497     p_rec.attribute2 :=
498     pqh_rei_shd.g_old_rec.attribute2;
499   End If;
500   If (p_rec.attribute3 = hr_api.g_varchar2) then
501     p_rec.attribute3 :=
502     pqh_rei_shd.g_old_rec.attribute3;
503   End If;
504   If (p_rec.attribute4 = hr_api.g_varchar2) then
505     p_rec.attribute4 :=
506     pqh_rei_shd.g_old_rec.attribute4;
507   End If;
508   If (p_rec.attribute5 = hr_api.g_varchar2) then
509     p_rec.attribute5 :=
510     pqh_rei_shd.g_old_rec.attribute5;
511   End If;
512   If (p_rec.attribute6 = hr_api.g_varchar2) then
513     p_rec.attribute6 :=
514     pqh_rei_shd.g_old_rec.attribute6;
515   End If;
516   If (p_rec.attribute7 = hr_api.g_varchar2) then
517     p_rec.attribute7 :=
518     pqh_rei_shd.g_old_rec.attribute7;
519   End If;
520   If (p_rec.attribute8 = hr_api.g_varchar2) then
521     p_rec.attribute8 :=
522     pqh_rei_shd.g_old_rec.attribute8;
523   End If;
524   If (p_rec.attribute9 = hr_api.g_varchar2) then
525     p_rec.attribute9 :=
526     pqh_rei_shd.g_old_rec.attribute9;
527   End If;
528   If (p_rec.attribute10 = hr_api.g_varchar2) then
529     p_rec.attribute10 :=
530     pqh_rei_shd.g_old_rec.attribute10;
531   End If;
532   If (p_rec.attribute11 = hr_api.g_varchar2) then
533     p_rec.attribute11 :=
534     pqh_rei_shd.g_old_rec.attribute11;
535   End If;
536   If (p_rec.attribute12 = hr_api.g_varchar2) then
537     p_rec.attribute12 :=
538     pqh_rei_shd.g_old_rec.attribute12;
539   End If;
540   If (p_rec.attribute13 = hr_api.g_varchar2) then
541     p_rec.attribute13 :=
542     pqh_rei_shd.g_old_rec.attribute13;
543   End If;
544   If (p_rec.attribute14 = hr_api.g_varchar2) then
545     p_rec.attribute14 :=
546     pqh_rei_shd.g_old_rec.attribute14;
547   End If;
548   If (p_rec.attribute15 = hr_api.g_varchar2) then
549     p_rec.attribute15 :=
550     pqh_rei_shd.g_old_rec.attribute15;
551   End If;
552   If (p_rec.attribute16 = hr_api.g_varchar2) then
553     p_rec.attribute16 :=
554     pqh_rei_shd.g_old_rec.attribute16;
555   End If;
556   If (p_rec.attribute17 = hr_api.g_varchar2) then
557     p_rec.attribute17 :=
558     pqh_rei_shd.g_old_rec.attribute17;
559   End If;
560   If (p_rec.attribute18 = hr_api.g_varchar2) then
561     p_rec.attribute18 :=
562     pqh_rei_shd.g_old_rec.attribute18;
563   End If;
564   If (p_rec.attribute19 = hr_api.g_varchar2) then
565     p_rec.attribute19 :=
566     pqh_rei_shd.g_old_rec.attribute19;
567   End If;
568   If (p_rec.attribute20 = hr_api.g_varchar2) then
569     p_rec.attribute20 :=
570     pqh_rei_shd.g_old_rec.attribute20;
571   End If;
572   If (p_rec.attribute21 = hr_api.g_varchar2) then
573       p_rec.attribute21 :=
574       pqh_rei_shd.g_old_rec.attribute21;
575   End If;
576   If (p_rec.attribute22 = hr_api.g_varchar2) then
577       p_rec.attribute22 :=
578       pqh_rei_shd.g_old_rec.attribute22;
579   End If;
580   If (p_rec.attribute23 = hr_api.g_varchar2) then
581       p_rec.attribute23 :=
582       pqh_rei_shd.g_old_rec.attribute23;
583   End If;
584   If (p_rec.attribute24 = hr_api.g_varchar2) then
585       p_rec.attribute24 :=
586       pqh_rei_shd.g_old_rec.attribute24;
587   End If;
588   If (p_rec.attribute25 = hr_api.g_varchar2) then
589       p_rec.attribute25 :=
590       pqh_rei_shd.g_old_rec.attribute25;
591   End If;
592   If (p_rec.attribute26 = hr_api.g_varchar2) then
593       p_rec.attribute26 :=
594       pqh_rei_shd.g_old_rec.attribute26;
595   End If;
596   If (p_rec.attribute27 = hr_api.g_varchar2) then
597       p_rec.attribute27 :=
598       pqh_rei_shd.g_old_rec.attribute27;
599   End If;
600   If (p_rec.attribute28 = hr_api.g_varchar2) then
601       p_rec.attribute28 :=
602       pqh_rei_shd.g_old_rec.attribute28;
603   End If;
604   If (p_rec.attribute29 = hr_api.g_varchar2) then
605       p_rec.attribute29 :=
606       pqh_rei_shd.g_old_rec.attribute29;
607   End If;
608   If (p_rec.attribute30 = hr_api.g_varchar2) then
609       p_rec.attribute30 :=
610       pqh_rei_shd.g_old_rec.attribute30;
611   End If;
612 
613   If (p_rec.information_category = hr_api.g_varchar2) then
614     p_rec.information_category :=
615     pqh_rei_shd.g_old_rec.information_category;
616   End If;
617   If (p_rec.information1 = hr_api.g_varchar2) then
618     p_rec.information1 :=
619     pqh_rei_shd.g_old_rec.information1;
620   End If;
621   If (p_rec.information2 = hr_api.g_varchar2) then
622     p_rec.information2 :=
623     pqh_rei_shd.g_old_rec.information2;
624   End If;
625   If (p_rec.information3 = hr_api.g_varchar2) then
626     p_rec.information3 :=
627     pqh_rei_shd.g_old_rec.information3;
628   End If;
629   If (p_rec.information4 = hr_api.g_varchar2) then
630     p_rec.information4 :=
631     pqh_rei_shd.g_old_rec.information4;
632   End If;
633   If (p_rec.information5 = hr_api.g_varchar2) then
634     p_rec.information5 :=
635     pqh_rei_shd.g_old_rec.information5;
636   End If;
637   If (p_rec.information6 = hr_api.g_varchar2) then
638     p_rec.information6 :=
639     pqh_rei_shd.g_old_rec.information6;
640   End If;
641   If (p_rec.information7 = hr_api.g_varchar2) then
642     p_rec.information7 :=
643     pqh_rei_shd.g_old_rec.information7;
644   End If;
645   If (p_rec.information8 = hr_api.g_varchar2) then
646     p_rec.information8 :=
647     pqh_rei_shd.g_old_rec.information8;
648   End If;
649   If (p_rec.information9 = hr_api.g_varchar2) then
650     p_rec.information9 :=
651     pqh_rei_shd.g_old_rec.information9;
652   End If;
653   If (p_rec.information10 = hr_api.g_varchar2) then
654     p_rec.information10 :=
655     pqh_rei_shd.g_old_rec.information10;
656   End If;
657   If (p_rec.information11 = hr_api.g_varchar2) then
658     p_rec.information11 :=
659     pqh_rei_shd.g_old_rec.information11;
660   End If;
661   If (p_rec.information12 = hr_api.g_varchar2) then
662     p_rec.information12 :=
663     pqh_rei_shd.g_old_rec.information12;
664   End If;
665   If (p_rec.information13 = hr_api.g_varchar2) then
666     p_rec.information13 :=
667     pqh_rei_shd.g_old_rec.information13;
668   End If;
669   If (p_rec.information14 = hr_api.g_varchar2) then
670     p_rec.information14 :=
671     pqh_rei_shd.g_old_rec.information14;
672   End If;
673   If (p_rec.information15 = hr_api.g_varchar2) then
674     p_rec.information15 :=
675     pqh_rei_shd.g_old_rec.information15;
676   End If;
677   If (p_rec.information16 = hr_api.g_varchar2) then
678     p_rec.information16 :=
679     pqh_rei_shd.g_old_rec.information16;
680   End If;
681   If (p_rec.information17 = hr_api.g_varchar2) then
682     p_rec.information17 :=
683     pqh_rei_shd.g_old_rec.information17;
684   End If;
685   If (p_rec.information18 = hr_api.g_varchar2) then
686     p_rec.information18 :=
687     pqh_rei_shd.g_old_rec.information18;
688   End If;
689   If (p_rec.information19 = hr_api.g_varchar2) then
690     p_rec.information19 :=
691     pqh_rei_shd.g_old_rec.information19;
692   End If;
693   If (p_rec.information20 = hr_api.g_varchar2) then
694     p_rec.information20 :=
695     pqh_rei_shd.g_old_rec.information20;
696   End If;
697   If (p_rec.information21 = hr_api.g_varchar2) then
698     p_rec.information21 :=
699     pqh_rei_shd.g_old_rec.information21;
700   End If;
701   If (p_rec.information22 = hr_api.g_varchar2) then
702     p_rec.information22 :=
703     pqh_rei_shd.g_old_rec.information22;
704   End If;
705   If (p_rec.information23 = hr_api.g_varchar2) then
706     p_rec.information23 :=
707     pqh_rei_shd.g_old_rec.information23;
708   End If;
709   If (p_rec.information24 = hr_api.g_varchar2) then
710     p_rec.information24 :=
711     pqh_rei_shd.g_old_rec.information24;
712   End If;
713   If (p_rec.information25 = hr_api.g_varchar2) then
714     p_rec.information25 :=
715     pqh_rei_shd.g_old_rec.information25;
716   End If;
717   If (p_rec.information26 = hr_api.g_varchar2) then
718     p_rec.information26 :=
719     pqh_rei_shd.g_old_rec.information26;
720   End If;
721   If (p_rec.information27 = hr_api.g_varchar2) then
722     p_rec.information27 :=
723     pqh_rei_shd.g_old_rec.information27;
724   End If;
725   If (p_rec.information28 = hr_api.g_varchar2) then
726     p_rec.information28 :=
727     pqh_rei_shd.g_old_rec.information28;
728   End If;
729   If (p_rec.information29 = hr_api.g_varchar2) then
730     p_rec.information29 :=
731     pqh_rei_shd.g_old_rec.information29;
732   End If;
733   If (p_rec.information30 = hr_api.g_varchar2) then
734     p_rec.information30 :=
735     pqh_rei_shd.g_old_rec.information30;
736   End If;
737   --
738 End convert_defs;
739 --
740 -- ----------------------------------------------------------------------------
741 -- |---------------------------------< upd >----------------------------------|
742 -- ----------------------------------------------------------------------------
743 Procedure upd
744   (p_rec                          in out nocopy pqh_rei_shd.g_rec_type
745   ,p_validate   in     boolean
746   ) is
747 --
748   l_proc  varchar2(72) := g_package||'upd';
749 --
750 Begin
751   hr_utility.set_location('Entering:'||l_proc, 5);
752 
753   -- Determine if the business process is to be validated.
754   --
755   If p_validate then
756     --
757     -- Issue the savepoint.
758     --
759     SAVEPOINT upd_pqh_rei;
760   End If;
761   --
762   --
763   -- We must lock the row which we need to update.
764   --
765 
766   pqh_rei_shd.lck
767     (p_rec.role_extra_info_id
768     ,p_rec.object_version_number
769     );
770   --
771   -- 1. During an update system defaults are used to determine if
772   --    arguments have been defaulted or not. We must therefore
773   --    derive the full record structure values to be updated.
774   --
775   -- 2. Call the supporting update validate operations.
776   --
777   convert_defs(p_rec);
778   pqh_rei_bus.update_validate
779      (p_rec
780      );
781 
782   -- Call the supporting pre-update operation
783   --
784   pqh_rei_upd.pre_update(p_rec);
785   --
786   -- Update the row.
787   --
788   pqh_rei_upd.update_dml(p_rec);
789   --
790   -- Call the supporting post-update operation
791   --
792   pqh_rei_upd.post_update
793      (p_rec
794      );
795   --
796   --
797   -- If we are validating then raise the Validate_Enabled exception
798   --
799   If p_validate then
800     Raise HR_Api.Validate_Enabled;
801   End If;
802   --
803   -- Call to raise any errors on multi-message list
804   hr_multi_message.end_validation_set;
805 Exception
806   When HR_Api.Validate_Enabled Then
807     --
808     -- As the Validate_Enabled exception has been raised
809     -- we must rollback to the savepoint
810     --
811     ROLLBACK TO upd_pqh_rei;
812 End upd;
813 
814 -- ----------------------------------------------------------------------------
815 -- |---------------------------------< upd >----------------------------------|
816 -- ----------------------------------------------------------------------------
817 Procedure upd
818   (p_role_extra_info_id           in     number
819   ,p_object_version_number        in out nocopy number
820   ,p_role_id                      in     number
821   ,p_information_type             in     varchar2
822   ,p_request_id                   in     number
823   ,p_program_application_id       in     number
824   ,p_program_id                   in     number
825   ,p_program_update_date          in     date
826   ,p_attribute_category      in     varchar2
827   ,p_attribute1              in     varchar2
828   ,p_attribute2              in     varchar2
829   ,p_attribute3              in     varchar2
830   ,p_attribute4              in     varchar2
831   ,p_attribute5              in     varchar2
832   ,p_attribute6              in     varchar2
833   ,p_attribute7              in     varchar2
834   ,p_attribute8              in     varchar2
835   ,p_attribute9              in     varchar2
836   ,p_attribute10             in     varchar2
837   ,p_attribute11             in     varchar2
838   ,p_attribute12             in     varchar2
839   ,p_attribute13             in     varchar2
840   ,p_attribute14             in     varchar2
841   ,p_attribute15             in     varchar2
842   ,p_attribute16             in     varchar2
843   ,p_attribute17             in     varchar2
844   ,p_attribute18             in     varchar2
845   ,p_attribute19             in     varchar2
846   ,p_attribute20             in     varchar2
847   ,p_attribute21             in     varchar2
848   ,p_attribute22             in     varchar2
849   ,p_attribute23             in     varchar2
850   ,p_attribute24             in     varchar2
851   ,p_attribute25             in     varchar2
852   ,p_attribute26             in     varchar2
853   ,p_attribute27             in     varchar2
854   ,p_attribute28             in     varchar2
855   ,p_attribute29             in     varchar2
856   ,p_attribute30             in     varchar2
857   ,p_information_category    in     varchar2
858   ,p_information1            in     varchar2
859   ,p_information2            in     varchar2
860   ,p_information3            in     varchar2
861   ,p_information4            in     varchar2
862   ,p_information5            in     varchar2
863   ,p_information6            in     varchar2
864   ,p_information7            in     varchar2
865   ,p_information8            in     varchar2
866   ,p_information9            in     varchar2
867   ,p_information10           in     varchar2
868   ,p_information11           in     varchar2
869   ,p_information12           in     varchar2
870   ,p_information13           in     varchar2
871   ,p_information14           in     varchar2
872   ,p_information15           in     varchar2
873   ,p_information16           in     varchar2
874   ,p_information17           in     varchar2
875   ,p_information18           in     varchar2
876   ,p_information19           in     varchar2
877   ,p_information20           in     varchar2
878   ,p_information21           in     varchar2
879   ,p_information22           in     varchar2
880   ,p_information23           in     varchar2
881   ,p_information24           in     varchar2
882   ,p_information25           in     varchar2
883   ,p_information26           in     varchar2
884   ,p_information27           in     varchar2
885   ,p_information28           in     varchar2
886   ,p_information29           in     varchar2
887   ,p_information30           in     varchar2
888   ,p_validate                     in boolean
889   ) is
890 --
891   l_rec   pqh_rei_shd.g_rec_type;
892   l_proc  varchar2(72) := g_package||'upd';
893 --
894 Begin
895   hr_utility.set_location('Entering:'||l_proc, 5);
896   --
897   -- Call conversion function to turn arguments into the
898   -- l_rec structure.
899   --
900   l_rec :=
901   pqh_rei_shd.convert_args
902   (p_role_extra_info_id
903   ,p_role_id
904   ,p_information_type
905   ,p_request_id
906   ,p_program_application_id
907   ,p_program_id
908   ,p_program_update_date
909   ,p_attribute_category
910   ,p_attribute1
911   ,p_attribute2
912   ,p_attribute3
913   ,p_attribute4
914   ,p_attribute5
915   ,p_attribute6
916   ,p_attribute7
917   ,p_attribute8
918   ,p_attribute9
919   ,p_attribute10
920   ,p_attribute11
921   ,p_attribute12
922   ,p_attribute13
923   ,p_attribute14
924   ,p_attribute15
925   ,p_attribute16
926   ,p_attribute17
927   ,p_attribute18
928   ,p_attribute19
929   ,p_attribute20
930   ,p_attribute21
931   ,p_attribute22
932   ,p_attribute23
933   ,p_attribute24
934   ,p_attribute25
935   ,p_attribute26
936   ,p_attribute27
937   ,p_attribute28
938   ,p_attribute29
939   ,p_attribute30
940   ,p_information_category
941   ,p_information1
942   ,p_information2
943   ,p_information3
944   ,p_information4
945   ,p_information5
946   ,p_information6
947   ,p_information7
948   ,p_information8
949   ,p_information9
950   ,p_information10
951   ,p_information11
952   ,p_information12
953   ,p_information13
954   ,p_information14
955   ,p_information15
956   ,p_information16
957   ,p_information17
958   ,p_information18
959   ,p_information19
960   ,p_information20
961   ,p_information21
962   ,p_information22
963   ,p_information23
964   ,p_information24
965   ,p_information25
966   ,p_information26
967   ,p_information27
968   ,p_information28
969   ,p_information29
970   ,p_information30
971   ,p_object_version_number
972   );
973   --
974   -- Having converted the arguments into the
975   -- plsql record structure we call the corresponding record
976   -- business process.
977   --
978 
979     pqh_rei_upd.upd
980      (l_rec
981      ,p_validate
982      );
983   p_object_version_number := l_rec.object_version_number;
984   --
985   hr_utility.set_location(' Leaving:'||l_proc, 10);
986 End upd;
987 --
988 end pqh_rei_upd;