1 Package ota_tdb_shd AUTHID CURRENT_USER as
2 /* $Header: ottdb01t.pkh 120.7 2011/05/20 06:58:24 jaysridh ship $ */
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(60), -- Increased length
28 delegate_contact_fax varchar2(60), -- Increased length
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 ,sign_eval_status ota_delegate_bookings.sign_eval_status%TYPE,
90 is_mandatory_enrollment ota_delegate_bookings.is_mandatory_enrollment%TYPE
91 );
92 --
93 -- ----------------------------------------------------------------------------
94 -- | Global Definitions - Internal Development Use Only |
95 -- ----------------------------------------------------------------------------
96 --
97 g_old_rec g_rec_type; -- Global record definition
98 g_created_by number; -- Global creation user
99 g_api_dml boolean; -- Global api dml status
100 --
101 -- ----------------------------------------------------------------------------
102 -- |------------------------< return_api_dml_status >-------------------------|
103 -- ----------------------------------------------------------------------------
104 -- {Start Of Comments}
105 --
106 -- Description:
107 -- This function will return the current g_api_dml private global
108 -- boolean status.
109 -- The g_api_dml status determines if at the time of the function
110 -- being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
111 -- is being issued from within an api.
112 -- If the status is TRUE then a dml statement is being issued from
113 -- within this entity api.
114 -- This function is primarily to support database triggers which
115 -- need to maintain the object_version_number for non-supported
116 -- dml statements (i.e. dml statement issued outside of the api layer).
117 --
118 -- Pre Conditions:
119 -- None.
120 --
121 -- In Arguments:
122 -- None.
123 --
124 -- Post Success:
125 -- Processing continues.
126 -- If the function returns a TRUE value then, dml is being executed from
127 -- within this api.
128 --
129 -- Post Failure:
130 -- None.
131 --
132 -- Access Status:
133 -- Public.
134 --
135 -- {End Of Comments}
136 -- ----------------------------------------------------------------------------
137 Function return_api_dml_status Return Boolean;
138 --
139 -- ----------------------------------------------------------------------------
140 -- |---------------------------< constraint_error >---------------------------|
141 -- ----------------------------------------------------------------------------
142 -- {Start Of Comments}
143 --
144 -- Description:
145 -- This procedure is called when a constraint has been violated (i.e.
146 -- The exception hr_api.check_integrity_violated,
147 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
148 -- hr_api.unique_integrity_violated has been raised).
149 -- The exceptions can only be raised as follows:
150 -- 1) A check constraint can only be violated during an INSERT or UPDATE
151 -- dml operation.
152 -- 2) A parent integrity constraint can only be violated during an
153 -- INSERT or UPDATE dml operation.
154 -- 3) A child integrity constraint can only be violated during an
155 -- DELETE dml operation.
156 -- 4) A unique integrity constraint can only be violated during INSERT or
157 -- UPDATE dml operation.
158 --
159 -- Pre Conditions:
160 -- 1) Either hr_api.check_integrity_violated,
161 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
162 -- hr_api.unique_integrity_violated has been raised with the subsequent
163 -- stripping of the constraint name from the generated error message
164 -- text.
165 -- 2) Standalone validation test which correspond with a constraint error.
166 --
167 -- In Arguments:
168 -- p_constraint_name is in upper format and is just the constraint name
169 -- (e.g. not prefixed by brackets, schema owner etc).
170 --
171 -- Post Success:
172 -- Development dependant.
173 --
174 -- Post Failure:
175 -- Developement dependant.
176 --
177 -- Developer Implementation Notes:
178 -- For each constraint being checked the hr system package failure message
179 -- has been generated as a template only. These system error messages should
180 -- be modified as required (i.e. change the system failure message to a user
181 -- friendly defined error message).
182 --
183 -- Access Status:
184 -- Public.
185 --
186 -- {End Of Comments}
187 -- ----------------------------------------------------------------------------
188 Procedure constraint_error
189 (p_constraint_name in varchar2);
190 --
191 -- ----------------------------------------------------------------------------
192 -- |-----------------------------< api_updating >-----------------------------|
193 -- ----------------------------------------------------------------------------
194 -- {Start Of Comments}
195 --
196 -- Description:
197 -- This function is used to populate the g_old_rec record with the
198 -- current row from the database for the specified primary key
199 -- provided that the primary key exists and is valid and does not
200 -- already match the current g_old_rec. The function will always return
201 -- a TRUE value if the g_old_rec is populated with the current row.
202 -- A FALSE value will be returned if all of the primary key arguments
203 -- are null.
204 --
205 -- Pre Conditions:
206 -- None.
207 --
208 -- In Arguments:
209 --
210 -- Post Success:
211 -- A value of TRUE will be returned indiciating that the g_old_rec
212 -- is current.
213 -- A value of FALSE will be returned if all of the primary key arguments
214 -- have a null value (this indicates that the row has not be inserted into
215 -- the Schema), and therefore could never have a corresponding row.
216 --
217 -- Post Failure:
218 -- A failure can only occur under two circumstances:
219 -- 1) The primary key is invalid (i.e. a row does not exist for the
220 -- specified primary key values).
221 -- 2) If an object_version_number exists but is NOT the same as the current
222 -- g_old_rec value.
223 --
224 -- Developer Implementation Notes:
225 -- None.
226 --
227 -- Access Status:
228 -- Internal Development Use Only.
229 --
230 -- {End Of Comments}
231 -- ----------------------------------------------------------------------------
232 Function api_updating
233 (
234 p_booking_id in number,
235 p_object_version_number in number
236 ) Return Boolean;
237 --
238 -- ----------------------------------------------------------------------------
239 -- |---------------------------------< lck >----------------------------------|
240 -- ----------------------------------------------------------------------------
241 -- {Start Of Comments}
242 --
243 -- Description:
244 -- The Lck process has two main functions to perform. Firstly, the row to be
245 -- updated or deleted must be locked. The locking of the row will only be
246 -- successful if the row is not currently locked by another user.
247 -- Secondly, during the locking of the row, the row is selected into
248 -- the g_old_rec data structure which enables the current row values from the
249 -- server to be available to the api.
250 --
251 -- Pre Conditions:
252 -- When attempting to call the lock the object version number (if defined)
253 -- is mandatory.
254 --
255 -- In Arguments:
256 -- The arguments to the Lck process are the primary key(s) which uniquely
257 -- identify the row and the object version number of row.
258 --
259 -- Post Success:
260 -- On successful completion of the Lck process the row to be updated or
261 -- deleted will be locked and selected into the global data structure
262 -- g_old_rec.
263 --
264 -- Post Failure:
265 -- The Lck process can fail for three reasons:
266 -- 1) When attempting to lock the row the row could already be locked by
267 -- another user. This will raise the HR_Api.Object_Locked exception.
268 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
269 -- This error is trapped and reported using the message name
270 -- 'HR_7220_INVALID_PRIMARY_KEY'.
271 -- 3) The row although existing in the HR Schema has a different object
272 -- version number than the object version number specified.
273 -- This error is trapped and reported using the message name
274 -- 'HR_7155_OBJECT_INVALID'.
275 --
276 -- Developer Implementation Notes:
277 -- For each primary key and the object version number arguments add a
278 -- call to hr_api.mandatory_arg_error procedure to ensure that these
279 -- argument values are not null.
280 --
281 -- Access Status:
282 -- Public.
283 --
284 -- {End Of Comments}
285 -- ----------------------------------------------------------------------------
286 Procedure lck
287 (
288 p_booking_id in number,
289 p_object_version_number in number
290 );
291 --
292 -- ----------------------------------------------------------------------------
293 -- |-----------------------------< convert_args >-----------------------------|
294 -- ----------------------------------------------------------------------------
295 -- {Start Of Comments}
296 --
297 -- Description:
298 -- This function is used to turn attribute arguments into the record
299 -- structure g_rec_type.
300 --
301 -- Pre Conditions:
302 -- This is a private function and can only be called from the ins or upd
303 -- attribute processes.
304 --
305 -- In Arguments:
306 --
307 -- Post Success:
308 -- A returning record structure will be returned.
309 --
310 -- Post Failure:
311 -- No direct error handling is required within this function. Any possible
312 -- errors within this function will be a PL/SQL value error due to conversion
313 -- of datatypes or data lengths.
314 --
315 -- Developer Implementation Notes:
316 -- None.
317 --
318 -- Access Status:
319 -- Internal Development Use Only.
320 --
321 -- {End Of Comments}
322 -- ----------------------------------------------------------------------------
323 Function convert_args
324 (
325 p_booking_id in number,
326 p_booking_status_type_id in number,
327 p_delegate_person_id in number,
328 p_contact_id in number,
332 p_authorizer_person_id in number,
329 p_business_group_id in number,
330 p_event_id in number,
331 p_customer_id in number,
333 p_date_booking_placed in date,
334 p_corespondent in varchar2,
335 p_internal_booking_flag in varchar2,
336 p_number_of_places in number,
337 p_object_version_number in number,
338 p_administrator in number,
339 p_booking_priority in varchar2,
340 p_comments in varchar2,
341 p_contact_address_id in number,
342 p_delegate_contact_phone in varchar2,
343 p_delegate_contact_fax in varchar2,
344 p_third_party_customer_id in number,
345 p_third_party_contact_id in number,
346 p_third_party_address_id in number,
347 p_third_party_contact_phone in varchar2,
348 p_third_party_contact_fax in varchar2,
349 p_date_status_changed in date,
350 p_failure_reason in varchar2,
351 p_attendance_result in varchar2,
352 p_language_id in number,
353 p_source_of_booking in varchar2,
354 p_special_booking_instructions in varchar2,
355 p_successful_attendance_flag in varchar2,
356 p_tdb_information_category in varchar2,
357 p_tdb_information1 in varchar2,
358 p_tdb_information2 in varchar2,
359 p_tdb_information3 in varchar2,
360 p_tdb_information4 in varchar2,
361 p_tdb_information5 in varchar2,
362 p_tdb_information6 in varchar2,
363 p_tdb_information7 in varchar2,
364 p_tdb_information8 in varchar2,
365 p_tdb_information9 in varchar2,
366 p_tdb_information10 in varchar2,
367 p_tdb_information11 in varchar2,
368 p_tdb_information12 in varchar2,
369 p_tdb_information13 in varchar2,
370 p_tdb_information14 in varchar2,
371 p_tdb_information15 in varchar2,
372 p_tdb_information16 in varchar2,
373 p_tdb_information17 in varchar2,
374 p_tdb_information18 in varchar2,
375 p_tdb_information19 in varchar2,
376 p_tdb_information20 in varchar2,
377 p_organization_id in number,
378 p_sponsor_person_id in number,
379 p_sponsor_assignment_id in number,
380 p_person_address_id in number,
381 p_delegate_assignment_id in number,
382 p_delegate_contact_id in number,
383 p_delegate_contact_email in varchar2,
384 p_third_party_email in varchar2,
385 p_person_address_type in varchar2,
386 p_line_id in number,
387 p_org_id in number,
388 p_daemon_flag in varchar2,
389 p_daemon_type in varchar2,
390 p_old_event_id in number,
391 p_quote_line_id in number,
392 p_interface_source in varchar2,
393 p_total_training_time in varchar2 ,
394 p_content_player_status in varchar2 ,
395 p_score in number ,
396 p_completed_content in number ,
397 p_total_content in number,
398 p_booking_justification_id in number
399 ,p_is_history_flag in varchar2
400 ,p_sign_eval_status in varchar2 default null
401 ,p_is_mandatory_enrollment in varchar2 default 'N')
402 Return g_rec_type;
403 --
404 end ota_tdb_shd;