1 Package Body hr_oru_upd as
2 /* $Header: hrorurhi.pkb 120.2.12020000.2 2012/09/24 09:57:10 swrajapa ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' hr_oru_upd.'; -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |------------------------------< update_dml >------------------------------|
12 -- ----------------------------------------------------------------------------
13 -- {Start Of Comments}
14 --
15 -- Description:
16 -- This procedure controls the actual dml update logic. The processing of
17 -- this procedure is:
18 -- 1) Increment the object_version_number by 1 if the object_version_number
19 -- is defined as an attribute for this entity.
20 -- 2) To set and unset the g_api_dml status as required (as we are about to
21 -- perform dml).
22 -- 3) To update the specified row in the schema using the primary key in
23 -- the predicates.
24 -- 4) To trap any constraint violations that may have occurred.
25 -- 5) To raise any other errors.
26 --
27 -- Prerequisites:
28 -- This is an internal private procedure which must be called from the upd
29 -- procedure.
30 --
31 -- In Parameters:
32 -- A Pl/Sql record structre.
33 --
34 -- Post Success:
35 -- The specified row will be updated in the schema.
36 --
37 -- Post Failure:
38 -- On the update dml failure it is important to note that we always reset the
39 -- g_api_dml status to false.
40 -- If a check, unique or parent integrity constraint violation is raised the
41 -- constraint_error procedure will be called.
42 -- If any other error is reported, the error will be raised after the
43 -- g_api_dml status is reset.
44 --
45 -- Developer Implementation Notes:
46 -- The update 'set' attribute list should be modified if any of your
47 -- attributes are not updateable.
48 --
49 -- Access Status:
50 -- Internal Row Handler Use Only.
51 --
52 -- {End Of Comments}
53 -- ----------------------------------------------------------------------------
54 Procedure update_dml
55 (p_rec in out nocopy hr_oru_shd.g_rec_type
56 ) is
57 --
58 l_proc varchar2(72) := g_package||'update_dml';
59 --
60 Begin
61 hr_utility.set_location('Entering:'||l_proc, 5);
62 --
63 -- Increment the object version
64 p_rec.object_version_number := p_rec.object_version_number + 1;
65 --
66 hr_oru_shd.g_api_dml := true; -- Set the api dml status
67 --
68 -- Update the hr_all_organization_units Row
69 --
70 update hr_all_organization_units
71 set
72 organization_id = p_rec.organization_id
73 ,business_group_id = p_rec.business_group_id
74 ,cost_allocation_keyflex_id = p_rec.cost_allocation_keyflex_id
75 ,location_id = p_rec.location_id
76 -- Bug 3040119
77 --,soft_coding_keyflex_id = p_rec.soft_coding_keyflex_id
78 ,date_from = p_rec.date_from
79 ,name = p_rec.name
80 ,comments = p_rec.comments
81 ,date_to = p_rec.date_to
82 ,internal_external_flag = p_rec.internal_external_flag
83 ,internal_address_line = p_rec.internal_address_line
84 ,type = p_rec.type
85 ,attribute_category = p_rec.attribute_category
86 ,attribute1 = p_rec.attribute1
87 ,attribute2 = p_rec.attribute2
88 ,attribute3 = p_rec.attribute3
89 ,attribute4 = p_rec.attribute4
90 ,attribute5 = p_rec.attribute5
91 ,attribute6 = p_rec.attribute6
92 ,attribute7 = p_rec.attribute7
93 ,attribute8 = p_rec.attribute8
94 ,attribute9 = p_rec.attribute9
95 ,attribute10 = p_rec.attribute10
96 ,attribute11 = p_rec.attribute11
97 ,attribute12 = p_rec.attribute12
98 ,attribute13 = p_rec.attribute13
99 ,attribute14 = p_rec.attribute14
100 ,attribute15 = p_rec.attribute15
101 ,attribute16 = p_rec.attribute16
102 ,attribute17 = p_rec.attribute17
103 ,attribute18 = p_rec.attribute18
104 ,attribute19 = p_rec.attribute19
105 ,attribute20 = p_rec.attribute20
106 --Enhancement 4040086
107 ,attribute21 = p_rec.attribute21
108 ,attribute22 = p_rec.attribute22
109 ,attribute23 = p_rec.attribute23
110 ,attribute24 = p_rec.attribute24
111 ,attribute25 = p_rec.attribute25
112 ,attribute26 = p_rec.attribute26
113 ,attribute27 = p_rec.attribute27
114 ,attribute28 = p_rec.attribute28
115 ,attribute29 = p_rec.attribute29
116 ,attribute30 = p_rec.attribute30
117 --End Enhancement 4040086
118 ,object_version_number = p_rec.object_version_number
119 where organization_id = p_rec.organization_id;
120 --
121 hr_oru_shd.g_api_dml := false; -- Unset the api dml status
122 --
123 hr_utility.set_location(' Leaving:'||l_proc, 10);
124 --
125 Exception
126 When hr_api.check_integrity_violated Then
127 -- A check constraint has been violated
128 hr_oru_shd.g_api_dml := false; -- Unset the api dml status
129 hr_oru_shd.constraint_error
130 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
131 When hr_api.parent_integrity_violated Then
132 -- Parent integrity has been violated
133 hr_oru_shd.g_api_dml := false; -- Unset the api dml status
134 hr_oru_shd.constraint_error
135 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
136 When hr_api.unique_integrity_violated Then
137 -- Unique integrity has been violated
138 hr_oru_shd.g_api_dml := false; -- Unset the api dml status
139 hr_oru_shd.constraint_error
140 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
141 When Others Then
142 hr_oru_shd.g_api_dml := false; -- Unset the api dml status
143 Raise;
144 End update_dml;
145 --
146 -- ----------------------------------------------------------------------------
147 -- |------------------------------< pre_update >------------------------------|
148 -- ----------------------------------------------------------------------------
149 -- {Start Of Comments}
150 --
151 -- Description:
152 -- This private procedure contains any processing which is required before
153 -- the update dml.
154 --
155 -- Prerequisites:
156 -- This is an internal procedure which is called from the upd procedure.
157 --
158 -- In Parameters:
159 -- A Pl/Sql record structure.
160 --
161 -- Post Success:
162 -- Processing continues.
163 --
164 -- Post Failure:
165 -- If an error has occurred, an error message and exception wil be raised
166 -- but not handled.
167 --
168 -- Developer Implementation Notes:
169 -- Any pre-processing required before the update dml is issued should be
170 -- coded within this procedure. It is important to note that any 3rd party
171 -- maintenance should be reviewed before placing in this procedure.
172 --
173 -- Access Status:
174 -- Internal Row Handler Use Only.
175 --
176 -- {End Of Comments}
177 -- ----------------------------------------------------------------------------
178 Procedure pre_update
179 (p_rec in hr_oru_shd.g_rec_type
180 ) is
181 --
182 l_proc varchar2(72) := g_package||'pre_update';
183 --
184 Begin
185 hr_utility.set_location('Entering:'||l_proc, 5);
186 --
187 hr_utility.set_location(' Leaving:'||l_proc, 10);
188 End pre_update;
189 --
190 -- ----------------------------------------------------------------------------
191 -- |-----------------------------< post_update >------------------------------|
192 -- ----------------------------------------------------------------------------
193 -- {Start Of Comments}
194 --
195 -- Description:
196 -- This private procedure contains any processing which is required after the
197 -- update dml.
198 --
199 -- Prerequisites:
200 -- This is an internal procedure which is called from the upd procedure.
201 --
202 -- In Parameters:
203 -- A Pl/Sql record structure.
204 --
205 -- Post Success:
206 -- Processing continues.
207 --
208 -- Post Failure:
209 -- If an error has occurred, an error message and exception will be raised
210 -- but not handled.
211 --
212 -- Developer Implementation Notes:
213 -- Any post-processing required after the update dml is issued should be
214 -- coded within this procedure. It is important to note that any 3rd party
215 -- maintenance should be reviewed before placing in this procedure.
216 --
217 -- Access Status:
218 -- Internal Row Handler Use Only.
219 --
220 -- {End Of Comments}
221 -- ----------------------------------------------------------------------------
222 Procedure post_update
223 (p_effective_date in date
224 ,p_rec in hr_oru_shd.g_rec_type
225 ) is
226 --
227 l_proc varchar2(72) := g_package||'post_update';
228 --
229 Begin
230 hr_utility.set_location('Entering:'||l_proc, 5);
231 begin
232 --
233 hr_oru_rku.after_update
234 (p_effective_date => p_effective_date
235 ,p_organization_id
236 => p_rec.organization_id
237 ,p_business_group_id
238 => p_rec.business_group_id
239 ,p_cost_allocation_keyflex_id
240 => p_rec.cost_allocation_keyflex_id
241 ,p_location_id
242 => p_rec.location_id
243 ,p_soft_coding_keyflex_id
244 => p_rec.soft_coding_keyflex_id
245 ,p_date_from
246 => p_rec.date_from
247 ,p_name
248 => p_rec.name
249 ,p_comments
250 => p_rec.comments
251 ,p_date_to
252 => p_rec.date_to
253 ,p_internal_external_flag
254 => p_rec.internal_external_flag
255 ,p_internal_address_line
256 => p_rec.internal_address_line
257 ,p_type
258 => p_rec.type
259 ,p_attribute_category
260 => p_rec.attribute_category
261 ,p_attribute1
262 => p_rec.attribute1
263 ,p_attribute2
264 => p_rec.attribute2
265 ,p_attribute3
266 => p_rec.attribute3
267 ,p_attribute4
268 => p_rec.attribute4
269 ,p_attribute5
270 => p_rec.attribute5
271 ,p_attribute6
272 => p_rec.attribute6
273 ,p_attribute7
274 => p_rec.attribute7
275 ,p_attribute8
276 => p_rec.attribute8
277 ,p_attribute9
278 => p_rec.attribute9
279 ,p_attribute10
280 => p_rec.attribute10
281 ,p_attribute11
282 => p_rec.attribute11
283 ,p_attribute12
284 => p_rec.attribute12
285 ,p_attribute13
286 => p_rec.attribute13
287 ,p_attribute14
288 => p_rec.attribute14
289 ,p_attribute15
290 => p_rec.attribute15
291 ,p_attribute16
292 => p_rec.attribute16
293 ,p_attribute17
294 => p_rec.attribute17
295 ,p_attribute18
296 => p_rec.attribute18
297 ,p_attribute19
298 => p_rec.attribute19
299 ,p_attribute20
300 => p_rec.attribute20
301 --Enhancement 4040086
302 ,p_attribute21
303 => p_rec.attribute21
304 ,p_attribute22
305 => p_rec.attribute22
306 ,p_attribute23
307 => p_rec.attribute23
308 ,p_attribute24
309 => p_rec.attribute24
310 ,p_attribute25
311 => p_rec.attribute25
312 ,p_attribute26
313 => p_rec.attribute26
314 ,p_attribute27
315 => p_rec.attribute27
316 ,p_attribute28
317 => p_rec.attribute28
318 ,p_attribute29
319 => p_rec.attribute29
320 ,p_attribute30
321 => p_rec.attribute30
322 --End Enhacement 4040086
323 ,p_object_version_number
324 => p_rec.object_version_number
325 ,p_business_group_id_o
326 => hr_oru_shd.g_old_rec.business_group_id
327 ,p_cost_allocation_keyflex_id_o
328 => hr_oru_shd.g_old_rec.cost_allocation_keyflex_id
329 ,p_location_id_o
330 => hr_oru_shd.g_old_rec.location_id
331 ,p_soft_coding_keyflex_id_o
332 => hr_oru_shd.g_old_rec.soft_coding_keyflex_id
333 ,p_date_from_o
334 => hr_oru_shd.g_old_rec.date_from
335 ,p_name_o
336 => hr_oru_shd.g_old_rec.name
337 ,p_comments_o
338 => hr_oru_shd.g_old_rec.comments
339 ,p_date_to_o
340 => hr_oru_shd.g_old_rec.date_to
341 ,p_internal_external_flag_o
342 => hr_oru_shd.g_old_rec.internal_external_flag
343 ,p_internal_address_line_o
344 => hr_oru_shd.g_old_rec.internal_address_line
345 ,p_type_o
346 => hr_oru_shd.g_old_rec.type
347 ,p_request_id_o
348 => hr_oru_shd.g_old_rec.request_id
349 ,p_program_application_id_o
350 => hr_oru_shd.g_old_rec.program_application_id
351 ,p_program_id_o
352 => hr_oru_shd.g_old_rec.program_id
353 ,p_program_update_date_o
354 => hr_oru_shd.g_old_rec.program_update_date
355 ,p_attribute_category_o
356 => hr_oru_shd.g_old_rec.attribute_category
357 ,p_attribute1_o
358 => hr_oru_shd.g_old_rec.attribute1
359 ,p_attribute2_o
360 => hr_oru_shd.g_old_rec.attribute2
361 ,p_attribute3_o
362 => hr_oru_shd.g_old_rec.attribute3
363 ,p_attribute4_o
364 => hr_oru_shd.g_old_rec.attribute4
365 ,p_attribute5_o
366 => hr_oru_shd.g_old_rec.attribute5
367 ,p_attribute6_o
368 => hr_oru_shd.g_old_rec.attribute6
369 ,p_attribute7_o
370 => hr_oru_shd.g_old_rec.attribute7
371 ,p_attribute8_o
372 => hr_oru_shd.g_old_rec.attribute8
373 ,p_attribute9_o
374 => hr_oru_shd.g_old_rec.attribute9
375 ,p_attribute10_o
376 => hr_oru_shd.g_old_rec.attribute10
377 ,p_attribute11_o
378 => hr_oru_shd.g_old_rec.attribute11
379 ,p_attribute12_o
380 => hr_oru_shd.g_old_rec.attribute12
381 ,p_attribute13_o
382 => hr_oru_shd.g_old_rec.attribute13
383 ,p_attribute14_o
384 => hr_oru_shd.g_old_rec.attribute14
385 ,p_attribute15_o
386 => hr_oru_shd.g_old_rec.attribute15
387 ,p_attribute16_o
388 => hr_oru_shd.g_old_rec.attribute16
389 ,p_attribute17_o
390 => hr_oru_shd.g_old_rec.attribute17
391 ,p_attribute18_o
392 => hr_oru_shd.g_old_rec.attribute18
393 ,p_attribute19_o
394 => hr_oru_shd.g_old_rec.attribute19
395 ,p_attribute20_o
396 => hr_oru_shd.g_old_rec.attribute20
397 --Enhancement 4040086
398 ,p_attribute21_o
399 => hr_oru_shd.g_old_rec.attribute21
400 ,p_attribute22_o
401 => hr_oru_shd.g_old_rec.attribute22
402 ,p_attribute23_o
403 => hr_oru_shd.g_old_rec.attribute23
404 ,p_attribute24_o
405 => hr_oru_shd.g_old_rec.attribute24
406 ,p_attribute25_o
407 => hr_oru_shd.g_old_rec.attribute25
408 ,p_attribute26_o
409 => hr_oru_shd.g_old_rec.attribute26
410 ,p_attribute27_o
411 => hr_oru_shd.g_old_rec.attribute27
412 ,p_attribute28_o
413 => hr_oru_shd.g_old_rec.attribute28
414 ,p_attribute29_o
415 => hr_oru_shd.g_old_rec.attribute29
416 ,p_attribute30_o
417 => hr_oru_shd.g_old_rec.attribute30
418 --End Enhancement 4040086
419 ,p_object_version_number_o
420 => hr_oru_shd.g_old_rec.object_version_number
421 );
422 --
423 exception
424 --
425 when hr_api.cannot_find_prog_unit then
426 --
427 hr_api.cannot_find_prog_unit_error
428 (p_module_name => 'HR_ALL_ORGANIZATION_UNITS'
429 ,p_hook_type => 'AU');
430 --
431 end;
432 --
433 hr_utility.set_location(' Leaving:'||l_proc, 10);
434 End post_update;
435 --
436 -- ----------------------------------------------------------------------------
437 -- |-----------------------------< convert_defs >-----------------------------|
438 -- ----------------------------------------------------------------------------
439 -- {Start Of Comments}
440 --
441 -- Description:
442 -- The Convert_Defs procedure has one very important function:
443 -- It must return the record structure for the row with all system defaulted
444 -- values converted into its corresponding parameter value for update. When
445 -- we attempt to update a row through the Upd process , certain
446 -- parameters can be defaulted which enables flexibility in the calling of
447 -- the upd process (e.g. only attributes which need to be updated need to be
448 -- specified). For the upd process to determine which attributes
449 -- have NOT been specified we need to check if the parameter has a reserved
450 -- system default value. Therefore, for all parameters which have a
451 -- corresponding reserved system default mechanism specified we need to
452 -- check if a system default is being used. If a system default is being
453 -- used then we convert the defaulted value into its corresponding attribute
454 -- value held in the g_old_rec data structure.
455 --
456 -- Prerequisites:
457 -- This private function can only be called from the upd process.
458 --
459 -- In Parameters:
460 -- A Pl/Sql record structure.
461 --
462 -- Post Success:
463 -- The record structure will be returned with all system defaulted parameter
464 -- values converted into its current row attribute value.
465 --
466 -- Post Failure:
467 -- No direct error handling is required within this function. Any possible
468 -- errors within this procedure will be a PL/SQL value error due to
469 -- conversion of datatypes or data lengths.
470 --
471 -- Developer Implementation Notes:
472 -- None.
473 --
474 -- Access Status:
475 -- Internal Row Handler Use Only.
476 --
477 -- {End Of Comments}
478 -- ----------------------------------------------------------------------------
479 Procedure convert_defs
480 (p_rec in out nocopy hr_oru_shd.g_rec_type
481 ) is
482 --
483 Begin
484 --
485 -- We must now examine each argument value in the
486 -- p_rec plsql record structure
487 -- to see if a system default is being used. If a system default
488 -- is being used then we must set to the 'current' argument value.
489 --
490 If (p_rec.business_group_id = hr_api.g_number) then
491 p_rec.business_group_id :=
492 hr_oru_shd.g_old_rec.business_group_id;
493 End If;
494 If (p_rec.cost_allocation_keyflex_id = hr_api.g_number) then
495 p_rec.cost_allocation_keyflex_id :=
496 hr_oru_shd.g_old_rec.cost_allocation_keyflex_id;
497 End If;
498 If (p_rec.location_id = hr_api.g_number) then
499 p_rec.location_id :=
500 hr_oru_shd.g_old_rec.location_id;
501 End If;
502 If (p_rec.soft_coding_keyflex_id = hr_api.g_number) then
503 p_rec.soft_coding_keyflex_id :=
504 hr_oru_shd.g_old_rec.soft_coding_keyflex_id;
505 End If;
506 If (p_rec.date_from = hr_api.g_date) then
507 p_rec.date_from :=
508 hr_oru_shd.g_old_rec.date_from;
509 End If;
510 If (p_rec.name = hr_api.g_varchar2) then
511 p_rec.name :=
512 hr_oru_shd.g_old_rec.name;
513 End If;
514 If (p_rec.comments = hr_api.g_varchar2) then
515 p_rec.comments :=
516 hr_oru_shd.g_old_rec.comments;
517 End If;
518 If (p_rec.date_to = hr_api.g_date) then
519 p_rec.date_to :=
520 hr_oru_shd.g_old_rec.date_to;
521 End If;
522 If (p_rec.internal_external_flag = hr_api.g_varchar2) then
523 p_rec.internal_external_flag :=
524 hr_oru_shd.g_old_rec.internal_external_flag;
525 End If;
526 If (p_rec.internal_address_line = hr_api.g_varchar2) then
527 p_rec.internal_address_line :=
528 hr_oru_shd.g_old_rec.internal_address_line;
529 End If;
530 If (p_rec.type = hr_api.g_varchar2) then
531 p_rec.type :=
532 hr_oru_shd.g_old_rec.type;
533 End If;
534 If (p_rec.request_id = hr_api.g_number) then
535 p_rec.request_id :=
536 hr_oru_shd.g_old_rec.request_id;
537 End If;
538 If (p_rec.program_application_id = hr_api.g_number) then
539 p_rec.program_application_id :=
540 hr_oru_shd.g_old_rec.program_application_id;
541 End If;
542 If (p_rec.program_id = hr_api.g_number) then
543 p_rec.program_id :=
544 hr_oru_shd.g_old_rec.program_id;
545 End If;
546 If (p_rec.program_update_date = hr_api.g_date) then
547 p_rec.program_update_date :=
548 hr_oru_shd.g_old_rec.program_update_date;
549 End If;
550 If (p_rec.attribute_category = hr_api.g_varchar2) then
551 p_rec.attribute_category :=
552 hr_oru_shd.g_old_rec.attribute_category;
553 End If;
554 If (p_rec.attribute1 = hr_api.g_varchar2) then
555 p_rec.attribute1 :=
556 hr_oru_shd.g_old_rec.attribute1;
557 End If;
558 If (p_rec.attribute2 = hr_api.g_varchar2) then
559 p_rec.attribute2 :=
560 hr_oru_shd.g_old_rec.attribute2;
561 End If;
562 If (p_rec.attribute3 = hr_api.g_varchar2) then
563 p_rec.attribute3 :=
564 hr_oru_shd.g_old_rec.attribute3;
565 End If;
566 If (p_rec.attribute4 = hr_api.g_varchar2) then
567 p_rec.attribute4 :=
568 hr_oru_shd.g_old_rec.attribute4;
569 End If;
570 If (p_rec.attribute5 = hr_api.g_varchar2) then
571 p_rec.attribute5 :=
572 hr_oru_shd.g_old_rec.attribute5;
573 End If;
574 If (p_rec.attribute6 = hr_api.g_varchar2) then
575 p_rec.attribute6 :=
576 hr_oru_shd.g_old_rec.attribute6;
577 End If;
578 If (p_rec.attribute7 = hr_api.g_varchar2) then
579 p_rec.attribute7 :=
580 hr_oru_shd.g_old_rec.attribute7;
581 End If;
582 If (p_rec.attribute8 = hr_api.g_varchar2) then
583 p_rec.attribute8 :=
584 hr_oru_shd.g_old_rec.attribute8;
585 End If;
586 If (p_rec.attribute9 = hr_api.g_varchar2) then
587 p_rec.attribute9 :=
588 hr_oru_shd.g_old_rec.attribute9;
589 End If;
590 If (p_rec.attribute10 = hr_api.g_varchar2) then
591 p_rec.attribute10 :=
592 hr_oru_shd.g_old_rec.attribute10;
593 End If;
594 If (p_rec.attribute11 = hr_api.g_varchar2) then
595 p_rec.attribute11 :=
596 hr_oru_shd.g_old_rec.attribute11;
597 End If;
598 If (p_rec.attribute12 = hr_api.g_varchar2) then
599 p_rec.attribute12 :=
600 hr_oru_shd.g_old_rec.attribute12;
601 End If;
602 If (p_rec.attribute13 = hr_api.g_varchar2) then
603 p_rec.attribute13 :=
604 hr_oru_shd.g_old_rec.attribute13;
605 End If;
606 If (p_rec.attribute14 = hr_api.g_varchar2) then
607 p_rec.attribute14 :=
608 hr_oru_shd.g_old_rec.attribute14;
609 End If;
610 If (p_rec.attribute15 = hr_api.g_varchar2) then
611 p_rec.attribute15 :=
612 hr_oru_shd.g_old_rec.attribute15;
613 End If;
614 If (p_rec.attribute16 = hr_api.g_varchar2) then
615 p_rec.attribute16 :=
616 hr_oru_shd.g_old_rec.attribute16;
617 End If;
618 If (p_rec.attribute17 = hr_api.g_varchar2) then
619 p_rec.attribute17 :=
620 hr_oru_shd.g_old_rec.attribute17;
621 End If;
622 If (p_rec.attribute18 = hr_api.g_varchar2) then
623 p_rec.attribute18 :=
624 hr_oru_shd.g_old_rec.attribute18;
625 End If;
626 If (p_rec.attribute19 = hr_api.g_varchar2) then
627 p_rec.attribute19 :=
628 hr_oru_shd.g_old_rec.attribute19;
629 End If;
630 If (p_rec.attribute20 = hr_api.g_varchar2) then
631 p_rec.attribute20 :=
632 hr_oru_shd.g_old_rec.attribute20;
633 End If;
634 --Enhancement 4040086
635 If (p_rec.attribute21 = hr_api.g_varchar2) then
636 p_rec.attribute21 :=
637 hr_oru_shd.g_old_rec.attribute21;
638 End If;
639 If (p_rec.attribute22 = hr_api.g_varchar2) then
640 p_rec.attribute22 :=
641 hr_oru_shd.g_old_rec.attribute22;
642 End If;
643 If (p_rec.attribute23 = hr_api.g_varchar2) then
644 p_rec.attribute23 :=
645 hr_oru_shd.g_old_rec.attribute23;
646 End If;
647 If (p_rec.attribute24 = hr_api.g_varchar2) then
648 p_rec.attribute24 :=
649 hr_oru_shd.g_old_rec.attribute24;
650 End If;
651 If (p_rec.attribute25 = hr_api.g_varchar2) then
652 p_rec.attribute25 :=
653 hr_oru_shd.g_old_rec.attribute25;
654 End If;
655 If (p_rec.attribute26 = hr_api.g_varchar2) then
656 p_rec.attribute26 :=
657 hr_oru_shd.g_old_rec.attribute26;
658 End If;
659 If (p_rec.attribute27 = hr_api.g_varchar2) then
660 p_rec.attribute27 :=
661 hr_oru_shd.g_old_rec.attribute27;
662 End If;
663 If (p_rec.attribute28 = hr_api.g_varchar2) then
664 p_rec.attribute28 :=
665 hr_oru_shd.g_old_rec.attribute28;
666 End If;
667 If (p_rec.attribute29 = hr_api.g_varchar2) then
668 p_rec.attribute29 :=
669 hr_oru_shd.g_old_rec.attribute29;
670 End If;
671 If (p_rec.attribute30 = hr_api.g_varchar2) then
672 p_rec.attribute30 :=
673 hr_oru_shd.g_old_rec.attribute30;
674 End If;
675 --End Enhancement 4040086
676 --
677 End convert_defs;
678 --
679 -- ----------------------------------------------------------------------------
680 -- |---------------------------------< upd >----------------------------------|
681 -- ----------------------------------------------------------------------------
682 Procedure upd
683 (p_effective_date in date
684 ,p_rec in out nocopy hr_oru_shd.g_rec_type
685 ,p_duplicate_org_warning out nocopy boolean
686 ) is
687 --
688 l_proc varchar2(72) := g_package||'upd';
689 --
690 Begin
691 hr_utility.set_location('Entering:'||l_proc, 5);
692 --
693 -- We must lock the row which we need to update.
694 --
695 hr_oru_shd.lck
696 (p_rec.organization_id
697 ,p_rec.object_version_number
698 );
699 --
700 -- 1. During an update system defaults are used to determine if
701 -- arguments have been defaulted or not. We must therefore
702 -- derive the full record structure values to be updated.
703 --
704 -- 2. Call the supporting update validate operations.
705 --
706 convert_defs(p_rec);
707 hr_oru_bus.update_validate
708 (p_effective_date
709 ,p_rec
710 ,p_duplicate_org_warning
711 );
712 --
713 -- Call the supporting pre-update operation
714 --
715 hr_oru_upd.pre_update(p_rec);
716 --
717 -- Update the row.
718 --
719 hr_oru_upd.update_dml(p_rec);
720 --
721 -- Call the supporting post-update operation
722 --
723 hr_oru_upd.post_update
724 (p_effective_date
725 ,p_rec
726 );
727 End upd;
728 --
729 -- ----------------------------------------------------------------------------
730 -- |---------------------------------< upd >----------------------------------|
731 -- ----------------------------------------------------------------------------
732 Procedure upd
733 (p_effective_date in date
734 ,p_organization_id in number
735 ,p_object_version_number in out nocopy number
736 ,p_business_group_id in number default hr_api.g_number
737 ,p_date_from in date default hr_api.g_date
738 ,p_name in varchar2 default hr_api.g_varchar2
739 ,p_cost_allocation_keyflex_id in number default hr_api.g_number
740 ,p_location_id in number default hr_api.g_number
741 -- Bug 3040119
742 --,p_soft_coding_keyflex_id in number default hr_api.g_number
743 ,p_date_to in date default hr_api.g_date
744 ,p_internal_external_flag in varchar2 default hr_api.g_varchar2
745 ,p_internal_address_line in varchar2 default hr_api.g_varchar2
746 ,p_type in varchar2 default hr_api.g_varchar2
747 ,p_comments in varchar2 default hr_api.g_varchar2
748 ,p_attribute_category in varchar2 default hr_api.g_varchar2
749 ,p_attribute1 in varchar2 default hr_api.g_varchar2
750 ,p_attribute2 in varchar2 default hr_api.g_varchar2
751 ,p_attribute3 in varchar2 default hr_api.g_varchar2
752 ,p_attribute4 in varchar2 default hr_api.g_varchar2
753 ,p_attribute5 in varchar2 default hr_api.g_varchar2
754 ,p_attribute6 in varchar2 default hr_api.g_varchar2
755 ,p_attribute7 in varchar2 default hr_api.g_varchar2
756 ,p_attribute8 in varchar2 default hr_api.g_varchar2
757 ,p_attribute9 in varchar2 default hr_api.g_varchar2
758 ,p_attribute10 in varchar2 default hr_api.g_varchar2
759 ,p_attribute11 in varchar2 default hr_api.g_varchar2
760 ,p_attribute12 in varchar2 default hr_api.g_varchar2
761 ,p_attribute13 in varchar2 default hr_api.g_varchar2
762 ,p_attribute14 in varchar2 default hr_api.g_varchar2
763 ,p_attribute15 in varchar2 default hr_api.g_varchar2
764 ,p_attribute16 in varchar2 default hr_api.g_varchar2
765 ,p_attribute17 in varchar2 default hr_api.g_varchar2
766 ,p_attribute18 in varchar2 default hr_api.g_varchar2
767 ,p_attribute19 in varchar2 default hr_api.g_varchar2
768 ,p_attribute20 in varchar2 default hr_api.g_varchar2
769 --Enhancement 4040086
770 ,p_attribute21 in varchar2 default hr_api.g_varchar2
771 ,p_attribute22 in varchar2 default hr_api.g_varchar2
772 ,p_attribute23 in varchar2 default hr_api.g_varchar2
773 ,p_attribute24 in varchar2 default hr_api.g_varchar2
774 ,p_attribute25 in varchar2 default hr_api.g_varchar2
775 ,p_attribute26 in varchar2 default hr_api.g_varchar2
776 ,p_attribute27 in varchar2 default hr_api.g_varchar2
777 ,p_attribute28 in varchar2 default hr_api.g_varchar2
778 ,p_attribute29 in varchar2 default hr_api.g_varchar2
779 ,p_attribute30 in varchar2 default hr_api.g_varchar2
780 --End Enhancement 4040086
781 ,p_duplicate_org_warning out nocopy boolean
782 ) is
783 --
784 l_rec hr_oru_shd.g_rec_type;
785 l_proc varchar2(72) := g_package||'upd';
786 --
787 Begin
788 hr_utility.set_location('Entering:'||l_proc, 5);
789 --
790 -- Call conversion function to turn arguments into the
791 -- l_rec structure.
792 --
793 l_rec :=
794 hr_oru_shd.convert_args
795 (p_organization_id
796 ,p_business_group_id
797 ,p_cost_allocation_keyflex_id
798 ,p_location_id
799 -- Bug 3040119
800 --,p_soft_coding_keyflex_id
801 ,null
802 ,p_date_from
803 ,p_name
804 ,p_comments
805 ,p_date_to
806 ,p_internal_external_flag
807 ,p_internal_address_line
808 ,p_type
809 ,hr_api.g_number
810 ,hr_api.g_number
811 ,hr_api.g_number
812 ,hr_api.g_date
813 ,p_attribute_category
814 ,p_attribute1
815 ,p_attribute2
816 ,p_attribute3
817 ,p_attribute4
818 ,p_attribute5
819 ,p_attribute6
820 ,p_attribute7
821 ,p_attribute8
822 ,p_attribute9
823 ,p_attribute10
824 ,p_attribute11
825 ,p_attribute12
826 ,p_attribute13
827 ,p_attribute14
828 ,p_attribute15
829 ,p_attribute16
830 ,p_attribute17
831 ,p_attribute18
832 ,p_attribute19
833 ,p_attribute20
834 --Enhancement 4040086
835 ,p_attribute21
836 ,p_attribute22
837 ,p_attribute23
838 ,p_attribute24
839 ,p_attribute25
840 ,p_attribute26
841 ,p_attribute27
842 ,p_attribute28
843 ,p_attribute29
844 ,p_attribute30
845 --End Enhancement 4040086
846 ,p_object_version_number
847 );
848 --
849 -- Having converted the arguments into the
850 -- plsql record structure we call the corresponding record
851 -- business process.
852 --
853 hr_oru_upd.upd
854 (p_effective_date
855 ,l_rec
856 ,p_duplicate_org_warning
857 );
858 p_object_version_number := l_rec.object_version_number;
859 --
860 hr_utility.set_location(' Leaving:'||l_proc, 10);
861 End upd;
862 --
863 end hr_oru_upd;