DBA Data[Home] [Help]

PACKAGE BODY: APPS.OTA_TRB_UPD

Source


1 Package Body ota_trb_upd as
2 /* $Header: ottrbrhi.pkb 120.6.12000000.3 2007/07/05 09:22:53 aabalakr noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  ota_trb_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 ota_trb_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   ota_trb_shd.g_api_dml := true;  -- Set the api dml status
67   --
68   -- Update the ota_resource_bookings Row
69   --
70   update ota_resource_bookings
71     set
72      resource_booking_id             = p_rec.resource_booking_id
73     ,supplied_resource_id            = p_rec.supplied_resource_id
74     ,event_id                        = p_rec.event_id
75     ,date_booking_placed             = p_rec.date_booking_placed
76     ,object_version_number           = p_rec.object_version_number
77     ,status                          = p_rec.status
78     ,absolute_price                  = p_rec.absolute_price
79     ,booking_person_id               = p_rec.booking_person_id
80     ,comments                        = p_rec.comments
81     ,contact_name                    = p_rec.contact_name
82     ,contact_phone_number            = p_rec.contact_phone_number
83     ,delegates_per_unit              = p_rec.delegates_per_unit
84     ,quantity                        = p_rec.quantity
85     ,required_date_from              = p_rec.required_date_from
86     ,required_date_to                = p_rec.required_date_to
87     ,required_end_time               = p_rec.required_end_time
88     ,required_start_time             = p_rec.required_start_time
89     ,deliver_to                      = p_rec.deliver_to
90     ,primary_venue_flag              = p_rec.primary_venue_flag
91     ,role_to_play                    = p_rec.role_to_play
92     ,trb_information_category        = p_rec.trb_information_category
93     ,trb_information1                = p_rec.trb_information1
94     ,trb_information2                = p_rec.trb_information2
95     ,trb_information3                = p_rec.trb_information3
96     ,trb_information4                = p_rec.trb_information4
97     ,trb_information5                = p_rec.trb_information5
98     ,trb_information6                = p_rec.trb_information6
99     ,trb_information7                = p_rec.trb_information7
100     ,trb_information8                = p_rec.trb_information8
101     ,trb_information9                = p_rec.trb_information9
102     ,trb_information10               = p_rec.trb_information10
103     ,trb_information11               = p_rec.trb_information11
104     ,trb_information12               = p_rec.trb_information12
105     ,trb_information13               = p_rec.trb_information13
106     ,trb_information14               = p_rec.trb_information14
107     ,trb_information15               = p_rec.trb_information15
108     ,trb_information16               = p_rec.trb_information16
109     ,trb_information17               = p_rec.trb_information17
110     ,trb_information18               = p_rec.trb_information18
111     ,trb_information19               = p_rec.trb_information19
112     ,trb_information20               = p_rec.trb_information20
113     ,display_to_learner_flag      = p_rec.display_to_learner_flag
114   ,book_entire_period_flag    = p_rec.book_entire_period_flag
115 --  ,unbook_request_flag    in    = p_rec.unbook_request_flag
116     ,chat_id                         = p_rec.chat_id
117     ,forum_id                        = p_rec.forum_id
118     ,timezone_code                   = p_rec.timezone_code
119     where resource_booking_id = p_rec.resource_booking_id;
120   --
121   ota_trb_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     ota_trb_shd.g_api_dml := false;   -- Unset the api dml status
129     ota_trb_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     ota_trb_shd.g_api_dml := false;   -- Unset the api dml status
134     ota_trb_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     ota_trb_shd.g_api_dml := false;   -- Unset the api dml status
139     ota_trb_shd.constraint_error
140       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
141   When Others Then
142     ota_trb_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 ota_trb_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
197 --   the 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 ota_trb_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     ota_trb_rku.after_update
234       (p_effective_date              => p_effective_date
235       ,p_resource_booking_id
236       => p_rec.resource_booking_id
237       ,p_supplied_resource_id
238       => p_rec.supplied_resource_id
239       ,p_event_id
240       => p_rec.event_id
241       ,p_date_booking_placed
242       => p_rec.date_booking_placed
243       ,p_object_version_number
244       => p_rec.object_version_number
245       ,p_status
246       => p_rec.status
247       ,p_absolute_price
248       => p_rec.absolute_price
249       ,p_booking_person_id
250       => p_rec.booking_person_id
251       ,p_comments
252       => p_rec.comments
253       ,p_contact_name
254       => p_rec.contact_name
255       ,p_contact_phone_number
256       => p_rec.contact_phone_number
257       ,p_delegates_per_unit
258       => p_rec.delegates_per_unit
259       ,p_quantity
260       => p_rec.quantity
261       ,p_required_date_from
262       => p_rec.required_date_from
263       ,p_required_date_to
264       => p_rec.required_date_to
265       ,p_required_end_time
266       => p_rec.required_end_time
267       ,p_required_start_time
268       => p_rec.required_start_time
269       ,p_deliver_to
270       => p_rec.deliver_to
271       ,p_primary_venue_flag
272       => p_rec.primary_venue_flag
273       ,p_role_to_play
274       => p_rec.role_to_play
275       ,p_trb_information_category
276       => p_rec.trb_information_category
277       ,p_trb_information1
278       => p_rec.trb_information1
279       ,p_trb_information2
280       => p_rec.trb_information2
281       ,p_trb_information3
282       => p_rec.trb_information3
283       ,p_trb_information4
284       => p_rec.trb_information4
285       ,p_trb_information5
286       => p_rec.trb_information5
287       ,p_trb_information6
288       => p_rec.trb_information6
289       ,p_trb_information7
290       => p_rec.trb_information7
291       ,p_trb_information8
292       => p_rec.trb_information8
293       ,p_trb_information9
294       => p_rec.trb_information9
295       ,p_trb_information10
296       => p_rec.trb_information10
297       ,p_trb_information11
298       => p_rec.trb_information11
299       ,p_trb_information12
300       => p_rec.trb_information12
301       ,p_trb_information13
302       => p_rec.trb_information13
303       ,p_trb_information14
304       => p_rec.trb_information14
305       ,p_trb_information15
306       => p_rec.trb_information15
307       ,p_trb_information16
308       => p_rec.trb_information16
309       ,p_trb_information17
310       => p_rec.trb_information17
311       ,p_trb_information18
312       => p_rec.trb_information18
313       ,p_trb_information19
314       => p_rec.trb_information19
315       ,p_trb_information20
316       => p_rec.trb_information20
317       ,p_display_to_learner_flag
318       => p_rec.display_to_learner_flag
319       ,p_book_entire_period_flag
320       => p_rec.book_entire_period_flag
321      /* ,p_unbook_request_flag
322       => p_rec.unbook_request_flag */
323       ,p_chat_id
324       => p_rec.chat_id
325       ,p_forum_id
326       => p_rec.forum_id
327       ,p_timezone_code
328       => p_rec.timezone_code
329       ,p_supplied_resource_id_o
330       => ota_trb_shd.g_old_rec.supplied_resource_id
331       ,p_event_id_o
332       => ota_trb_shd.g_old_rec.event_id
333       ,p_date_booking_placed_o
334       => ota_trb_shd.g_old_rec.date_booking_placed
335       ,p_object_version_number_o
336       => ota_trb_shd.g_old_rec.object_version_number
337       ,p_status_o
338       => ota_trb_shd.g_old_rec.status
339       ,p_absolute_price_o
340       => ota_trb_shd.g_old_rec.absolute_price
341       ,p_booking_person_id_o
342       => ota_trb_shd.g_old_rec.booking_person_id
343       ,p_comments_o
344       => ota_trb_shd.g_old_rec.comments
345       ,p_contact_name_o
346       => ota_trb_shd.g_old_rec.contact_name
347       ,p_contact_phone_number_o
348       => ota_trb_shd.g_old_rec.contact_phone_number
349       ,p_delegates_per_unit_o
350       => ota_trb_shd.g_old_rec.delegates_per_unit
351       ,p_quantity_o
352       => ota_trb_shd.g_old_rec.quantity
353       ,p_required_date_from_o
354       => ota_trb_shd.g_old_rec.required_date_from
355       ,p_required_date_to_o
356       => ota_trb_shd.g_old_rec.required_date_to
357       ,p_required_end_time_o
358       => ota_trb_shd.g_old_rec.required_end_time
359       ,p_required_start_time_o
360       => ota_trb_shd.g_old_rec.required_start_time
361       ,p_deliver_to_o
362       => ota_trb_shd.g_old_rec.deliver_to
363       ,p_primary_venue_flag_o
364       => ota_trb_shd.g_old_rec.primary_venue_flag
365       ,p_role_to_play_o
366       => ota_trb_shd.g_old_rec.role_to_play
367       ,p_trb_information_category_o
368       => ota_trb_shd.g_old_rec.trb_information_category
369       ,p_trb_information1_o
370       => ota_trb_shd.g_old_rec.trb_information1
371       ,p_trb_information2_o
372       => ota_trb_shd.g_old_rec.trb_information2
373       ,p_trb_information3_o
374       => ota_trb_shd.g_old_rec.trb_information3
375       ,p_trb_information4_o
376       => ota_trb_shd.g_old_rec.trb_information4
377       ,p_trb_information5_o
378       => ota_trb_shd.g_old_rec.trb_information5
379       ,p_trb_information6_o
380       => ota_trb_shd.g_old_rec.trb_information6
381       ,p_trb_information7_o
382       => ota_trb_shd.g_old_rec.trb_information7
383       ,p_trb_information8_o
384       => ota_trb_shd.g_old_rec.trb_information8
385       ,p_trb_information9_o
386       => ota_trb_shd.g_old_rec.trb_information9
387       ,p_trb_information10_o
388       => ota_trb_shd.g_old_rec.trb_information10
389       ,p_trb_information11_o
390       => ota_trb_shd.g_old_rec.trb_information11
391       ,p_trb_information12_o
392       => ota_trb_shd.g_old_rec.trb_information12
393       ,p_trb_information13_o
394       => ota_trb_shd.g_old_rec.trb_information13
395       ,p_trb_information14_o
396       => ota_trb_shd.g_old_rec.trb_information14
397       ,p_trb_information15_o
398       => ota_trb_shd.g_old_rec.trb_information15
399       ,p_trb_information16_o
400       => ota_trb_shd.g_old_rec.trb_information16
401       ,p_trb_information17_o
402       => ota_trb_shd.g_old_rec.trb_information17
403       ,p_trb_information18_o
404       => ota_trb_shd.g_old_rec.trb_information18
405       ,p_trb_information19_o
406       => ota_trb_shd.g_old_rec.trb_information19
407       ,p_trb_information20_o
408       => ota_trb_shd.g_old_rec.trb_information20
409       ,p_display_to_learner_flag_o
410       => ota_trb_shd.g_old_rec.display_to_learner_flag
411       ,p_book_entire_period_flag_o
412       => ota_trb_shd.g_old_rec.book_entire_period_flag
413     /*  ,p_unbook_request_flag_o
414       => ota_trb_shd.g_old_rec.unbook_request_flag */
415       ,p_chat_id_o
416       => ota_trb_shd.g_old_rec.chat_id
417       ,p_forum_id_o
418       => ota_trb_shd.g_old_rec.forum_id
419       ,p_timezone_code_o
420       => ota_trb_shd.g_old_rec.timezone_code
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 => 'OTA_RESOURCE_BOOKINGS'
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 ota_trb_shd.g_rec_type
481   ) is
482 --
483   l_proc	  varchar2(72) := g_package||'convert_defs';
484 --
485 Begin
486   --
487   --
488   hr_utility.set_location('Entering:'||l_proc, 5);
489   --
490   -- We must now examine each argument value in the
491   -- p_rec plsql record structure
492   -- to see if a system default is being used. If a system default
493   -- is being used then we must set to the 'current' argument value.
494   --
495   If (p_rec.supplied_resource_id = hr_api.g_number) then
496     p_rec.supplied_resource_id :=
497     ota_trb_shd.g_old_rec.supplied_resource_id;
498   End If;
499   If (p_rec.event_id = hr_api.g_number) then
500     p_rec.event_id :=
501     ota_trb_shd.g_old_rec.event_id;
502   End If;
503   If (p_rec.date_booking_placed = hr_api.g_date) then
504     p_rec.date_booking_placed :=
505     ota_trb_shd.g_old_rec.date_booking_placed;
506   End If;
507   If (p_rec.status = hr_api.g_varchar2) then
508     p_rec.status :=
509     ota_trb_shd.g_old_rec.status;
510   End If;
511   If (p_rec.absolute_price = hr_api.g_number) then
512     p_rec.absolute_price :=
513     ota_trb_shd.g_old_rec.absolute_price;
514   End If;
515   If (p_rec.booking_person_id = hr_api.g_number) then
516     p_rec.booking_person_id :=
517     ota_trb_shd.g_old_rec.booking_person_id;
518   End If;
519   If (p_rec.comments = hr_api.g_varchar2) then
520     p_rec.comments :=
521     ota_trb_shd.g_old_rec.comments;
522   End If;
523   If (p_rec.contact_name = hr_api.g_varchar2) then
524     p_rec.contact_name :=
525     ota_trb_shd.g_old_rec.contact_name;
526   End If;
527   If (p_rec.contact_phone_number = hr_api.g_varchar2) then
528     p_rec.contact_phone_number :=
529     ota_trb_shd.g_old_rec.contact_phone_number;
530   End If;
531   If (p_rec.delegates_per_unit = hr_api.g_number) then
532     p_rec.delegates_per_unit :=
533     ota_trb_shd.g_old_rec.delegates_per_unit;
534   End If;
535   If (p_rec.quantity = hr_api.g_number) then
536     p_rec.quantity :=
537     ota_trb_shd.g_old_rec.quantity;
538   End If;
539   If (p_rec.required_date_from = hr_api.g_date) then
540     p_rec.required_date_from :=
541     ota_trb_shd.g_old_rec.required_date_from;
542   End If;
543   If (p_rec.required_date_to = hr_api.g_date) then
544     p_rec.required_date_to :=
545     ota_trb_shd.g_old_rec.required_date_to;
546   End If;
547   If (p_rec.required_end_time = hr_api.g_varchar2) then
548     p_rec.required_end_time :=
549     ota_trb_shd.g_old_rec.required_end_time;
550   End If;
551   If (p_rec.required_start_time = hr_api.g_varchar2) then
552     p_rec.required_start_time :=
553     ota_trb_shd.g_old_rec.required_start_time;
554   End If;
555   If (p_rec.deliver_to = hr_api.g_varchar2) then
556     p_rec.deliver_to :=
557     ota_trb_shd.g_old_rec.deliver_to;
558   End If;
559   If (p_rec.primary_venue_flag = hr_api.g_varchar2) then
560     p_rec.primary_venue_flag :=
561     ota_trb_shd.g_old_rec.primary_venue_flag;
562   End If;
563   If (p_rec.role_to_play = hr_api.g_varchar2) then
564     p_rec.role_to_play :=
565     ota_trb_shd.g_old_rec.role_to_play;
566   End If;
567   If (p_rec.trb_information_category = hr_api.g_varchar2) then
568     p_rec.trb_information_category :=
569     ota_trb_shd.g_old_rec.trb_information_category;
570   End If;
571   If (p_rec.trb_information1 = hr_api.g_varchar2) then
572     p_rec.trb_information1 :=
573     ota_trb_shd.g_old_rec.trb_information1;
574   End If;
575   If (p_rec.trb_information2 = hr_api.g_varchar2) then
576     p_rec.trb_information2 :=
577     ota_trb_shd.g_old_rec.trb_information2;
578   End If;
579   If (p_rec.trb_information3 = hr_api.g_varchar2) then
580     p_rec.trb_information3 :=
581     ota_trb_shd.g_old_rec.trb_information3;
582   End If;
583   If (p_rec.trb_information4 = hr_api.g_varchar2) then
584     p_rec.trb_information4 :=
585     ota_trb_shd.g_old_rec.trb_information4;
586   End If;
587   If (p_rec.trb_information5 = hr_api.g_varchar2) then
588     p_rec.trb_information5 :=
589     ota_trb_shd.g_old_rec.trb_information5;
590   End If;
591   If (p_rec.trb_information6 = hr_api.g_varchar2) then
592     p_rec.trb_information6 :=
593     ota_trb_shd.g_old_rec.trb_information6;
594   End If;
595   If (p_rec.trb_information7 = hr_api.g_varchar2) then
596     p_rec.trb_information7 :=
597     ota_trb_shd.g_old_rec.trb_information7;
598   End If;
599   If (p_rec.trb_information8 = hr_api.g_varchar2) then
600     p_rec.trb_information8 :=
601     ota_trb_shd.g_old_rec.trb_information8;
602   End If;
603   If (p_rec.trb_information9 = hr_api.g_varchar2) then
604     p_rec.trb_information9 :=
605     ota_trb_shd.g_old_rec.trb_information9;
606   End If;
607   If (p_rec.trb_information10 = hr_api.g_varchar2) then
608     p_rec.trb_information10 :=
609     ota_trb_shd.g_old_rec.trb_information10;
610   End If;
611   If (p_rec.trb_information11 = hr_api.g_varchar2) then
612     p_rec.trb_information11 :=
613     ota_trb_shd.g_old_rec.trb_information11;
614   End If;
615   If (p_rec.trb_information12 = hr_api.g_varchar2) then
616     p_rec.trb_information12 :=
617     ota_trb_shd.g_old_rec.trb_information12;
618   End If;
619   If (p_rec.trb_information13 = hr_api.g_varchar2) then
620     p_rec.trb_information13 :=
621     ota_trb_shd.g_old_rec.trb_information13;
622   End If;
623   If (p_rec.trb_information14 = hr_api.g_varchar2) then
624     p_rec.trb_information14 :=
625     ota_trb_shd.g_old_rec.trb_information14;
626   End If;
627   If (p_rec.trb_information15 = hr_api.g_varchar2) then
628     p_rec.trb_information15 :=
629     ota_trb_shd.g_old_rec.trb_information15;
630   End If;
631   If (p_rec.trb_information16 = hr_api.g_varchar2) then
632     p_rec.trb_information16 :=
633     ota_trb_shd.g_old_rec.trb_information16;
634   End If;
635   If (p_rec.trb_information17 = hr_api.g_varchar2) then
636     p_rec.trb_information17 :=
637     ota_trb_shd.g_old_rec.trb_information17;
638   End If;
639   If (p_rec.trb_information18 = hr_api.g_varchar2) then
640     p_rec.trb_information18 :=
641     ota_trb_shd.g_old_rec.trb_information18;
642   End If;
643   If (p_rec.trb_information19 = hr_api.g_varchar2) then
644     p_rec.trb_information19 :=
645     ota_trb_shd.g_old_rec.trb_information19;
646   End If;
647   If (p_rec.trb_information20 = hr_api.g_varchar2) then
648     p_rec.trb_information20 :=
649     ota_trb_shd.g_old_rec.trb_information20;
650   End If;
651   If (p_rec.display_to_learner_flag = hr_api.g_varchar2) then
652     p_rec.display_to_learner_flag :=
653     ota_trb_shd.g_old_rec.display_to_learner_flag;
654   End If;
655   If (p_rec.book_entire_period_flag = hr_api.g_varchar2) then
656     p_rec.book_entire_period_flag :=
657     ota_trb_shd.g_old_rec.book_entire_period_flag;
658   End If;
659  /* If (p_rec.unbook_request_flag = hr_api.g_varchar2) then
660     p_rec.unbook_request_flag :=
661     ota_trb_shd.g_old_rec.unbook_request_flag;
662   End If; */
663   If (p_rec.chat_id = hr_api.g_number) then
664     p_rec.chat_id :=
665     ota_trb_shd.g_old_rec.chat_id;
666   End If;
667   If (p_rec.forum_id = hr_api.g_number) then
668     p_rec.forum_id :=
669     ota_trb_shd.g_old_rec.forum_id;
670   End If;
671   If (p_rec.timezone_code = hr_api.g_varchar2) then
672     p_rec.timezone_code :=
673     ota_trb_shd.g_old_rec.timezone_code;
674   End If;
675   --
676   hr_utility.set_location(' Leaving:'||l_proc, 10);
677   --
678 End convert_defs;
679 --
680 -- ----------------------------------------------------------------------------
681 -- |---------------------------------< upd >----------------------------------|
682 -- ----------------------------------------------------------------------------
683 Procedure upd
684   (p_effective_date               in date
685   ,p_rec                          in out nocopy ota_trb_shd.g_rec_type
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   ota_trb_shd.lck
696     (p_rec.resource_booking_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   ota_trb_bus.update_validate
708      (p_effective_date
709      ,p_rec
710      );
711   --
712   -- Call to raise any errors on multi-message list
713   hr_multi_message.end_validation_set;
714   --
715   -- Call the supporting pre-update operation
716   --
717   ota_trb_upd.pre_update(p_rec);
718   --
719   -- Update the row.
720   --
721   ota_trb_upd.update_dml(p_rec);
722   --
723   -- Call the supporting post-update operation
724   --
725   ota_trb_upd.post_update
726      (p_effective_date
727      ,p_rec
728      );
729   --
730   -- Call to raise any errors on multi-message list
731   hr_multi_message.end_validation_set;
732 End upd;
733 --
734 -- ----------------------------------------------------------------------------
735 -- |---------------------------------< upd >----------------------------------|
736 -- ----------------------------------------------------------------------------
737 Procedure upd
738   (p_effective_date               in     date
739   ,p_resource_booking_id          in     number
740   ,p_object_version_number        in out nocopy number
741   ,p_supplied_resource_id         in     number    default hr_api.g_number
742   ,p_date_booking_placed          in     date      default hr_api.g_date
743   ,p_status                       in     varchar2  default hr_api.g_varchar2
744   ,p_event_id                     in     number    default hr_api.g_number
745   ,p_absolute_price               in     number    default hr_api.g_number
746   ,p_booking_person_id            in     number    default hr_api.g_number
747   ,p_comments                     in     varchar2  default hr_api.g_varchar2
748   ,p_contact_name                 in     varchar2  default hr_api.g_varchar2
749   ,p_contact_phone_number         in     varchar2  default hr_api.g_varchar2
750   ,p_delegates_per_unit           in     number    default hr_api.g_number
751   ,p_quantity                     in     number    default hr_api.g_number
752   ,p_required_date_from           in     date      default hr_api.g_date
753   ,p_required_date_to             in     date      default hr_api.g_date
754   ,p_required_end_time            in     varchar2  default hr_api.g_varchar2
755   ,p_required_start_time          in     varchar2  default hr_api.g_varchar2
756   ,p_deliver_to                   in     varchar2  default hr_api.g_varchar2
757   ,p_primary_venue_flag           in     varchar2  default hr_api.g_varchar2
758   ,p_role_to_play                 in     varchar2  default hr_api.g_varchar2
759   ,p_trb_information_category     in     varchar2  default hr_api.g_varchar2
760   ,p_trb_information1             in     varchar2  default hr_api.g_varchar2
761   ,p_trb_information2             in     varchar2  default hr_api.g_varchar2
762   ,p_trb_information3             in     varchar2  default hr_api.g_varchar2
763   ,p_trb_information4             in     varchar2  default hr_api.g_varchar2
764   ,p_trb_information5             in     varchar2  default hr_api.g_varchar2
765   ,p_trb_information6             in     varchar2  default hr_api.g_varchar2
766   ,p_trb_information7             in     varchar2  default hr_api.g_varchar2
767   ,p_trb_information8             in     varchar2  default hr_api.g_varchar2
768   ,p_trb_information9             in     varchar2  default hr_api.g_varchar2
769   ,p_trb_information10            in     varchar2  default hr_api.g_varchar2
770   ,p_trb_information11            in     varchar2  default hr_api.g_varchar2
771   ,p_trb_information12            in     varchar2  default hr_api.g_varchar2
772   ,p_trb_information13            in     varchar2  default hr_api.g_varchar2
773   ,p_trb_information14            in     varchar2  default hr_api.g_varchar2
774   ,p_trb_information15            in     varchar2  default hr_api.g_varchar2
775   ,p_trb_information16            in     varchar2  default hr_api.g_varchar2
776   ,p_trb_information17            in     varchar2  default hr_api.g_varchar2
777   ,p_trb_information18            in     varchar2  default hr_api.g_varchar2
778   ,p_trb_information19            in     varchar2  default hr_api.g_varchar2
779   ,p_trb_information20            in     varchar2  default hr_api.g_varchar2
780   ,p_display_to_learner_flag      in     varchar2  default hr_api.g_varchar2
781   ,p_book_entire_period_flag    in     varchar2  default hr_api.g_varchar2
782 --  ,p_unbook_request_flag	  in     varchar2  default hr_api.g_varchar2
783   ,p_chat_id                      in     number    default hr_api.g_number
784   ,p_forum_id                     in     number    default hr_api.g_number
785   ,p_timezone_code                IN    VARCHAR2   DEFAULT hr_api.g_varchar2
786   ) is
787 --
788   l_rec   ota_trb_shd.g_rec_type;
789   l_proc  varchar2(72) := g_package||'upd';
790 --
791 Begin
792   hr_utility.set_location('Entering:'||l_proc, 5);
793   --
794   -- Call conversion function to turn arguments into the
795   -- l_rec structure.
796   --
797   l_rec :=
798   ota_trb_shd.convert_args
799   (p_resource_booking_id
800   ,p_supplied_resource_id
801   ,p_event_id
802   ,p_date_booking_placed
803   ,p_object_version_number
804   ,p_status
805   ,p_absolute_price
806   ,p_booking_person_id
807   ,p_comments
808   ,p_contact_name
809   ,p_contact_phone_number
810   ,p_delegates_per_unit
811   ,p_quantity
812   ,p_required_date_from
813   ,p_required_date_to
814   ,p_required_end_time
815   ,p_required_start_time
816   ,p_deliver_to
817   ,p_primary_venue_flag
818   ,p_role_to_play
819   ,p_trb_information_category
820   ,p_trb_information1
821   ,p_trb_information2
822   ,p_trb_information3
823   ,p_trb_information4
824   ,p_trb_information5
825   ,p_trb_information6
826   ,p_trb_information7
827   ,p_trb_information8
828   ,p_trb_information9
829   ,p_trb_information10
830   ,p_trb_information11
831   ,p_trb_information12
832   ,p_trb_information13
833   ,p_trb_information14
834   ,p_trb_information15
835   ,p_trb_information16
836   ,p_trb_information17
837   ,p_trb_information18
838   ,p_trb_information19
839   ,p_trb_information20
840   ,p_display_to_learner_flag
841   ,p_book_entire_period_flag
842  -- ,p_unbook_request_flag
843   ,p_chat_id
844   ,p_forum_id
845   ,p_timezone_code
846   );
847   --
848   -- Having converted the arguments into the
849   -- plsql record structure we call the corresponding record
850   -- business process.
851   --
852   ota_trb_upd.upd
853      (p_effective_date
854      ,l_rec
855      );
856   p_object_version_number := l_rec.object_version_number;
857   --
858   hr_utility.set_location(' Leaving:'||l_proc, 10);
859 End upd;
860 --
861 end ota_trb_upd;