DBA Data[Home] [Help]

PACKAGE BODY: APPS.IRC_IRF_UPD

Source


1 Package Body irc_irf_upd as
2 /* $Header: irirfrhi.pkb 120.1 2008/04/16 07:34:32 vmummidi noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  irc_irf_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
21 --   this 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 structure.
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 irc_irf_shd.g_rec_type
59   ,p_effective_date        in date
60   ,p_datetrack_mode        in varchar2
61   ,p_validation_start_date in date
62   ,p_validation_end_date   in date
63   ) 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 = hr_api.g_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      irc_irf_shd.get_object_version_number
78         (p_referral_info_id =>  p_rec.referral_info_id
79       );
80     --
81     --
82     --
83     -- Update the irc_referral_info Row
84     --
85     update  irc_referral_info
86     set
87      referral_info_id               = p_rec.referral_info_id
88     ,start_date                     = p_rec.start_date
89     ,end_date            	        = p_rec.end_date
90     ,source_type            		= p_rec.source_type
91     ,source_name            		= p_rec.source_name
92     ,source_criteria1               = p_rec.source_criteria1
93     ,source_value1            	    = p_rec.source_value1
94     ,source_criteria2               = p_rec.source_criteria2
95     ,source_value2            	    = p_rec.source_value2
96     ,source_criteria3               = p_rec.source_criteria3
97     ,source_value3                  = p_rec.source_value3
98     ,source_criteria4               = p_rec.source_criteria4
99     ,source_value4                  = p_rec.source_value4
100     ,source_criteria5               = p_rec.source_criteria5
101     ,source_value5                  = p_rec.source_value5
102     ,source_person_id               = p_rec.source_person_id
103     ,candidate_comment              = p_rec.candidate_comment
104     ,employee_comment               = p_rec.employee_comment
105     ,irf_attribute_category         = p_rec.irf_attribute_category
106     ,irf_attribute1                 = p_rec.irf_attribute1
107     ,irf_attribute2                 = p_rec.irf_attribute2
108     ,irf_attribute3                 = p_rec.irf_attribute3
109     ,irf_attribute4                 = p_rec.irf_attribute4
110     ,irf_attribute5                 = p_rec.irf_attribute5
111     ,irf_attribute6                 = p_rec.irf_attribute6
112     ,irf_attribute7                 = p_rec.irf_attribute7
113     ,irf_attribute8                 = p_rec.irf_attribute8
114     ,irf_attribute9                 = p_rec.irf_attribute9
115     ,irf_attribute10                = p_rec.irf_attribute10
116     ,irf_information_category       = p_rec.irf_information_category
117     ,irf_information1               = p_rec.irf_information1
118     ,irf_information2               = p_rec.irf_information2
119     ,irf_information3               = p_rec.irf_information3
120     ,irf_information4               = p_rec.irf_information4
121     ,irf_information5               = p_rec.irf_information5
122     ,irf_information6               = p_rec.irf_information6
123     ,irf_information7               = p_rec.irf_information7
124     ,irf_information8               = p_rec.irf_information8
125     ,irf_information9               = p_rec.irf_information9
126     ,irf_information10              = p_rec.irf_information10
127     ,object_created_by              = p_rec.object_created_by
128     ,object_version_number          = p_rec.object_version_number
129     where   referral_info_id  =   p_rec.referral_info_id
130     and     start_date = p_validation_start_date
131     and     ((p_validation_end_date is null and end_date is null) or
132               (end_date  = p_validation_end_date));
133     --
134     --
135     --
136     -- Set the effective start and end dates
137     --
138     p_rec.start_date := p_validation_start_date;
139     p_rec.end_date   := p_validation_end_date;
140   End If;
141 --
142 hr_utility.set_location(' Leaving:'||l_proc, 15);
143 Exception
144   When hr_api.check_integrity_violated Then
145     -- A check constraint has been violated
146     --
147     irc_irf_shd.constraint_error
148       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
149   When hr_api.unique_integrity_violated Then
150     -- Unique integrity has been violated
151     --
152     irc_irf_shd.constraint_error
153       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
154   When Others Then
155     --
156     Raise;
157 End dt_update_dml;
158 --
159 -- ----------------------------------------------------------------------------
160 -- |------------------------------< update_dml >------------------------------|
161 -- ----------------------------------------------------------------------------
162 -- {Start Of Comments}
163 --
164 -- Description:
165 --   This procedure calls the dt_update_dml control logic which handles
166 --   the actual datetrack dml.
167 --
168 -- Prerequisites:
169 --   This is an internal private procedure which must be called from the upd
170 --   procedure.
171 --
172 -- In Parameters:
173 --   A Pl/Sql record structre.
174 --
175 -- Post Success:
176 --   Processing contines.
177 --
178 -- Post Failure:
179 --   No specific error handling is required within this procedure.
180 --
181 -- Developer Implementation Notes:
182 --   The update 'set' arguments list should be modified if any of your
183 --   attributes are not updateable.
184 --
185 -- Access Status:
186 --   Internal Row Handler Use Only.
187 --
188 -- {End Of Comments}
189 -- ----------------------------------------------------------------------------
190 Procedure update_dml
191   (p_rec                      in out nocopy irc_irf_shd.g_rec_type
192   ,p_effective_date           in date
193   ,p_datetrack_mode           in varchar2
194   ,p_validation_start_date    in date
195   ,p_validation_end_date      in date
196   ) is
197 --
198   l_proc        varchar2(72) := g_package||'update_dml';
199 --
200 Begin
201   hr_utility.set_location('Entering:'||l_proc, 5);
202   --
203   irc_irf_upd.dt_update_dml
204     (p_rec                   => p_rec
205     ,p_effective_date        => p_effective_date
206     ,p_datetrack_mode        => p_datetrack_mode
207     ,p_validation_start_date => p_validation_start_date
208     ,p_validation_end_date   => p_validation_end_date
209     );
210   --
211   hr_utility.set_location(' Leaving:'||l_proc, 10);
212 End update_dml;
213 --
214 -- ----------------------------------------------------------------------------
215 -- |----------------------------< dt_pre_update >-----------------------------|
216 -- ----------------------------------------------------------------------------
217 -- {Start Of Comments}
218 --
219 -- Description:
220 --   The dt_pre_update procedure controls the execution
221 --   of dml for the datetrack modes of: UPDATE, UPDATE_OVERRIDE
222 --   and UPDATE_CHANGE_INSERT only. The execution required is as
223 --   follows:
224 --
225 --   1) Providing the datetrack update mode is not 'CORRECTION'
226 --      then set the effective end date of the current row (this
227 --      will be the validation_start_date - 1).
228 --   2) If the datetrack mode is 'UPDATE_OVERRIDE' then call the
229 --      corresponding delete_dml process to delete any future rows
230 --      where the effective_start_date is greater than or equal to
231 --      the validation_start_date.
232 --   3) Call the insert_dml process to insert the new updated row
233 --      details.
234 --
235 -- Prerequisites:
236 --   This is an internal procedure which is called from the
237 --   pre_update procedure.
238 --
239 -- In Parameters:
240 --
241 -- Post Success:
242 --   Processing continues.
243 --
244 -- Post Failure:
245 --   If an error has occurred, an error message and exception will be raised
246 --   but not handled.
247 --
248 -- Developer Implementation Notes:
249 --   This is an internal procedure which is required by Datetrack. Don't
250 --   remove or modify.
251 --
252 -- Access Status:
253 --   Internal Row Handler Use Only.
254 --
255 -- {End Of Comments}
256 -- ----------------------------------------------------------------------------
257 Procedure dt_pre_update
258   (p_rec                     in out  nocopy   irc_irf_shd.g_rec_type
259   ,p_effective_date          in date
260   ,p_datetrack_mode          in varchar2
261   ,p_validation_start_date   in date
262   ,p_validation_end_date     in date
263   ) is
264 --
265   l_proc                 varchar2(72) := g_package||'dt_pre_update';
266   l_dummy_version_number number;
267 --
268 Begin
269   hr_utility.set_location('Entering:'||l_proc, 5);
270   If (p_datetrack_mode <> hr_api.g_correction) then
271     --
272     -- Update the current effective end date
273     --
274     irc_irf_shd.upd_end_date
275       (p_effective_date         => p_effective_date
276       ,p_referral_info_id =>  p_rec.referral_info_id
277       ,p_new_end_date           => p_validation_start_date
278       ,p_object_version_number  => l_dummy_version_number
279       );
280     --
281     If (p_datetrack_mode = hr_api.g_update_override) then
282       --
283       -- As the datetrack mode is 'UPDATE_OVERRIDE' then we must
284       -- delete any future rows
285       --
286       irc_irf_del.delete_dml
287         (p_rec                   => p_rec
288         ,p_effective_date        => p_effective_date
289         ,p_datetrack_mode        => p_datetrack_mode
290         ,p_validation_start_date => p_validation_start_date
291         ,p_validation_end_date   => p_validation_end_date
292         );
293     End If;
294     --
295     -- We must now insert the updated row
296     --
297     irc_irf_ins.insert_dml
298       (p_rec                    => p_rec
299       ,p_effective_date         => p_effective_date
300       ,p_datetrack_mode         => p_datetrack_mode
301       ,p_validation_start_date  => p_validation_start_date
302       ,p_validation_end_date    => p_validation_end_date
303       );
304   End If;
305   hr_utility.set_location(' Leaving:'||l_proc, 20);
306 End dt_pre_update;
307 --
308 -- ----------------------------------------------------------------------------
309 -- |------------------------------< pre_update >------------------------------|
310 -- ----------------------------------------------------------------------------
311 -- {Start Of Comments}
312 --
313 -- Description:
314 --   This private procedure contains any processing which is required before
315 --   the update dml.
316 --
317 -- Prerequisites:
318 --   This is an internal procedure which is called from the upd procedure.
319 --
320 -- In Parameters:
321 --   A Pl/Sql record structure.
322 --
323 -- Post Success:
324 --   Processing continues.
325 --
326 -- Post Failure:
327 --   If an error has occurred, an error message and exception will be raised
328 --   but not handled.
329 -- Developer Implementation Notes:
330 --   Any pre-processing required before the update dml is issued should be
331 --   coded within this procedure. It is important to note that any 3rd party
332 --   maintenance should be reviewed before placing in this procedure. The call
333 --   to the dt_update_dml procedure should NOT be removed.
334 --
335 -- Access Status:
336 --   Internal Row Handler Use Only.
337 --
338 -- {End Of Comments}
339 -- ----------------------------------------------------------------------------
340 Procedure pre_update
341   (p_rec                   in out nocopy irc_irf_shd.g_rec_type
342   ,p_effective_date        in date
343   ,p_datetrack_mode        in varchar2
344   ,p_validation_start_date in date
345   ,p_validation_end_date   in date
346   ) is
347 --
348   l_proc        varchar2(72) := g_package||'pre_update';
349 --
350 Begin
351   hr_utility.set_location('Entering:'||l_proc, 5);
352   --
353   --
354   --
355   dt_pre_update
356     (p_rec                   => p_rec
357     ,p_effective_date        => p_effective_date
358     ,p_datetrack_mode        => p_datetrack_mode
359     ,p_validation_start_date => p_validation_start_date
360     ,p_validation_end_date   => p_validation_end_date
361     );
362   --
363   hr_utility.set_location(' Leaving:'||l_proc, 10);
364 End pre_update;
365 --
366 -- ----------------------------------------------------------------------------
367 -- |----------------------------< post_update >-------------------------------|
368 -- ----------------------------------------------------------------------------
369 -- {Start Of Comments}
370 --
371 -- Description:
372 --   This private procedure contains any processing which is required after
373 --   the update dml.
374 --
375 -- Prerequisites:
376 --   This is an internal procedure which is called from the upd procedure.
377 --
378 -- In Parameters:
379 --   A Pl/Sql record structure.
380 --
381 -- Post Success:
382 --   Processing continues.
383 --
384 -- Post Failure:
385 --   If an error has occurred, an error message and exception will be raised
386 --   but not handled.
387 --
388 -- Developer Implementation Notes:
389 --   Any post-processing required after the update dml is issued should be
390 --   coded within this procedure. It is important to note that any 3rd party
391 --   maintenance should be reviewed before placing in this procedure.
392 --
393 -- Access Status:
394 --   Internal Row Handler Use Only.
395 --
396 -- {End Of Comments}
397 -- ----------------------------------------------------------------------------
398 Procedure post_update
399   (p_rec                   in irc_irf_shd.g_rec_type
400   ,p_effective_date        in date
401   ,p_datetrack_mode        in varchar2
402   ,p_validation_start_date in date
403   ,p_validation_end_date   in date
404   ) is
405 --
406   l_proc        varchar2(72) := g_package||'post_update';
407 --
408 Begin
409   hr_utility.set_location('Entering:'||l_proc, 5);
410   begin
411     --
412     irc_irf_rku.after_update
413       (p_effective_date               => p_effective_date
414       ,p_datetrack_mode               => p_datetrack_mode
415       ,p_validation_start_date        => p_validation_start_date
416       ,p_validation_end_date          => p_validation_end_date
417       ,p_referral_info_id             => p_rec.referral_info_id
418 	  ,p_start_date                   => p_rec.start_date
419       ,p_end_date            	      => p_rec.end_date
420 	  ,p_source_type            	  => p_rec.source_type
421       ,p_source_name            	  => p_rec.source_name
422       ,p_source_criteria1             => p_rec.source_criteria1
423       ,p_source_value1            	  => p_rec.source_value1
424       ,p_source_criteria2             => p_rec.source_criteria2
425       ,p_source_value2            	  => p_rec.source_value2
426       ,p_source_criteria3             => p_rec.source_criteria3
427       ,p_source_value3                => p_rec.source_value3
428       ,p_source_criteria4             => p_rec.source_criteria4
429       ,p_source_value4                => p_rec.source_value4
430       ,p_source_criteria5             => p_rec.source_criteria5
431       ,p_source_value5                => p_rec.source_value5
432       ,p_source_person_id             => p_rec.source_person_id
433       ,p_candidate_comment            => p_rec.candidate_comment
434       ,p_employee_comment             => p_rec.employee_comment
435       ,p_irf_attribute_category       => p_rec.irf_attribute_category
436       ,p_irf_attribute1               => p_rec.irf_attribute1
437       ,p_irf_attribute2               => p_rec.irf_attribute2
438       ,p_irf_attribute3               => p_rec.irf_attribute3
439       ,p_irf_attribute4               => p_rec.irf_attribute4
440       ,p_irf_attribute5               => p_rec.irf_attribute5
441       ,p_irf_attribute6               => p_rec.irf_attribute6
442       ,p_irf_attribute7               => p_rec.irf_attribute7
443       ,p_irf_attribute8               => p_rec.irf_attribute8
444       ,p_irf_attribute9               => p_rec.irf_attribute9
445       ,p_irf_attribute10              => p_rec.irf_attribute10
446       ,p_irf_information_category     => p_rec.irf_information_category
447       ,p_irf_information1             => p_rec.irf_information1
448       ,p_irf_information2             => p_rec.irf_information2
449       ,p_irf_information3             => p_rec.irf_information3
450       ,p_irf_information4             => p_rec.irf_information4
451       ,p_irf_information5             => p_rec.irf_information5
452       ,p_irf_information6             => p_rec.irf_information6
453       ,p_irf_information7             => p_rec.irf_information7
454       ,p_irf_information8             => p_rec.irf_information8
455       ,p_irf_information9             => p_rec.irf_information9
456       ,p_irf_information10            => p_rec.irf_information10
457       ,p_object_created_by            => p_rec.object_created_by
458       ,p_created_by                   => p_rec.created_by
459       ,p_object_version_number        => p_rec.object_version_number
460       ,p_start_date_o			      => irc_irf_shd.g_old_rec.start_date
461       ,p_end_date_o			          => irc_irf_shd.g_old_rec.end_date
462       ,p_source_type_o			      => irc_irf_shd.g_old_rec.source_type
463       ,p_source_name_o			      => irc_irf_shd.g_old_rec.source_name
464       ,p_source_criteria1_o	  		  => irc_irf_shd.g_old_rec.source_criteria1
465       ,p_source_value1_o			  => irc_irf_shd.g_old_rec.source_value1
466       ,p_source_criteria2_o			  => irc_irf_shd.g_old_rec.source_criteria2
467       ,p_source_value2_o			  => irc_irf_shd.g_old_rec.source_value2
468       ,p_source_criteria3_o			  => irc_irf_shd.g_old_rec.source_criteria3
469       ,p_source_value3_o			  => irc_irf_shd.g_old_rec.source_value3
470       ,p_source_criteria4_o			  => irc_irf_shd.g_old_rec.source_criteria4
471       ,p_source_value4_o			  => irc_irf_shd.g_old_rec.source_value4
472       ,p_source_criteria5_o			  => irc_irf_shd.g_old_rec.source_criteria5
473       ,p_source_value5_o			  => irc_irf_shd.g_old_rec.source_value5
474       ,p_source_person_id_o			  => irc_irf_shd.g_old_rec.source_person_id
475       ,p_candidate_comment_o		  => irc_irf_shd.g_old_rec.candidate_comment
476       ,p_employee_comment_o			  => irc_irf_shd.g_old_rec.employee_comment
477       ,p_irf_attribute_category_o     => irc_irf_shd.g_old_rec.irf_attribute_category
478       ,p_irf_attribute1_o			  => irc_irf_shd.g_old_rec.irf_attribute1
479       ,p_irf_attribute2_o		 	  => irc_irf_shd.g_old_rec.irf_attribute2
480       ,p_irf_attribute3_o			  => irc_irf_shd.g_old_rec.irf_attribute3
481       ,p_irf_attribute4_o			  => irc_irf_shd.g_old_rec.irf_attribute4
482       ,p_irf_attribute5_o			  => irc_irf_shd.g_old_rec.irf_attribute5
483       ,p_irf_attribute6_o		 	  => irc_irf_shd.g_old_rec.irf_attribute6
484       ,p_irf_attribute7_o			  => irc_irf_shd.g_old_rec.irf_attribute7
485       ,p_irf_attribute8_o			  => irc_irf_shd.g_old_rec.irf_attribute8
486       ,p_irf_attribute9_o			  => irc_irf_shd.g_old_rec.irf_attribute9
487       ,p_irf_attribute10_o			  => irc_irf_shd.g_old_rec.irf_attribute10
488       ,p_irf_information_category_o	  => irc_irf_shd.g_old_rec.irf_information_category
489       ,p_irf_information1_o			  => irc_irf_shd.g_old_rec.irf_information1
490       ,p_irf_information2_o			  => irc_irf_shd.g_old_rec.irf_information2
491       ,p_irf_information3_o			  => irc_irf_shd.g_old_rec.irf_information3
492       ,p_irf_information4_o			  => irc_irf_shd.g_old_rec.irf_information4
493       ,p_irf_information5_o			  => irc_irf_shd.g_old_rec.irf_information5
494       ,p_irf_information6_o			  => irc_irf_shd.g_old_rec.irf_information6
495       ,p_irf_information7_o			  => irc_irf_shd.g_old_rec.irf_information7
496       ,p_irf_information8_o			  => irc_irf_shd.g_old_rec.irf_information8
497       ,p_irf_information9_o			  => irc_irf_shd.g_old_rec.irf_information9
498       ,p_irf_information10_o		  => irc_irf_shd.g_old_rec.irf_information10
499       ,p_object_created_by_o		  => irc_irf_shd.g_old_rec.object_created_by
500       ,p_created_by_o			      => irc_irf_shd.g_old_rec.created_by
501       ,p_object_version_number_o	  => irc_irf_shd.g_old_rec.object_version_number
502       );
503     --
504   exception
505     --
506     when hr_api.cannot_find_prog_unit then
507       --
508       hr_api.cannot_find_prog_unit_error
509         (p_module_name => 'IRC_REFERRAL_INFO'
510         ,p_hook_type   => 'AU');
511       --
512   end;
513   --
514   hr_utility.set_location(' Leaving:'||l_proc, 10);
515 End post_update;
516 --
517 -- ----------------------------------------------------------------------------
518 -- |-----------------------------< convert_defs >-----------------------------|
519 -- ----------------------------------------------------------------------------
520 -- {Start Of Comments}
521 --
522 -- Description:
523 --   The Convert_Defs procedure has one very important function:
524 --   It must return the record structure for the row with all system defaulted
525 --   values converted into its corresponding parameter value for update. When
526 --   we attempt to update a row through the Upd process , certain
527 --   parameters can be defaulted which enables flexibility in the calling of
528 --   the upd process (e.g. only attributes which need to be updated need to be
529 --   specified). For the upd process to determine which attributes
530 --   have NOT been specified we need to check if the parameter has a reserved
531 --   system default value. Therefore, for all parameters which have a
532 --   corresponding reserved system default mechanism specified we need to
533 --   check if a system default is being used. If a system default is being
534 --   used then we convert the defaulted value into its corresponding attribute
535 --   value held in the g_old_rec data structure.
536 --
537 -- Prerequisites:
538 --   This private function can only be called from the upd process.
539 --
540 -- In Parameters:
541 --   A Pl/Sql record structure.
542 --
543 -- Post Success:
544 --   The record structure will be returned with all system defaulted parameter
545 --   values converted into its current row attribute value.
546 --
547 -- Post Failure:
548 --   No direct error handling is required within this function. Any possible
549 --   errors within this procedure will be a PL/SQL value error due to
550 --   conversion of datatypes or data lengths.
551 --
552 -- Developer Implementation Notes:
553 --   None.
554 --
555 -- Access Status:
556 --   Internal Row Handler Use Only.
557 --
558 -- {End Of Comments}
559 -- ----------------------------------------------------------------------------
560 Procedure convert_defs
561   (p_rec in out nocopy irc_irf_shd.g_rec_type
562   ) is
563 --
564 Begin
565   --
566   -- We must now examine each argument value in the
567   -- p_rec plsql record structure
568   -- to see if a system default is being used. If a system default
569   -- is being used then we must set to the 'current' argument value.
570   --
571   If (p_rec.object_id = hr_api.g_number) then
572     p_rec.object_id :=
573     irc_irf_shd.g_old_rec.object_id;
574   End If;
575   If (p_rec.object_type = hr_api.g_varchar2) then
576     p_rec.object_type :=
577     irc_irf_shd.g_old_rec.object_type;
578   End If;
579   If (p_rec.start_date = hr_api.g_date) then
580     p_rec.start_date :=
581     irc_irf_shd.g_old_rec.start_date;
582   End If;
583   If (p_rec.end_date = hr_api.g_date) then
584     p_rec.end_date :=
585     irc_irf_shd.g_old_rec.end_date;
586   End If;
587   If (p_rec.source_type = hr_api.g_varchar2) then
588     p_rec.source_type :=
589     irc_irf_shd.g_old_rec.source_type;
590   End If;
591   If (p_rec.source_name = hr_api.g_varchar2) then
592     p_rec.source_name :=
593     irc_irf_shd.g_old_rec.source_name;
594   End If;
595   If (p_rec.source_criteria1 = hr_api.g_varchar2) then
596     p_rec.source_criteria1 :=
597     irc_irf_shd.g_old_rec.source_criteria1;
598   End If;
599   If (p_rec.source_value1 = hr_api.g_varchar2) then
600     p_rec.source_value1 :=
601     irc_irf_shd.g_old_rec.source_value1;
602   End If;
603   If (p_rec.source_criteria2 = hr_api.g_varchar2) then
604     p_rec.source_criteria2 :=
605     irc_irf_shd.g_old_rec.source_criteria2;
606   End If;
607   If (p_rec.source_value2 = hr_api.g_varchar2) then
608     p_rec.source_value2 :=
609     irc_irf_shd.g_old_rec.source_value2;
610   End If;
611   If (p_rec.source_criteria3 = hr_api.g_varchar2) then
612     p_rec.source_criteria3 :=
613     irc_irf_shd.g_old_rec.source_criteria3;
614   End If;
615   If (p_rec.source_value3 = hr_api.g_varchar2) then
616     p_rec.source_value3 :=
617     irc_irf_shd.g_old_rec.source_value3;
618   End If;
619   If (p_rec.source_criteria4 = hr_api.g_varchar2) then
620     p_rec.source_criteria4 :=
621     irc_irf_shd.g_old_rec.source_criteria4;
622   End If;
623   If (p_rec.source_value4 = hr_api.g_varchar2) then
624     p_rec.source_value4 :=
625     irc_irf_shd.g_old_rec.source_value4;
626   End If;
627   If (p_rec.source_criteria5 = hr_api.g_varchar2) then
628     p_rec.source_criteria5 :=
629     irc_irf_shd.g_old_rec.source_criteria5;
630   End If;
631   If (p_rec.source_value5 = hr_api.g_varchar2) then
632     p_rec.source_value5 :=
633     irc_irf_shd.g_old_rec.source_value5;
634   End If;
635   If (p_rec.source_person_id = hr_api.g_number) then
636     p_rec.source_person_id :=
637     irc_irf_shd.g_old_rec.source_person_id;
638   End If;
639   If (p_rec.candidate_comment = hr_api.g_varchar2) then
640     p_rec.candidate_comment :=
641     irc_irf_shd.g_old_rec.candidate_comment;
642   End If;
643   If (p_rec.employee_comment = hr_api.g_varchar2) then
644     p_rec.employee_comment :=
645     irc_irf_shd.g_old_rec.employee_comment;
646   End If;
647   If (p_rec.irf_attribute_category = hr_api.g_varchar2) then
648     p_rec.irf_attribute_category :=
649     irc_irf_shd.g_old_rec.irf_attribute_category;
650   End If;
651   If (p_rec.irf_attribute1 = hr_api.g_varchar2) then
652     p_rec.irf_attribute1 :=
653     irc_irf_shd.g_old_rec.irf_attribute1;
654   End If;
655   If (p_rec.irf_attribute2 = hr_api.g_varchar2) then
656     p_rec.irf_attribute2 :=
657     irc_irf_shd.g_old_rec.irf_attribute2;
658   End If;
659   If (p_rec.irf_attribute3 = hr_api.g_varchar2) then
660     p_rec.irf_attribute3 :=
661     irc_irf_shd.g_old_rec.irf_attribute3;
662   End If;
663   If (p_rec.irf_attribute4 = hr_api.g_varchar2) then
664     p_rec.irf_attribute4 :=
665     irc_irf_shd.g_old_rec.irf_attribute4;
666   End If;
667   If (p_rec.irf_attribute5 = hr_api.g_varchar2) then
668     p_rec.irf_attribute5 :=
669     irc_irf_shd.g_old_rec.irf_attribute5;
670   End If;
671   If (p_rec.irf_attribute6 = hr_api.g_varchar2) then
672     p_rec.irf_attribute6 :=
673     irc_irf_shd.g_old_rec.irf_attribute6;
674   End If;
675   If (p_rec.irf_attribute7 = hr_api.g_varchar2) then
676     p_rec.irf_attribute7 :=
677     irc_irf_shd.g_old_rec.irf_attribute7;
678   End If;
679   If (p_rec.irf_attribute8 = hr_api.g_varchar2) then
680     p_rec.irf_attribute8 :=
681     irc_irf_shd.g_old_rec.irf_attribute8;
682   End If;
683   If (p_rec.irf_attribute9 = hr_api.g_varchar2) then
684     p_rec.irf_attribute9 :=
685     irc_irf_shd.g_old_rec.irf_attribute9;
686   End If;
687   If (p_rec.irf_attribute10 = hr_api.g_varchar2) then
688     p_rec.irf_attribute10 :=
689     irc_irf_shd.g_old_rec.irf_attribute10;
690   End If;
691   If (p_rec.irf_information_category = hr_api.g_varchar2) then
692     p_rec.irf_information_category :=
693     irc_irf_shd.g_old_rec.irf_information_category;
694   End If;
695   If (p_rec.irf_information1 = hr_api.g_varchar2) then
696     p_rec.irf_information1 :=
697     irc_irf_shd.g_old_rec.irf_information1;
698   End If;
699   If (p_rec.irf_information2 = hr_api.g_varchar2) then
700     p_rec.irf_information2 :=
701     irc_irf_shd.g_old_rec.irf_information2;
702   End If;
703   If (p_rec.irf_information3 = hr_api.g_varchar2) then
704     p_rec.irf_information3 :=
705     irc_irf_shd.g_old_rec.irf_information3;
706   End If;
707   If (p_rec.irf_information4 = hr_api.g_varchar2) then
708     p_rec.irf_information4 :=
709     irc_irf_shd.g_old_rec.irf_information4;
710   End If;
711   If (p_rec.irf_information5 = hr_api.g_varchar2) then
712     p_rec.irf_information5 :=
713     irc_irf_shd.g_old_rec.irf_information5;
714   End If;
715   If (p_rec.irf_information6 = hr_api.g_varchar2) then
716     p_rec.irf_information6 :=
717     irc_irf_shd.g_old_rec.irf_information6;
718   End If;
719   If (p_rec.irf_information7 = hr_api.g_varchar2) then
720     p_rec.irf_information7 :=
721     irc_irf_shd.g_old_rec.irf_information7;
722   End If;
723   If (p_rec.irf_information8 = hr_api.g_varchar2) then
724     p_rec.irf_information8 :=
725     irc_irf_shd.g_old_rec.irf_information8;
726   End If;
727   If (p_rec.irf_information9 = hr_api.g_varchar2) then
728     p_rec.irf_information9 :=
729     irc_irf_shd.g_old_rec.irf_information9;
730   End If;
731   If (p_rec.irf_information10 = hr_api.g_varchar2) then
732     p_rec.irf_information10 :=
733     irc_irf_shd.g_old_rec.irf_information10;
734   End If;
735   If (p_rec.object_created_by = hr_api.g_varchar2) then
736     p_rec.object_created_by :=
737     irc_irf_shd.g_old_rec.object_created_by;
738   End If;
739   --
740 End convert_defs;
741 --
742 -- ----------------------------------------------------------------------------
743 -- |---------------------------------< upd >----------------------------------|
744 -- ----------------------------------------------------------------------------
745 Procedure upd
746   (p_effective_date in     date
747   ,p_datetrack_mode in     varchar2
748   ,p_rec            in out nocopy irc_irf_shd.g_rec_type
749   ) is
750 --
751   l_proc                        varchar2(72) := g_package||'upd';
752   l_validation_start_date       date;
753   l_validation_end_date         date;
754 --
755 Begin
756   hr_utility.set_location('Entering:'||l_proc, 5);
757   --
758   -- Ensure that the DateTrack update mode is valid
759   --
760   dt_api.validate_dt_upd_mode(p_datetrack_mode => p_datetrack_mode);
761   --
762   -- We must lock the row which we need to update.
763   --
764   irc_irf_shd.lck
765     (p_effective_date                   => p_effective_date
766     ,p_datetrack_mode                   => p_datetrack_mode
767     ,p_referral_info_id                 =>  p_rec.referral_info_id
768     ,p_object_version_number            => p_rec.object_version_number
769     ,p_validation_start_date            => l_validation_start_date
770     ,p_validation_end_date              => l_validation_end_date
771     );
772   --
773   -- 1. During an update system defaults are used to determine if
774   --    arguments have been defaulted or not. We must therefore
775   --    derive the full record structure values to be updated.
776   --
777   -- 2. Call the supporting update validate operations.
778   --
779   irc_irf_upd.convert_defs(p_rec);
780   --
781   irc_irf_bus.update_validate
782     (p_rec                              => p_rec
783     ,p_effective_date                   => p_effective_date
784     ,p_datetrack_mode                   => p_datetrack_mode
785     ,p_validation_start_date            => l_validation_start_date
786     ,p_validation_end_date              => l_validation_end_date
787     );
788   --
789   -- Call to raise any errors on multi-message list
790   hr_multi_message.end_validation_set;
791   --
792   -- Call the supporting pre-update operation
793   --
794   pre_update
795     (p_rec                              => p_rec
796     ,p_effective_date                   => p_effective_date
797     ,p_datetrack_mode                   => p_datetrack_mode
798     ,p_validation_start_date            => l_validation_start_date
799     ,p_validation_end_date              => l_validation_end_date
800     );
801   --
802   -- Update the row.
803   --
804   update_dml
805     (p_rec                              => p_rec
806     ,p_effective_date                   => p_effective_date
807     ,p_datetrack_mode                   => p_datetrack_mode
808     ,p_validation_start_date            => l_validation_start_date
809     ,p_validation_end_date              => l_validation_end_date
810     );
811   --
812   -- Call the supporting post-update operation
813   --
814   post_update
815     (p_rec                              => p_rec
816     ,p_effective_date                   => p_effective_date
817     ,p_datetrack_mode                   => p_datetrack_mode
818     ,p_validation_start_date            => l_validation_start_date
819     ,p_validation_end_date              => l_validation_end_date
820     );
821   --
822   -- Call to raise any errors on multi-message list
823   hr_multi_message.end_validation_set;
824 End upd;
825 --
826 -- ----------------------------------------------------------------------------
827 -- |------------------------------< upd >-------------------------------------|
828 -- ----------------------------------------------------------------------------
829 Procedure upd
830   (p_effective_date               in     date
831   ,p_datetrack_mode               in     varchar2
832   ,p_referral_info_id         in     number
833   ,p_object_version_number        in out nocopy number
834   ,p_source_type            		in 		 varchar2 default hr_api.g_varchar2
835   ,p_source_name            		in 		 varchar2 default hr_api.g_varchar2
836   ,p_source_criteria1               in 	     varchar2 default hr_api.g_varchar2
837   ,p_source_value1            	    in 		 varchar2 default hr_api.g_varchar2
838   ,p_source_criteria2               in 		 varchar2 default hr_api.g_varchar2
839   ,p_source_value2            	    in 		 varchar2 default hr_api.g_varchar2
840   ,p_source_criteria3               in 		 varchar2 default hr_api.g_varchar2
841   ,p_source_value3                  in 		 varchar2 default hr_api.g_varchar2
842   ,p_source_criteria4               in 		 varchar2 default hr_api.g_varchar2
843   ,p_source_value4                  in 		 varchar2 default hr_api.g_varchar2
844   ,p_source_criteria5               in 		 varchar2 default hr_api.g_varchar2
845   ,p_source_value5                  in 		 varchar2 default hr_api.g_varchar2
846   ,p_source_person_id               in 		 number   default hr_api.g_number
847   ,p_candidate_comment              in 		 varchar2 default hr_api.g_varchar2
848   ,p_employee_comment               in 		 varchar2 default hr_api.g_varchar2
849   ,p_irf_attribute_category         in 		 varchar2 default hr_api.g_varchar2
850   ,p_irf_attribute1                 in 		 varchar2 default hr_api.g_varchar2
851   ,p_irf_attribute2                 in 		 varchar2 default hr_api.g_varchar2
852   ,p_irf_attribute3                 in 		 varchar2 default hr_api.g_varchar2
853   ,p_irf_attribute4                 in 		 varchar2 default hr_api.g_varchar2
854   ,p_irf_attribute5                 in 		 varchar2 default hr_api.g_varchar2
855   ,p_irf_attribute6                 in 		 varchar2 default hr_api.g_varchar2
856   ,p_irf_attribute7                 in 		 varchar2 default hr_api.g_varchar2
857   ,p_irf_attribute8                 in 		 varchar2 default hr_api.g_varchar2
858   ,p_irf_attribute9                 in 		 varchar2 default hr_api.g_varchar2
859   ,p_irf_attribute10                in 		 varchar2 default hr_api.g_varchar2
860   ,p_irf_information_category       in 		 varchar2 default hr_api.g_varchar2
861   ,p_irf_information1               in 		 varchar2 default hr_api.g_varchar2
862   ,p_irf_information2               in 		 varchar2 default hr_api.g_varchar2
863   ,p_irf_information3               in 		 varchar2 default hr_api.g_varchar2
864   ,p_irf_information4               in 		 varchar2 default hr_api.g_varchar2
865   ,p_irf_information5               in 		 varchar2 default hr_api.g_varchar2
866   ,p_irf_information6               in 		 varchar2 default hr_api.g_varchar2
867   ,p_irf_information7               in 		 varchar2 default hr_api.g_varchar2
868   ,p_irf_information8               in 		 varchar2 default hr_api.g_varchar2
869   ,p_irf_information9               in 		 varchar2 default hr_api.g_varchar2
870   ,p_irf_information10              in 		 varchar2 default hr_api.g_varchar2
871   ,p_start_date                     out nocopy date
872   ,p_end_date                       out nocopy date
873   ) is
874 --
875   l_rec         irc_irf_shd.g_rec_type;
876   l_proc        varchar2(72) := g_package||'upd';
877 --
878 Begin
879   hr_utility.set_location('Entering:'||l_proc, 5);
880   --
881   -- Call conversion function to turn arguments into the
882   -- l_rec structure.
883   --
884   l_rec :=
885   irc_irf_shd.convert_args
886   (p_referral_info_id
887   ,hr_api.g_number
888   ,hr_api.g_varchar2
889   ,p_start_date
890   ,p_end_date
891   ,p_source_type
892   ,p_source_name
893   ,p_source_criteria1
894   ,p_source_value1
895   ,p_source_criteria2
896   ,p_source_value2
897   ,p_source_criteria3
898   ,p_source_value3
899   ,p_source_criteria4
900   ,p_source_value4
901   ,p_source_criteria5
902   ,p_source_value5
903   ,p_source_person_id
904   ,p_candidate_comment
905   ,p_employee_comment
906   ,p_irf_attribute_category
907   ,p_irf_attribute1
908   ,p_irf_attribute2
909   ,p_irf_attribute3
910   ,p_irf_attribute4
911   ,p_irf_attribute5
912   ,p_irf_attribute6
913   ,p_irf_attribute7
914   ,p_irf_attribute8
915   ,p_irf_attribute9
916   ,p_irf_attribute10
917   ,p_irf_information_category
918   ,p_irf_information1
919   ,p_irf_information2
920   ,p_irf_information3
921   ,p_irf_information4
922   ,p_irf_information5
923   ,p_irf_information6
924   ,p_irf_information7
925   ,p_irf_information8
926   ,p_irf_information9
927   ,p_irf_information10
928   ,hr_api.g_varchar2
929   ,p_object_version_number
930   );
931   --
932   -- Having converted the arguments into the
933   -- plsql record structure we call the corresponding record
934   -- business process.
935   --
936   irc_irf_upd.upd
937     (p_effective_date
938     ,p_datetrack_mode
939     ,l_rec
940     );
941   --
942   -- Set the out parameters
943   --
944   p_object_version_number  := l_rec.object_version_number;
945   p_start_date             := l_rec.start_date;
946   p_end_date               := l_rec.end_date;
947   --
948   --
949   hr_utility.set_location(' Leaving:'||l_proc, 10);
950 End upd;
951 --
952 end irc_irf_upd;