DBA Data[Home] [Help]

PACKAGE BODY: APPS.OTA_OFF_UPD

Source


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