DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_CTC_UPD

Source


1 Package Body per_ctc_upd as
2 /* $Header: pectcrhi.pkb 115.20 2003/02/11 14:24:18 vramanai ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  per_ctc_upd.';  -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |----------------------------< dt_update_dml >-----------------------------|
12 -- ----------------------------------------------------------------------------
13 -- {Start Of Comments}
14 --
15 -- Description:
16 --   This procedure controls the execution of dml from the datetrack mode
17 --   of CORRECTION only. It is important to note that the object version
18 --   number is only increment by 1 because the datetrack correction is
19 --   soley for one datetracked row.
20 --   This procedure controls the actual dml update logic. The functions of this
21 --   procedure are as follows:
22 --   1) Get the next object_version_number.
23 --   2) To set and unset the g_api_dml status as required (as we are about to
24 --      perform dml).
25 --   3) To update the specified row in the schema using the primary key in
26 --      the predicates.
27 --   4) To trap any constraint violations that may have occurred.
28 --   5) To raise any other errors.
29 --
30 -- Prerequisites:
31 --   This is an internal private procedure which must be called from the
32 --   update_dml procedure.
33 --
34 -- In Parameters:
35 --   A Pl/Sql record structre.
36 --
37 -- Post Success:
38 --   The specified row will be updated in the schema.
39 --
40 -- Post Failure:
41 --   On the update dml failure it is important to note that we always reset the
42 --   g_api_dml status to false.
43 --   If a check or unique integrity constraint violation is raised the
44 --   constraint_error procedure will be called.
45 --   If any other error is reported, the error will be raised after the
46 --   g_api_dml status is reset.
47 --
48 -- Developer Implementation Notes:
49 --   The update 'set' arguments list should be modified if any of your
50 --   attributes are not updateable.
51 --
52 -- Access Status:
53 --   Internal Row Handler Use Only.
54 --
55 -- {End Of Comments}
56 -- ----------------------------------------------------------------------------
57 Procedure dt_update_dml
58 	(p_rec 			 in out nocopy per_ctc_shd.g_rec_type,
59 	 p_effective_date	 in	date,
60 
61 	 p_datetrack_mode	 in	varchar2,
62 	 p_validation_start_date in	date,
63 	 p_validation_end_date	 in	date) is
64 --
65   l_proc	varchar2(72) := g_package||'dt_update_dml';
66 --
67 Begin
68   hr_utility.set_location('Entering:'||l_proc, 5);
69   --
70   If (p_datetrack_mode = 'CORRECTION') then
71     hr_utility.set_location(l_proc, 10);
72     --
73     -- Because we are updating a row we must get the next object
74     -- version number.
75     --
76     p_rec.object_version_number :=
77       dt_api.get_object_version_number
78 	  (p_base_table_name	=> 'per_contracts_f',
79 	   p_base_key_column	=> 'contract_id',
80 	   p_base_key_value	=> p_rec.contract_id);
81     --
82     -- Update the per_contracts_f Row
83     --
84     update  per_contracts_f
85     set
86         contract_id                     = p_rec.contract_id,
87     business_group_id               = p_rec.business_group_id,
88     object_version_number           = p_rec.object_version_number,
89     person_id                       = p_rec.person_id,
90     reference                       = p_rec.reference,
91     type                            = p_rec.type,
92     status                          = p_rec.status,
93     status_reason                   = p_rec.status_reason,
94     doc_status                      = p_rec.doc_status,
95     doc_status_change_date          = p_rec.doc_status_change_date,
96     description                     = p_rec.description,
97     duration                        = p_rec.duration,
98     duration_units                  = p_rec.duration_units,
99     contractual_job_title           = p_rec.contractual_job_title,
100     parties                         = p_rec.parties,
101     start_reason                    = p_rec.start_reason,
102     end_reason                      = p_rec.end_reason,
103     number_of_extensions            = p_rec.number_of_extensions,
104     extension_reason                = p_rec.extension_reason,
105     extension_period                = p_rec.extension_period,
106     extension_period_units          = p_rec.extension_period_units,
107     ctr_information_category        = p_rec.ctr_information_category,
108     ctr_information1                = p_rec.ctr_information1,
109     ctr_information2                = p_rec.ctr_information2,
110     ctr_information3                = p_rec.ctr_information3,
111     ctr_information4                = p_rec.ctr_information4,
112     ctr_information5                = p_rec.ctr_information5,
113     ctr_information6                = p_rec.ctr_information6,
114     ctr_information7                = p_rec.ctr_information7,
115     ctr_information8                = p_rec.ctr_information8,
116     ctr_information9                = p_rec.ctr_information9,
117     ctr_information10               = p_rec.ctr_information10,
118     ctr_information11               = p_rec.ctr_information11,
119     ctr_information12               = p_rec.ctr_information12,
120     ctr_information13               = p_rec.ctr_information13,
121     ctr_information14               = p_rec.ctr_information14,
122     ctr_information15               = p_rec.ctr_information15,
123     ctr_information16               = p_rec.ctr_information16,
124     ctr_information17               = p_rec.ctr_information17,
125     ctr_information18               = p_rec.ctr_information18,
126     ctr_information19               = p_rec.ctr_information19,
127     ctr_information20               = p_rec.ctr_information20,
128     attribute_category              = p_rec.attribute_category,
129     attribute1                      = p_rec.attribute1,
130     attribute2                      = p_rec.attribute2,
131     attribute3                      = p_rec.attribute3,
132     attribute4                      = p_rec.attribute4,
133     attribute5                      = p_rec.attribute5,
134     attribute6                      = p_rec.attribute6,
135     attribute7                      = p_rec.attribute7,
136     attribute8                      = p_rec.attribute8,
137     attribute9                      = p_rec.attribute9,
138     attribute10                     = p_rec.attribute10,
139     attribute11                     = p_rec.attribute11,
140     attribute12                     = p_rec.attribute12,
141     attribute13                     = p_rec.attribute13,
142     attribute14                     = p_rec.attribute14,
143     attribute15                     = p_rec.attribute15,
144     attribute16                     = p_rec.attribute16,
145     attribute17                     = p_rec.attribute17,
146     attribute18                     = p_rec.attribute18,
147     attribute19                     = p_rec.attribute19,
148     attribute20                     = p_rec.attribute20
149     where   contract_id = p_rec.contract_id
150     and     effective_start_date = p_validation_start_date
151     and     effective_end_date   = p_validation_end_date;
152 
153     --
154     -- Set the effective start and end dates
155     --
156     p_rec.effective_start_date := p_validation_start_date;
157     p_rec.effective_end_date   := p_validation_end_date;
158   End If;
159 --
160 hr_utility.set_location(' Leaving:'||l_proc, 15);
161 Exception
162   When hr_api.check_integrity_violated Then
163     -- A check constraint has been violated
164     per_ctc_shd.constraint_error
165       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
166   When hr_api.unique_integrity_violated Then
167     -- Unique integrity has been violated
168     per_ctc_shd.constraint_error
169       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
170   When Others Then
171     Raise;
172 End dt_update_dml;
173 --
174 -- ----------------------------------------------------------------------------
175 -- |------------------------------< update_dml >------------------------------|
176 -- ----------------------------------------------------------------------------
177 -- {Start Of Comments}
178 --
179 -- Description:
180 --   This procedure calls the dt_update_dml control logic which handles
181 --   the actual datetrack dml.
182 --
183 -- Prerequisites:
184 --   This is an internal private procedure which must be called from the upd
185 --   procedure.
186 --
187 
188 -- In Parameters:
189 --   A Pl/Sql record structre.
190 --
191 -- Post Success:
192 --   Processing contines.
193 --
194 -- Post Failure:
195 --   No specific error handling is required within this procedure.
196 --
197 -- Developer Implementation Notes:
198 --   The update 'set' arguments list should be modified if any of your
199 --   attributes are not updateable.
200 --
201 -- Access Status:
202 --   Internal Row Handler Use Only.
203 --
204 -- {End Of Comments}
205 -- ----------------------------------------------------------------------------
206 Procedure update_dml
207 	(p_rec 			 in out nocopy per_ctc_shd.g_rec_type,
208 	 p_effective_date	 in	date,
209 	 p_datetrack_mode	 in	varchar2,
210 	 p_validation_start_date in	date,
211 	 p_validation_end_date	 in	date) is
212 --
213   l_proc	varchar2(72) := g_package||'update_dml';
214 --
215 Begin
216   hr_utility.set_location('Entering:'||l_proc, 5);
217   --
218   dt_update_dml(p_rec			=> p_rec,
219 		p_effective_date	=> p_effective_date,
220 		p_datetrack_mode	=> p_datetrack_mode,
221        		p_validation_start_date	=> p_validation_start_date,
222 		p_validation_end_date	=> p_validation_end_date);
223   --
224   hr_utility.set_location(' Leaving:'||l_proc, 10);
225 End update_dml;
226 --
227 -- ----------------------------------------------------------------------------
228 -- |----------------------------< dt_pre_update >-----------------------------|
229 -- ----------------------------------------------------------------------------
230 -- {Start Of Comments}
231 --
232 -- Description:
233 --   The dt_pre_update procedure controls the execution
234 --   of dml for the datetrack modes of: UPDATE, UPDATE_OVERRIDE
235 --   and UPDATE_CHANGE_INSERT only. The execution required is as
236 --   follows:
237 --
238 --   1) Providing the datetrack update mode is not 'CORRECTION'
239 --      then set the effective end date of the current row (this
240 
241 --      will be the validation_start_date - 1).
242 --   2) If the datetrack mode is 'UPDATE_OVERRIDE' then call the
243 --      corresponding delete_dml process to delete any future rows
244 --      where the effective_start_date is greater than or equal to
245 --	the validation_start_date.
246 --   3) Call the insert_dml process to insert the new updated row
247 --      details..
248 --
249 -- Prerequisites:
250 --   This is an internal procedure which is called from the
251 --   pre_update procedure.
252 --
253 -- In Parameters:
254 --
255 -- Post Success:
256 --   Processing continues.
257 --
258 -- Post Failure:
259 --   If an error has occurred, an error message and exception will be raised
260 --   but not handled.
261 --
262 -- Developer Implementation Notes:
263 --   This is an internal procedure which is required by Datetrack. Don't
264 --   remove or modify.
265 --
266 -- Access Status:
267 --   Internal Row Handler Use Only.
268 --
269 -- {End Of Comments}
270 -- ----------------------------------------------------------------------------
271 Procedure dt_pre_update
272 	(p_rec 			 in out nocopy per_ctc_shd.g_rec_type,
273 	 p_effective_date	 in	date,
274 	 p_datetrack_mode	 in	varchar2,
275 	 p_validation_start_date in	date,
276 	 p_validation_end_date	 in	date) is
277 --
278   l_proc	         varchar2(72) := g_package||'dt_pre_update';
279   l_dummy_version_number number;
280 --
281 Begin
282   hr_utility.set_location('Entering:'||l_proc, 5);
283   If (p_datetrack_mode <> 'CORRECTION') then
284     hr_utility.set_location(l_proc, 10);
285     --
286     -- Update the current effective end date
287     --
288     per_ctc_shd.upd_effective_end_date
289      (p_effective_date	       => p_effective_date,
290       p_base_key_value	       => p_rec.contract_id,
291       p_new_effective_end_date => (p_validation_start_date - 1),
292       p_validation_start_date  => p_validation_start_date,
293       p_validation_end_date    => p_validation_end_date,
294       p_object_version_number  => l_dummy_version_number);
295     --
296     If (p_datetrack_mode = 'UPDATE_OVERRIDE') then
297       hr_utility.set_location(l_proc, 15);
298       --
299       -- As the datetrack mode is 'UPDATE_OVERRIDE' then we must
300       -- delete any future rows
301       --
302       per_ctc_del.delete_dml
303         (p_rec			 => p_rec,
304 	 p_effective_date	 => p_effective_date,
305 	 p_datetrack_mode	 => p_datetrack_mode,
306 	 p_validation_start_date => p_validation_start_date,
307 	 p_validation_end_date   => p_validation_end_date);
308     End If;
309     hr_utility.set_location(l_proc, 20);
310     --
311     -- We must now insert the updated row
312     --
313     per_ctc_ins.insert_dml
314       (p_rec			=> p_rec,
315        p_effective_date		=> p_effective_date,
316        p_datetrack_mode		=> p_datetrack_mode,
317        p_validation_start_date	=> p_validation_start_date,
318        p_validation_end_date	=> p_validation_end_date);
319   End If;
320   hr_utility.set_location(' Leaving:'||l_proc, 20);
321 End dt_pre_update;
322 --
323 -- ----------------------------------------------------------------------------
324 -- |------------------------------< pre_update >------------------------------|
325 -- ----------------------------------------------------------------------------
326 -- {Start Of Comments}
327 --
328 -- Description:
329 --   This private procedure contains any processing which is required before
330 --   the update dml.
331 --
332 -- Prerequisites:
333 --   This is an internal procedure which is called from the upd procedure.
334 --
335 -- In Parameters:
336 --   A Pl/Sql record structre.
337 --
338 -- Post Success:
339 --   Processing continues.
340 --
341 -- Post Failure:
342 --   If an error has occurred, an error message and exception will be raised
343 --   but not handled.
344 --
345 -- Developer Implementation Notes:
346 --   Any pre-processing required before the update dml is issued should be
347 --   coded within this procedure. It is important to note that any 3rd party
348 --   maintenance should be reviewed before placing in this procedure. The call
349 --   to the dt_update_dml procedure should NOT be removed.
350 --
351 -- Access Status:
352 --   Internal Row Handler Use Only.
353 --
354 -- {End Of Comments}
355 -- ----------------------------------------------------------------------------
356 Procedure pre_update
357 	(p_rec 			 in out nocopy per_ctc_shd.g_rec_type,
358 
359 	 p_effective_date	 in	date,
360 	 p_datetrack_mode	 in	varchar2,
361 	 p_validation_start_date in	date,
362 	 p_validation_end_date	 in	date) is
363 --
364   l_proc	varchar2(72) := g_package||'pre_update';
365 --
366 Begin
367   hr_utility.set_location('Entering:'||l_proc, 5);
368   --
369   --
370   --
371   dt_pre_update
372     (p_rec 		     => p_rec,
373      p_effective_date	     => p_effective_date,
374      p_datetrack_mode	     => p_datetrack_mode,
375      p_validation_start_date => p_validation_start_date,
376      p_validation_end_date   => p_validation_end_date);
377   --
378   hr_utility.set_location(' Leaving:'||l_proc, 10);
379 End pre_update;
380 --
381 -- ----------------------------------------------------------------------------
382 -- |-----------------------------< post_update >------------------------------|
383 -- ----------------------------------------------------------------------------
384 -- {Start Of Comments}
385 --
386 -- Description:
387 --   This private procedure contains any processing which is required after the
388 --   update dml.
389 --
390 -- Prerequisites:
391 --   This is an internal procedure which is called from the upd procedure.
392 --
393 -- In Parameters:
394 --   A Pl/Sql record structre.
395 --
396 -- Post Success:
397 --   Processing continues.
398 
399 --
400 -- Post Failure:
401 --   If an error has occurred, an error message and exception will be raised
402 --   but not handled.
403 --
404 -- Developer Implementation Notes:
405 --   Any post-processing required after the update dml is issued should be
406 --   coded within this procedure. It is important to note that any 3rd party
407 --   maintenance should be reviewed before placing in this procedure.
408 --
409 -- Access Status:
410 --   Internal Row Handler Use Only.
411 --
412 -- {End Of Comments}
413 -- ----------------------------------------------------------------------------
414 Procedure post_update
415 	(p_rec 			 in per_ctc_shd.g_rec_type,
416 	 p_effective_date	 in date,
417 	 p_datetrack_mode	 in varchar2,
418 	 p_validation_start_date in date,
419 	 p_validation_end_date	 in date) is
420 --
421   l_proc	varchar2(72) := g_package||'post_update';
422 --
423 Begin
424   hr_utility.set_location('Entering:'||l_proc, 5);
425   --
426   -- Start of API User Hook for post_update.
427   --
428   begin
429     --
430     per_ctc_rku.after_update
431      (
432      p_contract_id                  => p_rec.contract_id,
433      p_effective_start_date         => p_rec.effective_start_date,
434      p_effective_end_date           => p_rec.effective_end_date,
435      p_reference                    => p_rec.reference,
436      p_type                         => p_rec.type,
437      p_status                       => p_rec.status,
438      p_status_reason                => p_rec.status_reason,
439      p_doc_status                   => p_rec.doc_status,
440      p_doc_status_change_date       => p_rec.doc_status_change_date,
441      p_description                  => p_rec.description,
442      p_duration                     => p_rec.duration,
443      p_duration_units               => p_rec.duration_units,
444      p_contractual_job_title        => p_rec.contractual_job_title,
445      p_parties                      => p_rec.parties,
446      p_start_reason                 => p_rec.start_reason,
447      p_end_reason                   => p_rec.end_reason ,
448      p_number_of_extensions         => p_rec.number_of_extensions,
449      p_extension_reason             => p_rec.extension_reason,
450      p_extension_period             => p_rec.extension_period,
451      p_extension_period_units       => p_rec.extension_period_units,
452      p_ctr_information_category     => p_rec.ctr_information_category,
453      p_ctr_information1             => p_rec.ctr_information1,
454      p_ctr_information2             => p_rec.ctr_information2,
455      p_ctr_information3             => p_rec.ctr_information3,
456      p_ctr_information4             => p_rec.ctr_information4,
457      p_ctr_information5             => p_rec.ctr_information5,
458      p_ctr_information6             => p_rec.ctr_information6,
459      p_ctr_information7             => p_rec.ctr_information7,
460      p_ctr_information8             => p_rec.ctr_information8,
461      p_ctr_information9             => p_rec.ctr_information9,
462      p_ctr_information10            => p_rec.ctr_information10,
463      p_ctr_information11            => p_rec.ctr_information11,
464      p_ctr_information12            => p_rec.ctr_information12,
465      p_ctr_information13            => p_rec.ctr_information13,
466      p_ctr_information14            => p_rec.ctr_information14,
467      p_ctr_information15            => p_rec.ctr_information15,
468      p_ctr_information16            => p_rec.ctr_information16,
469      p_ctr_information17            => p_rec.ctr_information17,
470      p_ctr_information18            => p_rec.ctr_information18,
471      p_ctr_information19            => p_rec.ctr_information19,
472      p_ctr_information20            => p_rec.ctr_information20,
473      p_attribute_category           => p_rec.attribute_category,
474      p_attribute1                   => p_rec.attribute1,
475      p_attribute2                   => p_rec.attribute2,
476      p_attribute3                   => p_rec.attribute3,
477      p_attribute4                   => p_rec.attribute4,
478      p_attribute5                   => p_rec.attribute5,
479      p_attribute6                   => p_rec.attribute6,
480      p_attribute7                   => p_rec.attribute7,
481      p_attribute8                   => p_rec.attribute8,
482      p_attribute9                   => p_rec.attribute9,
483      p_attribute10                  => p_rec.attribute10,
484      p_attribute11                  => p_rec.attribute11,
485      p_attribute12                  => p_rec.attribute12,
486      p_attribute13                  => p_rec.attribute13,
487      p_attribute14                  => p_rec.attribute14,
488      p_attribute15                  => p_rec.attribute15,
489      p_attribute16                  => p_rec.attribute16,
490      p_attribute17                  => p_rec.attribute17,
491      p_attribute18                  => p_rec.attribute18,
492      p_attribute19                  => p_rec.attribute19,
493      p_attribute20                  => p_rec.attribute20,
494      p_effective_date               => p_effective_date,
495      p_datetrack_mode               => p_datetrack_mode,
496      p_validation_start_date        => p_validation_start_date,
497      p_validation_end_date          => p_validation_end_date,
498      p_business_group_id_o          => per_ctc_shd.g_old_rec.business_group_id,
499      p_person_id_o                  => per_ctc_shd.g_old_rec.person_id,
500      p_reference_o                  => per_ctc_shd.g_old_rec.reference,
501      p_type_o                       => per_ctc_shd.g_old_rec.type,
502      p_status_o                     => per_ctc_shd.g_old_rec.status,
503      p_status_reason_o              => per_ctc_shd.g_old_rec.status_reason,
504      p_doc_status_o                 => per_ctc_shd.g_old_rec.doc_status,
505      p_doc_status_change_date_o     => per_ctc_shd.g_old_rec.doc_status_change_date,
506      p_description_o                => per_ctc_shd.g_old_rec.description,
507      p_duration_o                   => per_ctc_shd.g_old_rec.duration,
508      p_duration_units_o             => per_ctc_shd.g_old_rec.duration_units,
509      p_contractual_job_title_o      => per_ctc_shd.g_old_rec.contractual_job_title,
510      p_parties_o                    => per_ctc_shd.g_old_rec.parties,
511      p_start_reason_o               => per_ctc_shd.g_old_rec.start_reason,
512      p_end_reason_o                 => per_ctc_shd.g_old_rec.end_reason ,
513      p_number_of_extensions_o       => per_ctc_shd.g_old_rec.number_of_extensions,
514      p_extension_reason_o           => per_ctc_shd.g_old_rec.extension_reason,
515      p_extension_period_o           => per_ctc_shd.g_old_rec.extension_period,
516      p_extension_period_units_o     => per_ctc_shd.g_old_rec.extension_period_units,
517      p_ctr_information_category_o   => per_ctc_shd.g_old_rec.ctr_information_category,
518      p_ctr_information1_o           => per_ctc_shd.g_old_rec.ctr_information1,
519      p_ctr_information2_o           => per_ctc_shd.g_old_rec.ctr_information2,
520      p_ctr_information3_o           => per_ctc_shd.g_old_rec.ctr_information3,
521      p_ctr_information4_o           => per_ctc_shd.g_old_rec.ctr_information4,
522      p_ctr_information5_o           => per_ctc_shd.g_old_rec.ctr_information5,
523      p_ctr_information6_o           => per_ctc_shd.g_old_rec.ctr_information6,
524      p_ctr_information7_o           => per_ctc_shd.g_old_rec.ctr_information7,
525      p_ctr_information8_o           => per_ctc_shd.g_old_rec.ctr_information8,
526      p_ctr_information9_o           => per_ctc_shd.g_old_rec.ctr_information9,
527      p_ctr_information10_o          => per_ctc_shd.g_old_rec.ctr_information10,
528      p_ctr_information11_o          => per_ctc_shd.g_old_rec.ctr_information11,
529      p_ctr_information12_o          => per_ctc_shd.g_old_rec.ctr_information12,
530      p_ctr_information13_o          => per_ctc_shd.g_old_rec.ctr_information13,
531      p_ctr_information14_o          => per_ctc_shd.g_old_rec.ctr_information14,
532      p_ctr_information15_o          => per_ctc_shd.g_old_rec.ctr_information15,
533      p_ctr_information16_o          => per_ctc_shd.g_old_rec.ctr_information16,
534      p_ctr_information17_o          => per_ctc_shd.g_old_rec.ctr_information17,
535      p_ctr_information18_o          => per_ctc_shd.g_old_rec.ctr_information18,
536      p_ctr_information19_o          => per_ctc_shd.g_old_rec.ctr_information19,
537      p_ctr_information20_o          => per_ctc_shd.g_old_rec.ctr_information20,
538      p_attribute_category_o         => per_ctc_shd.g_old_rec.attribute_category,
539      p_attribute1_o                 => per_ctc_shd.g_old_rec.attribute1,
540      p_attribute2_o                 => per_ctc_shd.g_old_rec.attribute2,
541      p_attribute3_o                 => per_ctc_shd.g_old_rec.attribute3,
542      p_attribute4_o                 => per_ctc_shd.g_old_rec.attribute4,
543      p_attribute5_o                 => per_ctc_shd.g_old_rec.attribute5,
544      p_attribute6_o                 => per_ctc_shd.g_old_rec.attribute6,
545      p_attribute7_o                 => per_ctc_shd.g_old_rec.attribute7,
546      p_attribute8_o                 => per_ctc_shd.g_old_rec.attribute8,
547      p_attribute9_o                 => per_ctc_shd.g_old_rec.attribute9,
548      p_attribute10_o                => per_ctc_shd.g_old_rec.attribute10,
549      p_attribute11_o                => per_ctc_shd.g_old_rec.attribute11,
550      p_attribute12_o                => per_ctc_shd.g_old_rec.attribute12,
551      p_attribute13_o                => per_ctc_shd.g_old_rec.attribute13,
552      p_attribute14_o                => per_ctc_shd.g_old_rec.attribute14,
553      p_attribute15_o                => per_ctc_shd.g_old_rec.attribute15,
554      p_attribute16_o                => per_ctc_shd.g_old_rec.attribute16,
555      p_attribute17_o                => per_ctc_shd.g_old_rec.attribute17,
556      p_attribute18_o                => per_ctc_shd.g_old_rec.attribute18,
557      p_attribute19_o                => per_ctc_shd.g_old_rec.attribute19,
558      p_attribute20_o                => per_ctc_shd.g_old_rec.attribute20,
559      p_object_version_number_o      => per_ctc_shd.g_old_rec.object_version_number,
560      p_effective_start_date_o       => per_ctc_shd.g_old_rec.effective_start_date,
561      p_effective_end_date_o         => per_ctc_shd.g_old_rec.effective_end_date
562      );
563     --
564   exception
565     --
566     when hr_api.cannot_find_prog_unit then
567       --
568       hr_api.cannot_find_prog_unit_error
569         (p_module_name => 'per_contracts_f'
570         ,p_hook_type   => 'AU');
571       --
572   end;
573   --
574   -- End of API User Hook for post_update.
575   --
576   hr_utility.set_location(' Leaving:'||l_proc, 10);
577 End  post_update;
578 --
579 -- ----------------------------------------------------------------------------
580 -- |-----------------------------< convert_defs >-----------------------------|
581 -- ----------------------------------------------------------------------------
582 -- {Start Of Comments}
583 --
584 -- Description:
585 --   The Convert_Defs procedure has one very important function:
586 --   It must return the record structure for the row with all system defaulted
587 --   values converted into its corresponding parameter value for update. When
588 --   we attempt to update a row through the Upd process , certain
589 --   parameters can be defaulted which enables flexibility in the calling of
590 --   the upd process (e.g. only attributes which need to be updated need to be
591 --   specified). For the upd process to determine which attributes
592 --   have NOT been specified we need to check if the parameter has a reserved
593 --   system default value. Therefore, for all parameters which have a
594 --   corresponding reserved system default mechanism specified we need to
595 --   check if a system default is being used. If a system default is being
596 --   used then we convert the defaulted value into its corresponding attribute
597 --   value held in the g_old_rec data structure.
598 --
599 -- Prerequisites:
600 --   This private function can only be called from the upd process.
601 --
602 -- In Parameters:
603 --   A Pl/Sql record structre.
604 --
605 -- Post Success:
606 --   The record structure will be returned with all system defaulted parameter
607 --   values converted into its current row attribute value.
608 --
609 -- Post Failure:
610 --   No direct error handling is required within this function. Any possible
611 --   errors within this procedure will be a PL/SQL value error due to conversion
612 --   of datatypes or data lengths.
613 --
614 
615 -- Developer Implementation Notes:
616 --   None.
617 --
618 -- Access Status:
619 --   Internal Row Handler Use Only.
620 --
621 -- {End Of Comments}
622 -- ----------------------------------------------------------------------------
623 Procedure convert_defs(p_rec in out nocopy per_ctc_shd.g_rec_type) is
624 --
625   l_proc  varchar2(72) := g_package||'convert_defs';
626 --
627 Begin
628   --
629   hr_utility.set_location('Entering:'||l_proc, 5);
630   --
631   -- We must now examine each argument value in the
632   -- p_rec plsql record structure
633   -- to see if a system default is being used. If a system default
634   -- is being used then we must set to the 'current' argument value.
635   --
636   If (p_rec.business_group_id = hr_api.g_number) then
637     p_rec.business_group_id :=
638     per_ctc_shd.g_old_rec.business_group_id;
639   End If;
640   If (p_rec.person_id = hr_api.g_number) then
641     p_rec.person_id :=
642     per_ctc_shd.g_old_rec.person_id;
643   End If;
644   If (p_rec.reference = hr_api.g_varchar2) then
645     p_rec.reference :=
646     per_ctc_shd.g_old_rec.reference;
647   End If;
648   If (p_rec.type = hr_api.g_varchar2) then
649     p_rec.type :=
650     per_ctc_shd.g_old_rec.type;
651   End If;
652   If (p_rec.status = hr_api.g_varchar2) then
653     p_rec.status :=
654     per_ctc_shd.g_old_rec.status;
655   End If;
656   If (p_rec.status_reason = hr_api.g_varchar2) then
657     p_rec.status_reason :=
658     per_ctc_shd.g_old_rec.status_reason;
659   End if;
660   If (p_rec.doc_status = hr_api.g_varchar2) then
661     p_rec.doc_status :=
662     per_ctc_shd.g_old_rec.doc_status;
663   End If;
664   If (p_rec.doc_status_change_date = hr_api.g_date) then
665     p_rec.doc_status_change_date :=
666     per_ctc_shd.g_old_rec.doc_status_change_date;
667   End If;
668   If (p_rec.description = hr_api.g_varchar2) then
669     p_rec.description :=
670     per_ctc_shd.g_old_rec.description;
671   End If;
672   If (p_rec.duration = hr_api.g_number) then
673     p_rec.duration :=
674     per_ctc_shd.g_old_rec.duration;
675   End If;
676   If (p_rec.duration_units = hr_api.g_varchar2) then
677     p_rec.duration_units :=
678     per_ctc_shd.g_old_rec.duration_units;
679   End If;
680   If (p_rec.contractual_job_title = hr_api.g_varchar2) then
681     p_rec.contractual_job_title :=
682     per_ctc_shd.g_old_rec.contractual_job_title;
683   End If;
684   If (p_rec.parties = hr_api.g_varchar2) then
685     p_rec.parties :=
686     per_ctc_shd.g_old_rec.parties;
687   End If;
688   If (p_rec.start_reason = hr_api.g_varchar2) then
689     p_rec.start_reason :=
690     per_ctc_shd.g_old_rec.start_reason;
691   End If;
692   If (p_rec.end_reason = hr_api.g_varchar2) then
693     p_rec.end_reason :=
694     per_ctc_shd.g_old_rec.end_reason;
695   End If;
696   If (p_rec.number_of_extensions = hr_api.g_number) then
697     p_rec.number_of_extensions :=
698     per_ctc_shd.g_old_rec.number_of_extensions;
699   End If;
700   If (p_rec.extension_reason = hr_api.g_varchar2) then
701     p_rec.extension_reason :=
702     per_ctc_shd.g_old_rec.extension_reason;
703   End If;
704   If (p_rec.extension_period = hr_api.g_number) then
705     p_rec.extension_period :=
706     per_ctc_shd.g_old_rec.extension_period;
707   End If;
708   If (p_rec.extension_period_units = hr_api.g_varchar2) then
709     p_rec.extension_period_units :=
710     per_ctc_shd.g_old_rec.extension_period_units;
711   End If;
712   If (p_rec.ctr_information_category = hr_api.g_varchar2) then
713     p_rec.ctr_information_category :=
714     per_ctc_shd.g_old_rec.ctr_information_category;
715   End If;
716   If (p_rec.ctr_information1 = hr_api.g_varchar2) then
717     p_rec.ctr_information1 :=
718     per_ctc_shd.g_old_rec.ctr_information1;
719   End If;
720   If (p_rec.ctr_information2 = hr_api.g_varchar2) then
721     p_rec.ctr_information2 :=
722     per_ctc_shd.g_old_rec.ctr_information2;
723   End If;
724   If (p_rec.ctr_information3 = hr_api.g_varchar2) then
725     p_rec.ctr_information3 :=
726     per_ctc_shd.g_old_rec.ctr_information3;
727   End If;
728   If (p_rec.ctr_information4 = hr_api.g_varchar2) then
729     p_rec.ctr_information4 :=
730     per_ctc_shd.g_old_rec.ctr_information4;
731   End If;
732   If (p_rec.ctr_information5 = hr_api.g_varchar2) then
733     p_rec.ctr_information5 :=
734     per_ctc_shd.g_old_rec.ctr_information5;
735   End If;
736   If (p_rec.ctr_information6 = hr_api.g_varchar2) then
737     p_rec.ctr_information6 :=
738     per_ctc_shd.g_old_rec.ctr_information6;
739   End If;
740   If (p_rec.ctr_information7 = hr_api.g_varchar2) then
741     p_rec.ctr_information7 :=
742     per_ctc_shd.g_old_rec.ctr_information7;
743   End If;
744   If (p_rec.ctr_information8 = hr_api.g_varchar2) then
745     p_rec.ctr_information8 :=
746     per_ctc_shd.g_old_rec.ctr_information8;
747   End If;
748   If (p_rec.ctr_information9 = hr_api.g_varchar2) then
749     p_rec.ctr_information9 :=
750     per_ctc_shd.g_old_rec.ctr_information9;
751   End If;
752   If (p_rec.ctr_information10 = hr_api.g_varchar2) then
753     p_rec.ctr_information10 :=
754     per_ctc_shd.g_old_rec.ctr_information10;
755   End If;
756   If (p_rec.ctr_information11 = hr_api.g_varchar2) then
757     p_rec.ctr_information11 :=
758     per_ctc_shd.g_old_rec.ctr_information11;
759   End If;
760   If (p_rec.ctr_information12 = hr_api.g_varchar2) then
761     p_rec.ctr_information12 :=
762     per_ctc_shd.g_old_rec.ctr_information12;
763   End If;
764   If (p_rec.ctr_information13 = hr_api.g_varchar2) then
765     p_rec.ctr_information13 :=
766     per_ctc_shd.g_old_rec.ctr_information13;
767   End If;
768   If (p_rec.ctr_information14 = hr_api.g_varchar2) then
769     p_rec.ctr_information14 :=
770     per_ctc_shd.g_old_rec.ctr_information14;
771   End If;
772   If (p_rec.ctr_information15 = hr_api.g_varchar2) then
773     p_rec.ctr_information15 :=
774     per_ctc_shd.g_old_rec.ctr_information15;
775   End If;
776   If (p_rec.ctr_information16 = hr_api.g_varchar2) then
777     p_rec.ctr_information16 :=
778     per_ctc_shd.g_old_rec.ctr_information16;
779   End If;
780   If (p_rec.ctr_information17 = hr_api.g_varchar2) then
781     p_rec.ctr_information17 :=
782     per_ctc_shd.g_old_rec.ctr_information17;
783   End If;
784   If (p_rec.ctr_information18 = hr_api.g_varchar2) then
785     p_rec.ctr_information18 :=
786     per_ctc_shd.g_old_rec.ctr_information18;
787   End If;
788   If (p_rec.ctr_information19 = hr_api.g_varchar2) then
789     p_rec.ctr_information19 :=
790     per_ctc_shd.g_old_rec.ctr_information19;
791   End If;
792   If (p_rec.ctr_information20 = hr_api.g_varchar2) then
793     p_rec.ctr_information20 :=
794     per_ctc_shd.g_old_rec.ctr_information20;
795   End If;
796   If (p_rec.attribute_category = hr_api.g_varchar2) then
797     p_rec.attribute_category :=
798     per_ctc_shd.g_old_rec.attribute_category;
799   End If;
800   If (p_rec.attribute1 = hr_api.g_varchar2) then
801     p_rec.attribute1 :=
802     per_ctc_shd.g_old_rec.attribute1;
803   End If;
804   If (p_rec.attribute2 = hr_api.g_varchar2) then
805     p_rec.attribute2 :=
806     per_ctc_shd.g_old_rec.attribute2;
807   End If;
808   If (p_rec.attribute3 = hr_api.g_varchar2) then
809     p_rec.attribute3 :=
810     per_ctc_shd.g_old_rec.attribute3;
811   End If;
812   If (p_rec.attribute4 = hr_api.g_varchar2) then
813     p_rec.attribute4 :=
814     per_ctc_shd.g_old_rec.attribute4;
815   End If;
816   If (p_rec.attribute5 = hr_api.g_varchar2) then
817     p_rec.attribute5 :=
818     per_ctc_shd.g_old_rec.attribute5;
819   End If;
820   If (p_rec.attribute6 = hr_api.g_varchar2) then
821     p_rec.attribute6 :=
822     per_ctc_shd.g_old_rec.attribute6;
823   End If;
824   If (p_rec.attribute7 = hr_api.g_varchar2) then
825     p_rec.attribute7 :=
826     per_ctc_shd.g_old_rec.attribute7;
827   End If;
828   If (p_rec.attribute8 = hr_api.g_varchar2) then
829     p_rec.attribute8 :=
830     per_ctc_shd.g_old_rec.attribute8;
831   End If;
832   If (p_rec.attribute9 = hr_api.g_varchar2) then
833     p_rec.attribute9 :=
834     per_ctc_shd.g_old_rec.attribute9;
835   End If;
836   If (p_rec.attribute10 = hr_api.g_varchar2) then
837     p_rec.attribute10 :=
838     per_ctc_shd.g_old_rec.attribute10;
839   End If;
840   If (p_rec.attribute11 = hr_api.g_varchar2) then
841     p_rec.attribute11 :=
842     per_ctc_shd.g_old_rec.attribute11;
843   End If;
844   If (p_rec.attribute12 = hr_api.g_varchar2) then
845     p_rec.attribute12 :=
846     per_ctc_shd.g_old_rec.attribute12;
847   End If;
848   If (p_rec.attribute13 = hr_api.g_varchar2) then
849     p_rec.attribute13 :=
850     per_ctc_shd.g_old_rec.attribute13;
851   End If;
852   If (p_rec.attribute14 = hr_api.g_varchar2) then
853     p_rec.attribute14 :=
854     per_ctc_shd.g_old_rec.attribute14;
855   End If;
856   If (p_rec.attribute15 = hr_api.g_varchar2) then
857 
858     p_rec.attribute15 :=
859     per_ctc_shd.g_old_rec.attribute15;
860   End If;
861   If (p_rec.attribute16 = hr_api.g_varchar2) then
862     p_rec.attribute16 :=
863     per_ctc_shd.g_old_rec.attribute16;
864   End If;
865   If (p_rec.attribute17 = hr_api.g_varchar2) then
866     p_rec.attribute17 :=
867     per_ctc_shd.g_old_rec.attribute17;
868   End If;
869   If (p_rec.attribute18 = hr_api.g_varchar2) then
870     p_rec.attribute18 :=
871     per_ctc_shd.g_old_rec.attribute18;
872   End If;
873   If (p_rec.attribute19 = hr_api.g_varchar2) then
874     p_rec.attribute19 :=
875     per_ctc_shd.g_old_rec.attribute19;
876   End If;
877   If (p_rec.attribute20 = hr_api.g_varchar2) then
878     p_rec.attribute20 :=
879     per_ctc_shd.g_old_rec.attribute20;
880   End If;
881   --
882   hr_utility.set_location(' Leaving:'||l_proc, 10);
883 --
884 End convert_defs;
885 --
886 -- ----------------------------------------------------------------------------
887 -- |---------------------------------< upd >----------------------------------|
888 -- ----------------------------------------------------------------------------
889 Procedure upd
890   (
891   p_rec			in out nocopy 	per_ctc_shd.g_rec_type,
892   p_effective_date	in 	date,
893   p_datetrack_mode	in 	varchar2
894   ) is
895 --
896   l_proc			varchar2(72) := g_package||'upd';
897   l_validation_start_date	date;
898   l_validation_end_date		date;
899 --
900 Begin
901   hr_utility.set_location('Entering:'||l_proc, 5);
902   --
903   -- Ensure that the DateTrack update mode is valid
904   --
905   dt_api.validate_dt_upd_mode(p_datetrack_mode => p_datetrack_mode);
906   --
907   -- We must lock the row which we need to update.
908   --
909   per_ctc_shd.lck
910 
911 	(p_effective_date	 => p_effective_date,
912       	 p_datetrack_mode	 => p_datetrack_mode,
913       	 p_contract_id	 => p_rec.contract_id,
914       	 p_object_version_number => p_rec.object_version_number,
915       	 p_validation_start_date => l_validation_start_date,
916       	 p_validation_end_date	 => l_validation_end_date);
917   --
918   -- 1. During an update system defaults are used to determine if
919   --    arguments have been defaulted or not. We must therefore
920   --    derive the full record structure values to be updated.
921   --
922   -- 2. Call the supporting update validate operations.
923   --
924   convert_defs(p_rec);
925   per_ctc_bus.update_validate
926 	(p_rec			 => p_rec,
927 	 p_effective_date	 => p_effective_date,
928 	 p_datetrack_mode  	 => p_datetrack_mode,
929 	 p_validation_start_date => l_validation_start_date,
930 	 p_validation_end_date	 => l_validation_end_date);
931   --
932   -- Call the supporting pre-update operation
933   --
934   pre_update
935 	(p_rec			 => p_rec,
936 	 p_effective_date	 => p_effective_date,
937 	 p_datetrack_mode	 => p_datetrack_mode,
938 	 p_validation_start_date => l_validation_start_date,
939 	 p_validation_end_date	 => l_validation_end_date);
940   --
941   -- Update the row.
942   --
943   update_dml
944 	(p_rec			 => p_rec,
945 	 p_effective_date	 => p_effective_date,
946 	 p_datetrack_mode	 => p_datetrack_mode,
947 	 p_validation_start_date => l_validation_start_date,
948 	 p_validation_end_date	 => l_validation_end_date);
949   --
950   -- Call the supporting post-update operation
951   --
952   post_update
953 	(p_rec			 => p_rec,
954 	 p_effective_date	 => p_effective_date,
955 	 p_datetrack_mode	 => p_datetrack_mode,
956 	 p_validation_start_date => l_validation_start_date,
957 	 p_validation_end_date	 => l_validation_end_date);
958 End upd;
959 --
960 -- ----------------------------------------------------------------------------
961 -- |---------------------------------< upd >----------------------------------|
962 -- ----------------------------------------------------------------------------
963 Procedure upd
964   (
965   p_contract_id                  in number,
966   p_effective_start_date         out nocopy date,
967   p_effective_end_date           out nocopy date,
968   p_object_version_number        in out nocopy number,
969   p_reference                    in varchar2         default hr_api.g_varchar2,
970   p_type                         in varchar2         default hr_api.g_varchar2,
971   p_status                       in varchar2         default hr_api.g_varchar2,
972   p_status_reason                in varchar2         default hr_api.g_varchar2,
973   p_doc_status                   in varchar2         default hr_api.g_varchar2,
974   p_doc_status_change_date       in date             default hr_api.g_date,
975   p_description                  in varchar2         default hr_api.g_varchar2,
976   p_duration                     in number           default hr_api.g_number,
977   p_duration_units               in varchar2         default hr_api.g_varchar2,
978   p_contractual_job_title        in varchar2         default hr_api.g_varchar2,
979   p_parties                      in varchar2         default hr_api.g_varchar2,
980   p_start_reason                 in varchar2         default hr_api.g_varchar2,
981   p_end_reason                   in varchar2         default hr_api.g_varchar2,
982   p_number_of_extensions         in number           default hr_api.g_number,
983   p_extension_reason             in varchar2         default hr_api.g_varchar2,
984   p_extension_period             in number           default hr_api.g_number,
985   p_extension_period_units       in varchar2         default hr_api.g_varchar2,
986   p_ctr_information_category     in varchar2         default hr_api.g_varchar2,
987   p_ctr_information1             in varchar2         default hr_api.g_varchar2,
988   p_ctr_information2             in varchar2         default hr_api.g_varchar2,
989   p_ctr_information3             in varchar2         default hr_api.g_varchar2,
990   p_ctr_information4             in varchar2         default hr_api.g_varchar2,
991   p_ctr_information5             in varchar2         default hr_api.g_varchar2,
992   p_ctr_information6             in varchar2         default hr_api.g_varchar2,
993   p_ctr_information7             in varchar2         default hr_api.g_varchar2,
994   p_ctr_information8             in varchar2         default hr_api.g_varchar2,
995   p_ctr_information9             in varchar2         default hr_api.g_varchar2,
996   p_ctr_information10            in varchar2         default hr_api.g_varchar2,
997   p_ctr_information11            in varchar2         default hr_api.g_varchar2,
998   p_ctr_information12            in varchar2         default hr_api.g_varchar2,
999   p_ctr_information13            in varchar2         default hr_api.g_varchar2,
1000   p_ctr_information14            in varchar2         default hr_api.g_varchar2,
1001   p_ctr_information15            in varchar2         default hr_api.g_varchar2,
1002   p_ctr_information16            in varchar2         default hr_api.g_varchar2,
1003   p_ctr_information17            in varchar2         default hr_api.g_varchar2,
1004   p_ctr_information18            in varchar2         default hr_api.g_varchar2,
1005   p_ctr_information19            in varchar2         default hr_api.g_varchar2,
1006   p_ctr_information20            in varchar2         default hr_api.g_varchar2,
1007   p_attribute_category           in varchar2         default hr_api.g_varchar2,
1008   p_attribute1                   in varchar2         default hr_api.g_varchar2,
1009   p_attribute2                   in varchar2         default hr_api.g_varchar2,
1010   p_attribute3                   in varchar2         default hr_api.g_varchar2,
1011   p_attribute4                   in varchar2         default hr_api.g_varchar2,
1012   p_attribute5                   in varchar2         default hr_api.g_varchar2,
1013   p_attribute6                   in varchar2         default hr_api.g_varchar2,
1014   p_attribute7                   in varchar2         default hr_api.g_varchar2,
1015   p_attribute8                   in varchar2         default hr_api.g_varchar2,
1016   p_attribute9                   in varchar2         default hr_api.g_varchar2,
1017   p_attribute10                  in varchar2         default hr_api.g_varchar2,
1018   p_attribute11                  in varchar2         default hr_api.g_varchar2,
1019   p_attribute12                  in varchar2         default hr_api.g_varchar2,
1020   p_attribute13                  in varchar2         default hr_api.g_varchar2,
1021   p_attribute14                  in varchar2         default hr_api.g_varchar2,
1022   p_attribute15                  in varchar2         default hr_api.g_varchar2,
1023   p_attribute16                  in varchar2         default hr_api.g_varchar2,
1024   p_attribute17                  in varchar2         default hr_api.g_varchar2,
1025   p_attribute18                  in varchar2         default hr_api.g_varchar2,
1026   p_attribute19                  in varchar2         default hr_api.g_varchar2,
1027   p_attribute20                  in varchar2         default hr_api.g_varchar2,
1028   p_effective_date		 in date,
1029   p_datetrack_mode		 in varchar2
1030   ) is
1031 --
1032   l_rec		per_ctc_shd.g_rec_type;
1033   l_proc	varchar2(72) := g_package||'upd';
1034 --
1035 Begin
1036   hr_utility.set_location('Entering:'||l_proc, 5);
1037   --
1038   -- Call conversion function to turn arguments into the
1039   -- l_rec structure.
1040   --
1041   l_rec :=
1042   per_ctc_shd.convert_args
1043   (
1044   p_contract_id,
1045   null,
1046   null,
1047   hr_api.g_number,
1048   p_object_version_number,
1049   hr_api.g_number,
1050   p_reference,
1051   p_type,
1052   p_status,
1053   p_status_reason,
1054   p_doc_status,
1055   p_doc_status_change_date,
1056   p_description,
1057   p_duration,
1058   p_duration_units,
1059   p_contractual_job_title,
1060   p_parties,
1061   p_start_reason,
1062   p_end_reason,
1063   p_number_of_extensions,
1064   p_extension_reason,
1065   p_extension_period,
1066   p_extension_period_units,
1067   p_ctr_information_category,
1068   p_ctr_information1,
1069   p_ctr_information2,
1070   p_ctr_information3,
1071   p_ctr_information4,
1072   p_ctr_information5,
1073   p_ctr_information6,
1074   p_ctr_information7,
1075   p_ctr_information8,
1076   p_ctr_information9,
1077   p_ctr_information10,
1078   p_ctr_information11,
1079   p_ctr_information12,
1080   p_ctr_information13,
1081   p_ctr_information14,
1082   p_ctr_information15,
1083   p_ctr_information16,
1084   p_ctr_information17,
1085   p_ctr_information18,
1086   p_ctr_information19,
1087   p_ctr_information20,
1088   p_attribute_category,
1089   p_attribute1,
1090   p_attribute2,
1091   p_attribute3,
1092   p_attribute4,
1093   p_attribute5,
1094   p_attribute6,
1095   p_attribute7,
1096   p_attribute8,
1097   p_attribute9,
1098   p_attribute10,
1099   p_attribute11,
1100   p_attribute12,
1101   p_attribute13,
1102   p_attribute14,
1103   p_attribute15,
1104   p_attribute16,
1105   p_attribute17,
1106   p_attribute18,
1107   p_attribute19,
1108   p_attribute20
1109   );
1110   --
1111   -- Having converted the arguments into the
1112   -- plsql record structure we call the corresponding record
1113   -- business process.
1114   --
1115   upd(l_rec, p_effective_date, p_datetrack_mode);
1116   p_object_version_number       := l_rec.object_version_number;
1117   p_effective_start_date        := l_rec.effective_start_date;
1118   p_effective_end_date          := l_rec.effective_end_date;
1119   --
1120   --
1121   hr_utility.set_location(' Leaving:'||l_proc, 10);
1122 End upd;
1123 --
1124 -- ----------------------------------------------------------------------------
1125 -- |-----------------------< update_effective_start_date>---------------------|
1126 -- ----------------------------------------------------------------------------
1127 --
1128 -- This is called from maintain_contracts, used when hire date or application
1129 -- date changes.
1130 --
1131 procedure update_effective_start_date
1132   (
1133   p_contract_id		  in  	per_contracts_f.contract_id%TYPE,
1134   p_effective_date        in    date,
1135   p_new_start_date        in 	per_contracts_f.effective_start_date%TYPE,
1136   p_object_version_number in    per_contracts_f.object_version_number%TYPE
1137   ) is
1138   --
1139   l_proc	varchar2(72) := g_package||'update_effective_start_date';
1140   --
1141 begin
1142   --
1143   hr_utility.set_location('Entering:'||l_proc, 5);
1144   --
1145   hr_api.mandatory_arg_error
1146     (p_api_name       => l_proc,
1147      p_argument       => 'contract_id',
1148      p_argument_value => p_contract_id);
1149   --
1150   hr_api.mandatory_arg_error
1151     (p_api_name       => l_proc,
1152      p_argument       => 'p_effective_date',
1153      p_argument_value => p_effective_date);
1154   --
1155   hr_api.mandatory_arg_error
1156     (p_api_name       => l_proc,
1157      p_argument       => 'p_new_start_date',
1158      p_argument_value => p_new_start_date);
1159   --
1160   hr_api.mandatory_arg_error
1161     (p_api_name       => l_proc,
1162      p_argument       => 'object_version_number',
1163      p_argument_value => p_object_version_number);
1164   --
1165   -- We must lock the row which we need to update.
1166   --
1167   per_ctc_shd.lock_record
1168     (p_contract_id,
1169      p_effective_date,
1170      p_object_version_number
1171     );
1172   --
1173   hr_utility.set_location('Entering:'||l_proc, 10);
1174   --
1175   -- update the row
1176   --
1177   update per_contracts_f
1178     set effective_start_date = p_new_start_date
1179     where contract_id = p_contract_id and
1180           p_effective_date between effective_start_date
1181 			       and effective_end_date;
1182 exception when others then
1183   --
1184   -- An unhandled or unexpected error has occurred which
1185   -- we must report
1186   --
1187   hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
1188   hr_utility.set_message_token('PROCEDURE', l_proc);
1189   hr_utility.set_message_token('STEP','20');
1190   hr_utility.raise_error;
1191   --
1192 end update_effective_start_date;
1193 --
1194 end per_ctc_upd;
1195 --