DBA Data[Home] [Help]

PACKAGE BODY: APPS.SSP_MAT_UPD

Source


1 Package Body ssp_mat_upd as
2 /* $Header: spmatrhi.pkb 120.5.12010000.3 2008/08/13 13:27:41 ubhat ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ssp_mat_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 ssp_mat_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   ssp_mat_shd.g_api_dml := true;  -- Set the api dml status
66   --
67   -- Update the ssp_maternities Row
68   --
69   update ssp_maternities
70   set
71   due_date                          = p_rec.due_date,
72   start_date_maternity_allowance    = p_rec.start_date_maternity_allowance,
73   notification_of_birth_date        = p_rec.notification_of_birth_date,
74   unfit_for_scheduled_return        = p_rec.unfit_for_scheduled_return,
75   stated_return_date                = p_rec.stated_return_date,
76   intend_to_return_flag             = p_rec.intend_to_return_flag,
77   start_date_with_new_employer      = p_rec.start_date_with_new_employer,
78   smp_must_be_paid_by_date          = p_rec.smp_must_be_paid_by_date,
79   pay_smp_as_lump_sum               = p_rec.pay_smp_as_lump_sum,
80   live_birth_flag                   = p_rec.live_birth_flag,
81   actual_birth_date                 = p_rec.actual_birth_date,
82   mpp_start_date                    = p_rec.mpp_start_date,
83   object_version_number             = p_rec.object_version_number,
84   attribute_category                = p_rec.attribute_category,
85   attribute1                        = p_rec.attribute1,
86   attribute2                        = p_rec.attribute2,
87   attribute3                        = p_rec.attribute3,
88   attribute4                        = p_rec.attribute4,
89   attribute5                        = p_rec.attribute5,
90   attribute6                        = p_rec.attribute6,
91   attribute7                        = p_rec.attribute7,
92   attribute8                        = p_rec.attribute8,
93   attribute9                        = p_rec.attribute9,
94   attribute10                       = p_rec.attribute10,
95   attribute11                       = p_rec.attribute11,
96   attribute12                       = p_rec.attribute12,
97   attribute13                       = p_rec.attribute13,
98   attribute14                       = p_rec.attribute14,
99   attribute15                       = p_rec.attribute15,
100   attribute16                       = p_rec.attribute16,
101   attribute17                       = p_rec.attribute17,
102   attribute18                       = p_rec.attribute18,
103   attribute19                       = p_rec.attribute19,
104   attribute20                       = p_rec.attribute20,
105   LEAVE_TYPE                        = p_rec.LEAVE_TYPE,
106   MATCHING_DATE                     = p_rec.MATCHING_DATE,
107   PLACEMENT_DATE                    = p_rec.PLACEMENT_DATE ,
108   DISRUPTED_PLACEMENT_DATE          = p_rec.DISRUPTED_PLACEMENT_DATE,
109   mat_information_category          = p_rec.mat_information_category,
110   mat_information1                  = p_rec.mat_information1,
111   mat_information2                  = p_rec.mat_information2,
112   mat_information3                  = p_rec.mat_information3,
113   mat_information4                  = p_rec.mat_information4,
114   mat_information5                  = p_rec.mat_information5,
115   mat_information6                  = p_rec.mat_information6,
116   mat_information7                  = p_rec.mat_information7,
117   mat_information8                  = p_rec.mat_information8,
118   mat_information9                  = p_rec.mat_information9,
119   mat_information10                 = p_rec.mat_information10,
120   mat_information11                 = p_rec.mat_information11,
121   mat_information12                 = p_rec.mat_information12,
122   mat_information13                 = p_rec.mat_information13,
123   mat_information14                 = p_rec.mat_information14,
124   mat_information15                 = p_rec.mat_information15,
125   mat_information16                 = p_rec.mat_information16,
126   mat_information17                 = p_rec.mat_information17,
127   mat_information18                 = p_rec.mat_information18,
128   mat_information19                 = p_rec.mat_information19,
129   mat_information20                 = p_rec.mat_information20,
130   mat_information21                 = p_rec.mat_information21,
131   mat_information22                 = p_rec.mat_information22,
132   mat_information23                 = p_rec.mat_information23,
133   mat_information24                 = p_rec.mat_information24,
134   mat_information25                 = p_rec.mat_information25,
135   mat_information26                 = p_rec.mat_information26,
136   mat_information27                 = p_rec.mat_information27,
137   mat_information28                 = p_rec.mat_information28,
138   mat_information29                 = p_rec.mat_information29,
139   mat_information30                 = p_rec.mat_information30
140   where maternity_id = p_rec.maternity_id;
141   --
142   ssp_mat_shd.g_api_dml := false;   -- Unset the api dml status
143   --
144   hr_utility.set_location(' Leaving:'||l_proc, 10);
145 --
146 Exception
147   When hr_api.check_integrity_violated Then
148     -- A check constraint has been violated
149     ssp_mat_shd.g_api_dml := false;   -- Unset the api dml status
150     ssp_mat_shd.constraint_error
151       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
152   When hr_api.parent_integrity_violated Then
153     -- Parent integrity has been violated
154     ssp_mat_shd.g_api_dml := false;   -- Unset the api dml status
155     ssp_mat_shd.constraint_error
156       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
157   When hr_api.unique_integrity_violated Then
158     -- Unique integrity has been violated
159     ssp_mat_shd.g_api_dml := false;   -- Unset the api dml status
160     ssp_mat_shd.constraint_error
161       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
162   When Others Then
163     ssp_mat_shd.g_api_dml := false;   -- Unset the api dml status
164     Raise;
165 End update_dml;
166 --
167 -- ----------------------------------------------------------------------------
168 -- |------------------------------< pre_update >------------------------------|
169 -- ----------------------------------------------------------------------------
170 -- {Start Of Comments}
171 --
172 -- Description:
173 --   This private procedure contains any processing which is required before
174 --   the 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 pre-processing required before 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 pre_update(p_rec in ssp_mat_shd.g_rec_type) is
200 --
201   l_proc  varchar2(72) := g_package||'pre_update';
202 --
203 Begin
204   hr_utility.set_location('Entering:'||l_proc, 5);
205   --
206   hr_utility.set_location(' Leaving:'||l_proc, 10);
207 End pre_update;
208 --
209 -- ----------------------------------------------------------------------------
210 -- |-----------------------------< post_update >------------------------------|
211 -- ----------------------------------------------------------------------------
212 -- {Start Of Comments}
213 --
214 -- Description:
215 --   This private procedure contains any processing which is required after the
216 --   update dml.
217 --
218 -- Pre Conditions:
219 --   This is an internal procedure which is called from the upd procedure.
220 --
221 -- In Parameters:
222 --   A Pl/Sql record structre.
223 --
224 -- Post Success:
225 --   Processing continues.
226 --
227 -- Post Failure:
228 --   If an error has occurred, an error message and exception will be raised
229 --   but not handled.
230 --
231 -- Developer Implementation Notes:
232 --   Any post-processing required after the update dml is issued should be
233 --   coded within this procedure. It is important to note that any 3rd party
234 --   maintenance should be reviewed before placing in this procedure.
235 --
236 -- Access Status:
237 --   Internal Table Handler Use Only.
238 --
239 -- {End Of Comments}
240 -- ----------------------------------------------------------------------------
241 Procedure post_update(p_rec in ssp_mat_shd.g_rec_type) is
242 --
243   l_proc  varchar2(72) := g_package||'post_update';
244 --
245 Begin
246   hr_utility.set_location('Entering:'||l_proc, 5);
247   --
248   hr_utility.set_location(' Leaving:'||l_proc, 10);
249 End post_update;
250 --
251 -- ----------------------------------------------------------------------------
252 -- |-----------------------------< convert_defs >-----------------------------|
253 -- ----------------------------------------------------------------------------
254 -- {Start Of Comments}
255 --
256 -- Description:
257 --   The Convert_Defs procedure has one very important function:
258 --   It must return the record structure for the row with all system defaulted
259 --   values converted into its corresponding parameter value for update. When
260 --   we attempt to update a row through the Upd process , certain
261 --   parameters can be defaulted which enables flexibility in the calling of
262 --   the upd process (e.g. only attributes which need to be updated need to be
263 --   specified). For the upd process to determine which attributes
264 --   have NOT been specified we need to check if the parameter has a reserved
265 --   system default value. Therefore, for all parameters which have a
266 --   corresponding reserved system default mechanism specified we need to
267 --   check if a system default is being used. If a system default is being
268 --   used then we convert the defaulted value into its corresponding attribute
269 --   value held in the g_old_rec data structure.
270 --
271 -- Pre Conditions:
272 --   This private function can only be called from the upd process.
273 --
274 -- In Parameters:
275 --   A Pl/Sql record structre.
276 --
277 -- Post Success:
278 --   The record structure will be returned with all system defaulted parameter
279 --   values converted into its current row attribute value.
280 --
281 -- Post Failure:
282 --   No direct error handling is required within this function. Any possible
283 --   errors within this procedure will be a PL/SQL value error due to conversion
284 
285 --   of datatypes or data lengths.
286 --
287 -- Developer Implementation Notes:
288 --   None.
289 --
290 -- Access Status:
291 --   Internal Table Handler Use Only.
292 --
293 -- {End Of Comments}
294 -- ----------------------------------------------------------------------------
295 Procedure convert_defs(p_rec in out nocopy ssp_mat_shd.g_rec_type) is
296 --
297   l_proc  varchar2(72) := g_package||'convert_defs';
298 --
299 Begin
300   --
301   hr_utility.set_location('Entering:'||l_proc, 5);
302   --
303   -- We must now examine each argument value in the
304   -- p_rec plsql record structure
305   -- to see if a system default is being used. If a system default
306   -- is being used then we must set to the 'current' argument value.
307   --
308   If (p_rec.due_date = hr_api.g_date) then
309     p_rec.due_date :=
310     ssp_mat_shd.g_old_rec.due_date;
311   End If;
312   If (p_rec.person_id = hr_api.g_number) then
313     p_rec.person_id :=
314     ssp_mat_shd.g_old_rec.person_id;
315   End If;
316   If (p_rec.start_date_maternity_allowance = hr_api.g_date) then
317     p_rec.start_date_maternity_allowance :=
318     ssp_mat_shd.g_old_rec.start_date_maternity_allowance;
319   End If;
320   If (p_rec.notification_of_birth_date = hr_api.g_date) then
321     p_rec.notification_of_birth_date :=
322     ssp_mat_shd.g_old_rec.notification_of_birth_date;
323   End If;
324   If (p_rec.unfit_for_scheduled_return = hr_api.g_varchar2) then
325     p_rec.unfit_for_scheduled_return :=
326     ssp_mat_shd.g_old_rec.unfit_for_scheduled_return;
327   End If;
328   If (p_rec.stated_return_date = hr_api.g_date) then
329     p_rec.stated_return_date :=
330     ssp_mat_shd.g_old_rec.stated_return_date;
331   End If;
332   If (p_rec.intend_to_return_flag = hr_api.g_varchar2) then
333     p_rec.intend_to_return_flag :=
334     ssp_mat_shd.g_old_rec.intend_to_return_flag;
335   End If;
336   If (p_rec.start_date_with_new_employer = hr_api.g_date) then
337     p_rec.start_date_with_new_employer :=
338     ssp_mat_shd.g_old_rec.start_date_with_new_employer;
339   End If;
340   If (p_rec.smp_must_be_paid_by_date = hr_api.g_date) then
341     p_rec.smp_must_be_paid_by_date :=
342     ssp_mat_shd.g_old_rec.smp_must_be_paid_by_date;
343   End If;
344   If (p_rec.pay_smp_as_lump_sum = hr_api.g_varchar2) then
345     p_rec.pay_smp_as_lump_sum :=
346     ssp_mat_shd.g_old_rec.pay_smp_as_lump_sum;
347   End If;
348   If (p_rec.live_birth_flag = hr_api.g_varchar2) then
349     p_rec.live_birth_flag :=
350     ssp_mat_shd.g_old_rec.live_birth_flag;
351   End If;
352   If (p_rec.actual_birth_date = hr_api.g_date) then
353     p_rec.actual_birth_date :=
354     ssp_mat_shd.g_old_rec.actual_birth_date;
355   End If;
356   If (p_rec.mpp_start_date = hr_api.g_date) then
357     p_rec.mpp_start_date :=
358     ssp_mat_shd.g_old_rec.mpp_start_date;
359   End If;
360   If (p_rec.attribute_category = hr_api.g_varchar2) then
361     p_rec.attribute_category :=
362     ssp_mat_shd.g_old_rec.attribute_category;
363   End If;
364   If (p_rec.attribute1 = hr_api.g_varchar2) then
365     p_rec.attribute1 :=
366     ssp_mat_shd.g_old_rec.attribute1;
367   End If;
368   If (p_rec.attribute2 = hr_api.g_varchar2) then
369     p_rec.attribute2 :=
370     ssp_mat_shd.g_old_rec.attribute2;
371   End If;
372   If (p_rec.attribute3 = hr_api.g_varchar2) then
373     p_rec.attribute3 :=
374     ssp_mat_shd.g_old_rec.attribute3;
375   End If;
376   If (p_rec.attribute4 = hr_api.g_varchar2) then
377     p_rec.attribute4 :=
378     ssp_mat_shd.g_old_rec.attribute4;
379   End If;
380   If (p_rec.attribute5 = hr_api.g_varchar2) then
381     p_rec.attribute5 :=
382     ssp_mat_shd.g_old_rec.attribute5;
383   End If;
384   If (p_rec.attribute6 = hr_api.g_varchar2) then
385     p_rec.attribute6 :=
386     ssp_mat_shd.g_old_rec.attribute6;
387   End If;
388   If (p_rec.attribute7 = hr_api.g_varchar2) then
389     p_rec.attribute7 :=
390     ssp_mat_shd.g_old_rec.attribute7;
391   End If;
392   If (p_rec.attribute8 = hr_api.g_varchar2) then
393     p_rec.attribute8 :=
394     ssp_mat_shd.g_old_rec.attribute8;
395   End If;
396   If (p_rec.attribute9 = hr_api.g_varchar2) then
397     p_rec.attribute9 :=
398     ssp_mat_shd.g_old_rec.attribute9;
399   End If;
400   If (p_rec.attribute10 = hr_api.g_varchar2) then
401     p_rec.attribute10 :=
402     ssp_mat_shd.g_old_rec.attribute10;
403   End If;
404   If (p_rec.attribute11 = hr_api.g_varchar2) then
405     p_rec.attribute11 :=
406     ssp_mat_shd.g_old_rec.attribute11;
407   End If;
408   If (p_rec.attribute12 = hr_api.g_varchar2) then
409     p_rec.attribute12 :=
410     ssp_mat_shd.g_old_rec.attribute12;
411   End If;
412   If (p_rec.attribute13 = hr_api.g_varchar2) then
413     p_rec.attribute13 :=
414     ssp_mat_shd.g_old_rec.attribute13;
415   End If;
416   If (p_rec.attribute14 = hr_api.g_varchar2) then
417     p_rec.attribute14 :=
418     ssp_mat_shd.g_old_rec.attribute14;
419   End If;
420   If (p_rec.attribute15 = hr_api.g_varchar2) then
421     p_rec.attribute15 :=
422     ssp_mat_shd.g_old_rec.attribute15;
423   End If;
424   If (p_rec.attribute16 = hr_api.g_varchar2) then
425     p_rec.attribute16 :=
426     ssp_mat_shd.g_old_rec.attribute16;
427   End If;
428   If (p_rec.attribute17 = hr_api.g_varchar2) then
429     p_rec.attribute17 :=
430     ssp_mat_shd.g_old_rec.attribute17;
431   End If;
432   If (p_rec.attribute18 = hr_api.g_varchar2) then
433     p_rec.attribute18 :=
434     ssp_mat_shd.g_old_rec.attribute18;
435   End If;
436   If (p_rec.attribute19 = hr_api.g_varchar2) then
437     p_rec.attribute19 :=
438     ssp_mat_shd.g_old_rec.attribute19;
439   End If;
440   If (p_rec.attribute20 = hr_api.g_varchar2) then
441     p_rec.attribute20 :=
442     ssp_mat_shd.g_old_rec.attribute20;
443   End If;
444 
445   If (p_rec.LEAVE_TYPE = hr_api.g_varchar2) then
446     p_rec.LEAVE_TYPE :=
447     ssp_mat_shd.g_old_rec.LEAVE_TYPE;
448   End If;
449 
450   If (p_rec.MATCHING_DATE = hr_api.g_date) then
451     p_rec.MATCHING_DATE :=
452     ssp_mat_shd.g_old_rec.MATCHING_DATE;
453   End If;
454 
455   If (p_rec.PLACEMENT_DATE = hr_api.g_date) then
456     p_rec.PLACEMENT_DATE :=
457     ssp_mat_shd.g_old_rec.PLACEMENT_DATE;
458   End If;
459 
460   If (p_rec.DISRUPTED_PLACEMENT_DATE = hr_api.g_date) then
461     p_rec.DISRUPTED_PLACEMENT_DATE :=
462     ssp_mat_shd.g_old_rec.DISRUPTED_PLACEMENT_DATE;
463   End If;
464 
465   If (p_rec.mat_information_category = hr_api.g_varchar2) then
466     p_rec.mat_information_category :=
467     ssp_mat_shd.g_old_rec.mat_information_category;
468   End If;
469   If (p_rec.mat_information1 = hr_api.g_varchar2) then
470     p_rec.mat_information1 :=
471     ssp_mat_shd.g_old_rec.mat_information1;
472   End If;
473   If (p_rec.mat_information1 = hr_api.g_varchar2) then
474     p_rec.mat_information1 :=
475     ssp_mat_shd.g_old_rec.mat_information1;
476   End If;
477   If (p_rec.mat_information2 = hr_api.g_varchar2) then
478     p_rec.mat_information2 :=
479     ssp_mat_shd.g_old_rec.mat_information2;
480   End If;
481   If (p_rec.mat_information3 = hr_api.g_varchar2) then
482     p_rec.mat_information3 :=
483     ssp_mat_shd.g_old_rec.mat_information3;
484   End If;
485   If (p_rec.mat_information4 = hr_api.g_varchar2) then
486     p_rec.mat_information4 :=
487     ssp_mat_shd.g_old_rec.mat_information4;
488   End If;
489   If (p_rec.mat_information5 = hr_api.g_varchar2) then
490     p_rec.mat_information5 :=
491     ssp_mat_shd.g_old_rec.mat_information5;
492   End If;
493   If (p_rec.mat_information6 = hr_api.g_varchar2) then
494     p_rec.mat_information6 :=
495     ssp_mat_shd.g_old_rec.mat_information6;
496   End If;
497   If (p_rec.mat_information7 = hr_api.g_varchar2) then
498     p_rec.mat_information7 :=
499     ssp_mat_shd.g_old_rec.mat_information7;
500   End If;
501   If (p_rec.mat_information8 = hr_api.g_varchar2) then
502     p_rec.mat_information8 :=
503     ssp_mat_shd.g_old_rec.mat_information8;
504   End If;
505   If (p_rec.mat_information9 = hr_api.g_varchar2) then
506     p_rec.mat_information9 :=
507     ssp_mat_shd.g_old_rec.mat_information9;
508   End If;
509   If (p_rec.mat_information10 = hr_api.g_varchar2) then
510     p_rec.mat_information10 :=
511     ssp_mat_shd.g_old_rec.mat_information10;
512   End If;
513   If (p_rec.mat_information11 = hr_api.g_varchar2) then
514     p_rec.mat_information11 :=
515     ssp_mat_shd.g_old_rec.mat_information11;
516   End If;
517   If (p_rec.mat_information12 = hr_api.g_varchar2) then
518     p_rec.mat_information12 :=
519     ssp_mat_shd.g_old_rec.mat_information12;
520   End If;
521   If (p_rec.mat_information13 = hr_api.g_varchar2) then
522     p_rec.mat_information13 :=
523     ssp_mat_shd.g_old_rec.mat_information13;
524   End If;
525   If (p_rec.mat_information14 = hr_api.g_varchar2) then
526     p_rec.mat_information14 :=
527     ssp_mat_shd.g_old_rec.mat_information14;
528   End If;
529   If (p_rec.mat_information15 = hr_api.g_varchar2) then
530     p_rec.mat_information15 :=
531     ssp_mat_shd.g_old_rec.mat_information15;
532   End If;
533   If (p_rec.mat_information16 = hr_api.g_varchar2) then
534     p_rec.mat_information16 :=
535     ssp_mat_shd.g_old_rec.mat_information16;
536   End If;
537   If (p_rec.mat_information17 = hr_api.g_varchar2) then
538     p_rec.mat_information17 :=
539     ssp_mat_shd.g_old_rec.mat_information17;
540   End If;
541   If (p_rec.mat_information18 = hr_api.g_varchar2) then
542     p_rec.mat_information18 :=
543     ssp_mat_shd.g_old_rec.mat_information18;
544   End If;
545   If (p_rec.mat_information19 = hr_api.g_varchar2) then
546     p_rec.mat_information19 :=
547     ssp_mat_shd.g_old_rec.mat_information19;
548   End If;
549   If (p_rec.mat_information20 = hr_api.g_varchar2) then
550     p_rec.mat_information20 :=
551     ssp_mat_shd.g_old_rec.mat_information20;
552   End If;
553   If (p_rec.mat_information21 = hr_api.g_varchar2) then
554     p_rec.mat_information21 :=
555     ssp_mat_shd.g_old_rec.mat_information21;
556   End If;
557   If (p_rec.mat_information22 = hr_api.g_varchar2) then
558     p_rec.mat_information12 :=
559     ssp_mat_shd.g_old_rec.mat_information22;
560   End If;
561   If (p_rec.mat_information23 = hr_api.g_varchar2) then
562     p_rec.mat_information23 :=
563     ssp_mat_shd.g_old_rec.mat_information23;
564   End If;
565   If (p_rec.mat_information24 = hr_api.g_varchar2) then
566     p_rec.mat_information24 :=
567     ssp_mat_shd.g_old_rec.mat_information24;
568   End If;
569   If (p_rec.mat_information25 = hr_api.g_varchar2) then
570     p_rec.mat_information25 :=
571     ssp_mat_shd.g_old_rec.mat_information25;
572   End If;
573   If (p_rec.mat_information26 = hr_api.g_varchar2) then
574     p_rec.mat_information26 :=
575     ssp_mat_shd.g_old_rec.mat_information26;
576   End If;
577   If (p_rec.mat_information27 = hr_api.g_varchar2) then
578     p_rec.mat_information27 :=
579     ssp_mat_shd.g_old_rec.mat_information27;
580   End If;
581   If (p_rec.mat_information28 = hr_api.g_varchar2) then
582     p_rec.mat_information28 :=
583     ssp_mat_shd.g_old_rec.mat_information28;
584   End If;
585   If (p_rec.mat_information29 = hr_api.g_varchar2) then
586     p_rec.mat_information29 :=
587     ssp_mat_shd.g_old_rec.mat_information29;
588   End If;
589   If (p_rec.mat_information30 = hr_api.g_varchar2) then
590     p_rec.mat_information30 :=
591     ssp_mat_shd.g_old_rec.mat_information30;
592   End If;
593   --
594   hr_utility.set_location(' Leaving:'||l_proc, 10);
595 --
596 End convert_defs;
597 --
598 -- ----------------------------------------------------------------------------
599 -- |---------------------------------< upd >----------------------------------|
600 -- ----------------------------------------------------------------------------
601 Procedure upd
602   (
603   p_rec        in out nocopy ssp_mat_shd.g_rec_type,
604   p_validate   in     boolean default false
605   ) is
606 --
607   l_proc  varchar2(72) := g_package||'upd';
608 --
609 Begin
610   hr_utility.set_location('Entering:'||l_proc, 5);
611   --
612   -- Determine if the business process is to be validated.
613   --
614   If p_validate then
615     --
616     -- Issue the savepoint.
617     --
618     SAVEPOINT upd_ssp_mat;
619   End If;
620   --
621   -- We must lock the row which we need to update.
622   --
623   ssp_mat_shd.lck
624 	(
625 	p_rec.maternity_id,
626 	p_rec.object_version_number
627 	);
628   --
629   -- 1. During an update system defaults are used to determine if
630   --    arguments have been defaulted or not. We must therefore
631   --    derive the full record structure values to be updated.
632   --
633   -- 2. Call the supporting update validate operations.
634   --
635   convert_defs(p_rec);
636   ssp_mat_bus.update_validate(p_rec);
637   --
638   -- Call the supporting pre-update operation
639   --
640   pre_update(p_rec);
641   --
642   -- Update the row.
643   --
644   update_dml(p_rec);
645   --
646   -- Call the supporting post-update operation
647   --
648   post_update(p_rec);
649   --
650   -- If we are validating then raise the Validate_Enabled exception
651   --
652   If p_validate then
653     Raise HR_Api.Validate_Enabled;
654   End If;
655   --
656   hr_utility.set_location(' Leaving:'||l_proc, 10);
657 Exception
658   When HR_Api.Validate_Enabled Then
659     --
660     -- As the Validate_Enabled exception has been raised
661     -- we must rollback to the savepoint
662     --
663     ROLLBACK TO upd_ssp_mat;
664 End upd;
665 --
666 -- ----------------------------------------------------------------------------
667 -- |---------------------------------< upd >----------------------------------|
668 -- ----------------------------------------------------------------------------
669 Procedure upd
670   (
671   p_maternity_id                 in number,
672   p_object_version_number        in out nocopy number,
673   p_due_date                     in date             default hr_api.g_date,
674   p_start_date_SMA 		 in date             default hr_api.g_date,
675   p_notification_of_birth_date   in date             default hr_api.g_date,
676   p_unfit_for_scheduled_return   in varchar2         default hr_api.g_varchar2,
677   p_stated_return_date           in date             default hr_api.g_date,
678   p_intend_to_return_flag        in varchar2         default hr_api.g_varchar2,
679   p_start_date_with_new_employer in date             default hr_api.g_date,
680   p_smp_must_be_paid_by_date     in date             default hr_api.g_date,
681   p_pay_smp_as_lump_sum          in varchar2         default hr_api.g_varchar2,
682   p_live_birth_flag              in varchar2         default hr_api.g_varchar2,
683   p_actual_birth_date            in date             default hr_api.g_date,
684   p_mpp_start_date               in date             default hr_api.g_date,
685   p_attribute_category           in varchar2         default hr_api.g_varchar2,
686   p_attribute1                   in varchar2         default hr_api.g_varchar2,
687   p_attribute2                   in varchar2         default hr_api.g_varchar2,
688   p_attribute3                   in varchar2         default hr_api.g_varchar2,
689   p_attribute4                   in varchar2         default hr_api.g_varchar2,
690   p_attribute5                   in varchar2         default hr_api.g_varchar2,
691   p_attribute6                   in varchar2         default hr_api.g_varchar2,
692   p_attribute7                   in varchar2         default hr_api.g_varchar2,
693   p_attribute8                   in varchar2         default hr_api.g_varchar2,
694   p_attribute9                   in varchar2         default hr_api.g_varchar2,
695   p_attribute10                  in varchar2         default hr_api.g_varchar2,
696   p_attribute11                  in varchar2         default hr_api.g_varchar2,
697   p_attribute12                  in varchar2         default hr_api.g_varchar2,
698   p_attribute13                  in varchar2         default hr_api.g_varchar2,
699   p_attribute14                  in varchar2         default hr_api.g_varchar2,
700   p_attribute15                  in varchar2         default hr_api.g_varchar2,
701   p_attribute16                  in varchar2         default hr_api.g_varchar2,
702   p_attribute17                  in varchar2         default hr_api.g_varchar2,
703   p_attribute18                  in varchar2         default hr_api.g_varchar2,
704   p_attribute19                  in varchar2         default hr_api.g_varchar2,
705   p_attribute20                  in varchar2         default hr_api.g_varchar2,
706   p_LEAVE_TYPE                   in VARCHAR2         default 'MA',
707   p_MATCHING_DATE                in DATE             default hr_api.g_date,
708   p_PLACEMENT_DATE               in DATE             default hr_api.g_date,
709   p_DISRUPTED_PLACEMENT_DATE     in DATE             default hr_api.g_date,
710   p_validate                     in boolean          default false,
711   p_mat_information_category     in varchar2         default hr_api.g_varchar2,
712   p_mat_information1             in varchar2         default hr_api.g_varchar2,
713   p_mat_information2             in varchar2         default hr_api.g_varchar2,
714   p_mat_information3             in varchar2         default hr_api.g_varchar2,
715   p_mat_information4             in varchar2         default hr_api.g_varchar2,
716   p_mat_information5             in varchar2         default hr_api.g_varchar2,
717   p_mat_information6             in varchar2         default hr_api.g_varchar2,
718   p_mat_information7             in varchar2         default hr_api.g_varchar2,
719   p_mat_information8             in varchar2         default hr_api.g_varchar2,
720   p_mat_information9             in varchar2         default hr_api.g_varchar2,
721   p_mat_information10            in varchar2         default hr_api.g_varchar2,
722   p_mat_information11            in varchar2         default hr_api.g_varchar2,
723   p_mat_information12            in varchar2         default hr_api.g_varchar2,
724   p_mat_information13            in varchar2         default hr_api.g_varchar2,
725   p_mat_information14            in varchar2         default hr_api.g_varchar2,
726   p_mat_information15            in varchar2         default hr_api.g_varchar2,
727   p_mat_information16            in varchar2         default hr_api.g_varchar2,
728   p_mat_information17            in varchar2         default hr_api.g_varchar2,
729   p_mat_information18            in varchar2         default hr_api.g_varchar2,
730   p_mat_information19            in varchar2         default hr_api.g_varchar2,
731   p_mat_information20            in varchar2         default hr_api.g_varchar2,
732   p_mat_information21            in varchar2         default hr_api.g_varchar2,
733   p_mat_information22            in varchar2         default hr_api.g_varchar2,
734   p_mat_information23            in varchar2         default hr_api.g_varchar2,
735   p_mat_information24            in varchar2         default hr_api.g_varchar2,
736   p_mat_information25            in varchar2         default hr_api.g_varchar2,
737   p_mat_information26            in varchar2         default hr_api.g_varchar2,
738   p_mat_information27            in varchar2         default hr_api.g_varchar2,
739   p_mat_information28            in varchar2         default hr_api.g_varchar2,
740   p_mat_information29            in varchar2         default hr_api.g_varchar2,
741   p_mat_information30            in varchar2         default hr_api.g_varchar2
742   ) is
743 --
744   l_rec	  ssp_mat_shd.g_rec_type;
745   l_proc  varchar2(72) := g_package||'upd';
746 --
747 Begin
748   hr_utility.set_location('Entering:'||l_proc, 5);
749   --
750   -- Call conversion function to turn arguments into the
751   -- l_rec structure.
752   --
753   l_rec :=
754   ssp_mat_shd.convert_args
755   (
756   p_maternity_id,
757   p_due_date,
758   hr_api.g_number,
759   p_start_date_SMA,
760   p_notification_of_birth_date,
761   p_unfit_for_scheduled_return,
762   p_stated_return_date,
763   p_intend_to_return_flag,
764   p_start_date_with_new_employer,
765   p_smp_must_be_paid_by_date,
766   p_pay_smp_as_lump_sum,
767   p_live_birth_flag,
768   p_actual_birth_date,
769   p_mpp_start_date,
770   p_object_version_number,
771   p_attribute_category,
772   p_attribute1,
773   p_attribute2,
774   p_attribute3,
775   p_attribute4,
776   p_attribute5,
777   p_attribute6,
778   p_attribute7,
779   p_attribute8,
780   p_attribute9,
781   p_attribute10,
782   p_attribute11,
783   p_attribute12,
784   p_attribute13,
785   p_attribute14,
786   p_attribute15,
787   p_attribute16,
788   p_attribute17,
789   p_attribute18,
790   p_attribute19,
791   p_attribute20,
792   p_LEAVE_TYPE ,
793   p_MATCHING_DATE,
794   p_PLACEMENT_DATE ,
795   p_DISRUPTED_PLACEMENT_DATE,
796   p_mat_information_category,
797   p_mat_information1,
798   p_mat_information2,
799   p_mat_information3,
800   p_mat_information4,
801   p_mat_information5,
802   p_mat_information6,
803   p_mat_information7,
804   p_mat_information8,
805   p_mat_information9,
806   p_mat_information10,
807   p_mat_information11,
808   p_mat_information12,
809   p_mat_information13,
810   p_mat_information14,
811   p_mat_information15,
812   p_mat_information16,
813   p_mat_information17,
814   p_mat_information18,
815   p_mat_information19,
816   p_mat_information20,
817   p_mat_information21,
818   p_mat_information22,
819   p_mat_information23,
820   p_mat_information24,
821   p_mat_information25,
822   p_mat_information26,
823   p_mat_information27,
824   p_mat_information28,
825   p_mat_information29,
826   p_mat_information30
827   );
828   --
829   -- Having converted the arguments into the
830   -- plsql record structure we call the corresponding record
831   -- business process.
832   --
833   upd(l_rec, p_validate);
834   p_object_version_number := l_rec.object_version_number;
835   --
836   hr_utility.set_location(' Leaving:'||l_proc, 10);
837 End upd;
838 --
839 end ssp_mat_upd;