DBA Data[Home] [Help]

PACKAGE: APPS.OTA_TRB_SHD

Source


1 Package ota_trb_shd as
2 /* $Header: ottrbrhi.pkh 120.3.12000000.1 2007/01/18 05:24:38 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                    Global Record Type Specification                      |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9   (resource_booking_id             number(9)
10   ,supplied_resource_id            number(9)
11   ,event_id                        number(9)
12   ,date_booking_placed             date
13   ,object_version_number           number(9)         -- Increased length
14   ,status                          varchar2(30)
15   ,absolute_price                  number(17,2)      -- Increased length
16   ,booking_person_id               number(10)
17   ,comments                        varchar2(2000)    -- pseudo column
18   ,contact_name                    varchar2(80)
19   ,contact_phone_number            varchar2(80)
20   ,delegates_per_unit              number(9)
21   ,quantity                        number(9)
22   ,required_date_from              date
23   ,required_date_to                date
24   ,required_end_time               varchar2(9)       -- Increased length
25   ,required_start_time             varchar2(9)       -- Increased length
26   ,deliver_to                      varchar2(2000)
27   ,primary_venue_flag              varchar2(30)
28   ,role_to_play                    varchar2(30)
29   ,trb_information_category        varchar2(30)
30   ,trb_information1                varchar2(150)
31   ,trb_information2                varchar2(150)
32   ,trb_information3                varchar2(150)
33   ,trb_information4                varchar2(150)
34   ,trb_information5                varchar2(150)
35   ,trb_information6                varchar2(150)
36   ,trb_information7                varchar2(150)
37   ,trb_information8                varchar2(150)
38   ,trb_information9                varchar2(150)
39   ,trb_information10               varchar2(150)
40   ,trb_information11               varchar2(150)
41   ,trb_information12               varchar2(150)
42   ,trb_information13               varchar2(150)
43   ,trb_information14               varchar2(150)
44   ,trb_information15               varchar2(150)
45   ,trb_information16               varchar2(150)
46   ,trb_information17               varchar2(150)
47   ,trb_information18               varchar2(150)
48   ,trb_information19               varchar2(150)
49   ,trb_information20               varchar2(150)
50   ,display_to_learner_flag         varchar2(9)
51    ,book_entire_period_flag         varchar2(9)
52  --   ,unbook_request_flag         varchar2(1)
53   ,chat_id                         number(15)
54   ,forum_id                        number(15)
55   ,timezone_code                   varchar2(50)
56   );
57 --
58 -- ----------------------------------------------------------------------------
59 -- |           Global Definitions - Internal Development Use Only             |
60 -- ----------------------------------------------------------------------------
61 --
62 g_old_rec  g_rec_type;                            -- Global record definition
63 -- Global table name
64 g_tab_nam  constant varchar2(30) := 'OTA_RESOURCE_BOOKINGS';
65 g_api_dml  boolean;                               -- Global api dml status
66 --
67 -- ----------------------------------------------------------------------------
68 -- |------------------------< return_api_dml_status >-------------------------|
69 -- ----------------------------------------------------------------------------
70 -- {Start Of Comments}
71 --
72 -- Description:
73 --   This function will return the current g_api_dml private global
74 --   boolean status.
75 --   The g_api_dml status determines if at the time of the function
76 --   being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
77 --   is being issued from within an api.
78 --   If the status is TRUE then a dml statement is being issued from
79 --   within this entity api.
80 --   This function is primarily to support database triggers which
81 --   need to maintain the object_version_number for non-supported
82 --   dml statements (i.e. dml statement issued outside of the api layer).
83 --
84 -- Prerequisites:
85 --   None.
86 --
87 -- In Parameters:
88 --   None.
89 --
90 -- Post Success:
91 --   Processing continues.
92 --   If the function returns a TRUE value then, dml is being executed from
93 --   within this api.
94 --
95 -- Post Failure:
96 --   None.
97 --
98 -- Access Status:
99 --   Internal Row Handler Use Only.
100 --
101 -- {End Of Comments}
102 -- ----------------------------------------------------------------------------
103 Function return_api_dml_status Return Boolean;
104 --
105 -- ----------------------------------------------------------------------------
106 -- |---------------------------< constraint_error >---------------------------|
107 -- ----------------------------------------------------------------------------
108 -- {Start Of Comments}
109 --
110 -- Description:
111 --   This procedure is called when a constraint has been violated (i.e.
112 --   The exception hr_api.check_integrity_violated,
113 --   hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
114 --   hr_api.unique_integrity_violated has been raised).
115 --   The exceptions can only be raised as follows:
116 --   1) A check constraint can only be violated during an INSERT or UPDATE
117 --      dml operation.
118 --   2) A parent integrity constraint can only be violated during an
119 --      INSERT or UPDATE dml operation.
120 --   3) A child integrity constraint can only be violated during an
121 --      DELETE dml operation.
122 --   4) A unique integrity constraint can only be violated during INSERT or
123 --      UPDATE dml operation.
124 --
125 -- Prerequisites:
126 --   1) Either hr_api.check_integrity_violated,
127 --      hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
128 --      hr_api.unique_integrity_violated has been raised with the subsequent
129 --      stripping of the constraint name from the generated error message
130 --      text.
131 --   2) Standalone validation test which corresponds with a constraint error.
132 --
133 -- In Parameter:
134 --   p_constraint_name is in upper format and is just the constraint name
135 --   (e.g. not prefixed by brackets, schema owner etc).
136 --
137 -- Post Success:
138 --   Development dependant.
139 --
140 -- Post Failure:
141 --   Developement dependant.
142 --
143 -- Developer Implementation Notes:
144 --   For each constraint being checked the hr system package failure message
145 --   has been generated as a template only. These system error messages should
146 --   be modified as required (i.e. change the system failure message to a user
147 --   friendly defined error message).
148 --
149 -- Access Status:
150 --   Internal Development Use Only.
151 --
152 -- {End Of Comments}
153 -- ----------------------------------------------------------------------------
154 Procedure constraint_error
155   (p_constraint_name in all_constraints.constraint_name%TYPE);
156 --
157 -- ----------------------------------------------------------------------------
158 -- |-----------------------------< api_updating >-----------------------------|
159 -- ----------------------------------------------------------------------------
160 --  {Start Of Comments}
161 --
162 -- Description:
163 --   This function is used to populate the g_old_rec record with the
164 --   current row from the database for the specified primary key
165 --   provided that the primary key exists and is valid and does not
166 --   already match the current g_old_rec. The function will always return
167 --   a TRUE value if the g_old_rec is populated with the current row.
168 --   A FALSE value will be returned if all of the primary key arguments
169 --   are null.
170 --
171 -- Prerequisites:
172 --   None.
173 --
174 -- In Parameters:
175 --
176 -- Post Success:
177 --   A value of TRUE will be returned indiciating that the g_old_rec
178 --   is current.
179 --   A value of FALSE will be returned if all of the primary key arguments
180 --   have a null value (this indicates that the row has not be inserted into
181 --   the Schema), and therefore could never have a corresponding row.
182 --
183 -- Post Failure:
184 --   A failure can only occur under two circumstances:
185 --   1) The primary key is invalid (i.e. a row does not exist for the
186 --      specified primary key values).
187 --   2) If an object_version_number exists but is NOT the same as the current
188 --      g_old_rec value.
189 --
190 -- Developer Implementation Notes:
191 --   None.
192 --
193 -- Access Status:
194 --   Internal Development Use Only.
195 --
196 -- {End Of Comments}
197 -- ----------------------------------------------------------------------------
198 Function api_updating
199   (p_resource_booking_id                  in     number
200   ,p_object_version_number                in     number
201   )      Return Boolean;
202 --
203 -- ----------------------------------------------------------------------------
204 -- |---------------------------------< lck >----------------------------------|
205 -- ----------------------------------------------------------------------------
206 -- {Start of comments}
207 --
208 -- Description:
209 --   The Lck process has two main functions to perform. Firstly, the row to be
210 --   updated or deleted must be locked. The locking of the row will only be
211 --   successful if the row is not currently locked by another user.
212 --   Secondly, during the locking of the row, the row is selected into
213 --   the g_old_rec data structure which enables the current row values from
214 --   the server to be available to the api.
215 --
216 -- Prerequisites:
217 --   When attempting to call the lock the object version number (if defined)
218 --   is mandatory.
219 --
220 -- In Parameters:
221 --   The arguments to the Lck process are the primary key(s) which uniquely
222 --   identify the row and the object version number of row.
223 --
224 -- Post Success:
225 --   On successful completion of the Lck process the row to be updated or
226 --   deleted will be locked and selected into the global data structure
227 --   g_old_rec.
228 --
229 -- Post Failure:
230 --   The Lck process can fail for three reasons:
231 --   1) When attempting to lock the row the row could already be locked by
232 --      another user. This will raise the HR_Api.Object_Locked exception.
233 --   2) The row which is required to be locked doesn't exist in the HR Schema.
234 --      This error is trapped and reported using the message name
235 --      'HR_7220_INVALID_PRIMARY_KEY'.
236 --   3) The row although existing in the HR Schema has a different object
237 --      version number than the object version number specified.
238 --      This error is trapped and reported using the message name
239 --      'HR_7155_OBJECT_INVALID'.
240 --
241 -- Developer Implementation Notes:
242 --   For each primary key and the object version number arguments add a
243 --   call to hr_api.mandatory_arg_error procedure to ensure that these
244 --   argument values are not null.
245 --
246 -- Access Status:
247 --   Internal Development Use Only.
248 --
249 -- {End of comments}
250 -- ----------------------------------------------------------------------------
251 Procedure lck
252   (p_resource_booking_id                  in     number
253   ,p_object_version_number                in     number
254   );
255 --
256 -- ----------------------------------------------------------------------------
257 -- |-----------------------------< convert_args >-----------------------------|
258 -- ----------------------------------------------------------------------------
259 -- {Start Of Comments}
260 --
261 -- Description:
262 --   This function is used to turn attribute parameters into the record
263 --   structure parameter g_rec_type.
264 --
265 -- Prerequisites:
266 --   This is a private function and can only be called from the ins or upd
267 --   attribute processes.
268 --
269 -- In Parameters:
270 --
271 -- Post Success:
272 --   A returning record structure will be returned.
273 --
274 -- Post Failure:
275 --   No direct error handling is required within this function.  Any possible
276 --   errors within this function will be a PL/SQL value error due to
277 --   conversion of datatypes or data lengths.
278 --
279 -- Developer Implementation Notes:
280 --   None.
281 --
282 -- Access Status:
283 --   Internal Row Handler Use Only.
284 --
285 -- {End Of Comments}
286 -- ----------------------------------------------------------------------------
287 Function convert_args
288   (p_resource_booking_id            in number
289   ,p_supplied_resource_id           in number
290   ,p_event_id                       in number
291   ,p_date_booking_placed            in date
292   ,p_object_version_number          in number
293   ,p_status                         in varchar2
294   ,p_absolute_price                 in number
295   ,p_booking_person_id              in number
296   ,p_comments                       in varchar2
297   ,p_contact_name                   in varchar2
298   ,p_contact_phone_number           in varchar2
299   ,p_delegates_per_unit             in number
300   ,p_quantity                       in number
301   ,p_required_date_from             in date
302   ,p_required_date_to               in date
303   ,p_required_end_time              in varchar2
304   ,p_required_start_time            in varchar2
305   ,p_deliver_to                     in varchar2
306   ,p_primary_venue_flag             in varchar2
307   ,p_role_to_play                   in varchar2
308   ,p_trb_information_category       in varchar2
309   ,p_trb_information1               in varchar2
310   ,p_trb_information2               in varchar2
311   ,p_trb_information3               in varchar2
312   ,p_trb_information4               in varchar2
313   ,p_trb_information5               in varchar2
314   ,p_trb_information6               in varchar2
315   ,p_trb_information7               in varchar2
316   ,p_trb_information8               in varchar2
317   ,p_trb_information9               in varchar2
318   ,p_trb_information10              in varchar2
319   ,p_trb_information11              in varchar2
320   ,p_trb_information12              in varchar2
321   ,p_trb_information13              in varchar2
322   ,p_trb_information14              in varchar2
323   ,p_trb_information15              in varchar2
324   ,p_trb_information16              in varchar2
325   ,p_trb_information17              in varchar2
326   ,p_trb_information18              in varchar2
327   ,p_trb_information19              in varchar2
328   ,p_trb_information20              in varchar2
329   ,p_display_to_learner_flag      in     varchar2
330   ,p_book_entire_period_flag    in     varchar2
331   --,p_unbook_request_flag    in     varchar2
332   ,p_chat_id                        in number
333   ,p_forum_id                       in number
334   ,p_timezone_code                  IN VARCHAR2
335   )
336   Return g_rec_type;
337 --
338 end ota_trb_shd;