1 Package ota_tdb_shd as
2 /* $Header: ottdb01t.pkh 120.5 2007/11/21 13:43:01 shwnayak noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (
10 booking_id number(9),
11 booking_status_type_id number(9),
12 delegate_person_id ota_delegate_bookings.delegate_person_id%TYPE,
13 contact_id number(15),
14 business_group_id number(9),
15 event_id number(9),
16 customer_id number(15),
17 authorizer_person_id ota_delegate_bookings.authorizer_person_id%TYPE,
18 date_booking_placed date,
19 corespondent varchar2(30),
20 internal_booking_flag varchar2(30),
21 number_of_places number(9),
22 object_version_number number(9), -- Increased length
23 administrator number(9),
24 booking_priority varchar2(30),
25 comments varchar2(2000),
26 contact_address_id number(15),
27 delegate_contact_phone varchar2(30),
28 delegate_contact_fax varchar2(30),
29 -- Modified for Bug#4049773
30 --third_party_customer_id number(9),
31 --third_party_contact_id number(9),
32 --third_party_address_id number(9),
33 third_party_customer_id number(15),
34 third_party_contact_id number(15),
35 third_party_address_id number(15),
36 third_party_contact_phone varchar2(30),
37 third_party_contact_fax varchar2(30),
38 date_status_changed date,
39 failure_reason varchar2(30),
40 attendance_result varchar2(255),
41 language_id number(9),
42 source_of_booking varchar2(30),
43 special_booking_instructions varchar2(2000),
44 successful_attendance_flag varchar2(30),
45 tdb_information_category varchar2(30),
46 tdb_information1 varchar2(150),
47 tdb_information2 varchar2(150),
48 tdb_information3 varchar2(150),
49 tdb_information4 varchar2(150),
50 tdb_information5 varchar2(150),
51 tdb_information6 varchar2(150),
52 tdb_information7 varchar2(150),
53 tdb_information8 varchar2(150),
54 tdb_information9 varchar2(150),
55 tdb_information10 varchar2(150),
56 tdb_information11 varchar2(150),
57 tdb_information12 varchar2(150),
58 tdb_information13 varchar2(150),
59 tdb_information14 varchar2(150),
60 tdb_information15 varchar2(150),
61 tdb_information16 varchar2(150),
62 tdb_information17 varchar2(150),
63 tdb_information18 varchar2(150),
64 tdb_information19 varchar2(150),
65 tdb_information20 varchar2(150),
66 organization_id number(15),
67 sponsor_person_id ota_delegate_bookings.sponsor_person_id%TYPE,
68 sponsor_assignment_id ota_delegate_bookings.sponsor_assignment_id%TYPE,
69 person_address_id number(15),
70 delegate_assignment_id ota_delegate_bookings.delegate_assignment_id%TYPE,
71 delegate_contact_id number(15),
72 delegate_contact_email varchar2(240),
73 third_party_email varchar2(240),
74 person_address_type varchar2(30),
75 line_id number(15),
76 org_id number(15),
77 daemon_flag varchar2(15),
78 daemon_type varchar2(15),
79 old_event_id number(9),
80 quote_line_id number,
81 interface_source varchar2(30),
82 total_training_time varchar2(10),
83 content_player_status varchar2(30),
84 score number ,
85 completed_content number ,
86 total_content number,
87 booking_justification_id number(15)
88 ,is_history_flag varchar2(9)
89 ,is_mandatory_enrollment ota_delegate_bookings.is_mandatory_enrollment%TYPE
90 );
91 --
92 -- ----------------------------------------------------------------------------
93 -- | Global Definitions - Internal Development Use Only |
94 -- ----------------------------------------------------------------------------
95 --
96 g_old_rec g_rec_type; -- Global record definition
97 g_created_by number; -- Global creation user
98 g_api_dml boolean; -- Global api dml status
99 --
100 -- ----------------------------------------------------------------------------
101 -- |------------------------< return_api_dml_status >-------------------------|
102 -- ----------------------------------------------------------------------------
103 -- {Start Of Comments}
104 --
105 -- Description:
106 -- This function will return the current g_api_dml private global
107 -- boolean status.
108 -- The g_api_dml status determines if at the time of the function
109 -- being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
110 -- is being issued from within an api.
111 -- If the status is TRUE then a dml statement is being issued from
112 -- within this entity api.
113 -- This function is primarily to support database triggers which
114 -- need to maintain the object_version_number for non-supported
115 -- dml statements (i.e. dml statement issued outside of the api layer).
116 --
117 -- Pre Conditions:
118 -- None.
119 --
120 -- In Arguments:
121 -- None.
122 --
123 -- Post Success:
124 -- Processing continues.
125 -- If the function returns a TRUE value then, dml is being executed from
126 -- within this api.
127 --
128 -- Post Failure:
129 -- None.
130 --
131 -- Access Status:
132 -- Public.
133 --
134 -- {End Of Comments}
135 -- ----------------------------------------------------------------------------
136 Function return_api_dml_status Return Boolean;
137 --
138 -- ----------------------------------------------------------------------------
139 -- |---------------------------< constraint_error >---------------------------|
140 -- ----------------------------------------------------------------------------
141 -- {Start Of Comments}
142 --
143 -- Description:
144 -- This procedure is called when a constraint has been violated (i.e.
145 -- The exception hr_api.check_integrity_violated,
146 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
147 -- hr_api.unique_integrity_violated has been raised).
148 -- The exceptions can only be raised as follows:
149 -- 1) A check constraint can only be violated during an INSERT or UPDATE
150 -- dml operation.
151 -- 2) A parent integrity constraint can only be violated during an
152 -- INSERT or UPDATE dml operation.
153 -- 3) A child integrity constraint can only be violated during an
154 -- DELETE dml operation.
155 -- 4) A unique integrity constraint can only be violated during INSERT or
156 -- UPDATE dml operation.
157 --
158 -- Pre Conditions:
159 -- 1) Either hr_api.check_integrity_violated,
160 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
161 -- hr_api.unique_integrity_violated has been raised with the subsequent
162 -- stripping of the constraint name from the generated error message
163 -- text.
164 -- 2) Standalone validation test which correspond with a constraint error.
165 --
166 -- In Arguments:
167 -- p_constraint_name is in upper format and is just the constraint name
168 -- (e.g. not prefixed by brackets, schema owner etc).
169 --
170 -- Post Success:
171 -- Development dependant.
172 --
173 -- Post Failure:
174 -- Developement dependant.
175 --
176 -- Developer Implementation Notes:
177 -- For each constraint being checked the hr system package failure message
178 -- has been generated as a template only. These system error messages should
179 -- be modified as required (i.e. change the system failure message to a user
180 -- friendly defined error message).
181 --
182 -- Access Status:
183 -- Public.
184 --
185 -- {End Of Comments}
186 -- ----------------------------------------------------------------------------
187 Procedure constraint_error
188 (p_constraint_name in varchar2);
189 --
190 -- ----------------------------------------------------------------------------
191 -- |-----------------------------< api_updating >-----------------------------|
192 -- ----------------------------------------------------------------------------
193 -- {Start Of Comments}
194 --
195 -- Description:
196 -- This function is used to populate the g_old_rec record with the
197 -- current row from the database for the specified primary key
198 -- provided that the primary key exists and is valid and does not
199 -- already match the current g_old_rec. The function will always return
200 -- a TRUE value if the g_old_rec is populated with the current row.
201 -- A FALSE value will be returned if all of the primary key arguments
202 -- are null.
203 --
204 -- Pre Conditions:
205 -- None.
206 --
207 -- In Arguments:
208 --
209 -- Post Success:
210 -- A value of TRUE will be returned indiciating that the g_old_rec
211 -- is current.
212 -- A value of FALSE will be returned if all of the primary key arguments
213 -- have a null value (this indicates that the row has not be inserted into
214 -- the Schema), and therefore could never have a corresponding row.
215 --
216 -- Post Failure:
217 -- A failure can only occur under two circumstances:
218 -- 1) The primary key is invalid (i.e. a row does not exist for the
219 -- specified primary key values).
220 -- 2) If an object_version_number exists but is NOT the same as the current
221 -- g_old_rec value.
222 --
223 -- Developer Implementation Notes:
224 -- None.
225 --
226 -- Access Status:
227 -- Internal Development Use Only.
228 --
229 -- {End Of Comments}
230 -- ----------------------------------------------------------------------------
231 Function api_updating
232 (
233 p_booking_id in number,
234 p_object_version_number in number
235 ) Return Boolean;
236 --
237 -- ----------------------------------------------------------------------------
238 -- |---------------------------------< lck >----------------------------------|
239 -- ----------------------------------------------------------------------------
240 -- {Start Of Comments}
241 --
242 -- Description:
243 -- The Lck process has two main functions to perform. Firstly, the row to be
244 -- updated or deleted must be locked. The locking of the row will only be
245 -- successful if the row is not currently locked by another user.
246 -- Secondly, during the locking of the row, the row is selected into
247 -- the g_old_rec data structure which enables the current row values from the
248 -- server to be available to the api.
249 --
250 -- Pre Conditions:
251 -- When attempting to call the lock the object version number (if defined)
252 -- is mandatory.
253 --
254 -- In Arguments:
255 -- The arguments to the Lck process are the primary key(s) which uniquely
256 -- identify the row and the object version number of row.
257 --
258 -- Post Success:
259 -- On successful completion of the Lck process the row to be updated or
260 -- deleted will be locked and selected into the global data structure
261 -- g_old_rec.
262 --
263 -- Post Failure:
264 -- The Lck process can fail for three reasons:
265 -- 1) When attempting to lock the row the row could already be locked by
266 -- another user. This will raise the HR_Api.Object_Locked exception.
267 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
268 -- This error is trapped and reported using the message name
269 -- 'HR_7220_INVALID_PRIMARY_KEY'.
270 -- 3) The row although existing in the HR Schema has a different object
271 -- version number than the object version number specified.
272 -- This error is trapped and reported using the message name
273 -- 'HR_7155_OBJECT_INVALID'.
274 --
275 -- Developer Implementation Notes:
276 -- For each primary key and the object version number arguments add a
277 -- call to hr_api.mandatory_arg_error procedure to ensure that these
278 -- argument values are not null.
279 --
280 -- Access Status:
281 -- Public.
282 --
283 -- {End Of Comments}
284 -- ----------------------------------------------------------------------------
285 Procedure lck
286 (
287 p_booking_id in number,
288 p_object_version_number in number
289 );
290 --
291 -- ----------------------------------------------------------------------------
292 -- |-----------------------------< convert_args >-----------------------------|
293 -- ----------------------------------------------------------------------------
294 -- {Start Of Comments}
295 --
296 -- Description:
297 -- This function is used to turn attribute arguments into the record
298 -- structure g_rec_type.
299 --
300 -- Pre Conditions:
301 -- This is a private function and can only be called from the ins or upd
302 -- attribute processes.
303 --
304 -- In Arguments:
305 --
306 -- Post Success:
307 -- A returning record structure will be returned.
308 --
309 -- Post Failure:
310 -- No direct error handling is required within this function. Any possible
314 -- Developer Implementation Notes:
311 -- errors within this function will be a PL/SQL value error due to conversion
312 -- of datatypes or data lengths.
313 --
315 -- None.
316 --
317 -- Access Status:
318 -- Internal Development Use Only.
319 --
320 -- {End Of Comments}
321 -- ----------------------------------------------------------------------------
322 Function convert_args
323 (
324 p_booking_id in number,
325 p_booking_status_type_id in number,
326 p_delegate_person_id in number,
327 p_contact_id in number,
328 p_business_group_id in number,
329 p_event_id in number,
330 p_customer_id in number,
331 p_authorizer_person_id in number,
332 p_date_booking_placed in date,
333 p_corespondent in varchar2,
334 p_internal_booking_flag in varchar2,
335 p_number_of_places in number,
336 p_object_version_number in number,
337 p_administrator in number,
338 p_booking_priority in varchar2,
339 p_comments in varchar2,
340 p_contact_address_id in number,
341 p_delegate_contact_phone in varchar2,
342 p_delegate_contact_fax in varchar2,
343 p_third_party_customer_id in number,
344 p_third_party_contact_id in number,
345 p_third_party_address_id in number,
346 p_third_party_contact_phone in varchar2,
347 p_third_party_contact_fax in varchar2,
348 p_date_status_changed in date,
349 p_failure_reason in varchar2,
350 p_attendance_result in varchar2,
351 p_language_id in number,
352 p_source_of_booking in varchar2,
353 p_special_booking_instructions in varchar2,
354 p_successful_attendance_flag in varchar2,
355 p_tdb_information_category in varchar2,
356 p_tdb_information1 in varchar2,
357 p_tdb_information2 in varchar2,
358 p_tdb_information3 in varchar2,
359 p_tdb_information4 in varchar2,
360 p_tdb_information5 in varchar2,
361 p_tdb_information6 in varchar2,
362 p_tdb_information7 in varchar2,
363 p_tdb_information8 in varchar2,
364 p_tdb_information9 in varchar2,
365 p_tdb_information10 in varchar2,
366 p_tdb_information11 in varchar2,
367 p_tdb_information12 in varchar2,
368 p_tdb_information13 in varchar2,
369 p_tdb_information14 in varchar2,
370 p_tdb_information15 in varchar2,
371 p_tdb_information16 in varchar2,
372 p_tdb_information17 in varchar2,
373 p_tdb_information18 in varchar2,
374 p_tdb_information19 in varchar2,
375 p_tdb_information20 in varchar2,
376 p_organization_id in number,
377 p_sponsor_person_id in number,
378 p_sponsor_assignment_id in number,
379 p_person_address_id in number,
380 p_delegate_assignment_id in number,
381 p_delegate_contact_id in number,
382 p_delegate_contact_email in varchar2,
383 p_third_party_email in varchar2,
384 p_person_address_type in varchar2,
385 p_line_id in number,
386 p_org_id in number,
387 p_daemon_flag in varchar2,
388 p_daemon_type in varchar2,
389 p_old_event_id in number,
390 p_quote_line_id in number,
391 p_interface_source in varchar2,
392 p_total_training_time in varchar2 ,
393 p_content_player_status in varchar2 ,
394 p_score in number ,
395 p_completed_content in number ,
396 p_total_content in number,
397 p_booking_justification_id in number
398 ,p_is_history_flag in varchar2
399 ,p_is_mandatory_enrollment in varchar2 default 'N')
400 Return g_rec_type;
401 --
402 end ota_tdb_shd;