1 PACKAGE ota_tav_shd as
2 /* $Header: ottav01t.pkh 120.1.12010000.2 2008/12/19 09:21:42 shwnayak ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (
10 activity_version_id number(9),
11 activity_id number(9),
12 superseded_by_act_version_id number(9),
13 developer_organization_id number(9),
14 controlling_person_id ota_activity_versions.controlling_person_id%TYPE,
15 object_version_number number(9), -- Increased length
16 version_name varchar2(80),
17 comments varchar2(2000),
18 description varchar2(4000), -- Increased length
19 duration number(17,2), -- Increased length
20 duration_units varchar2(30),
21 end_date date,
22 intended_audience varchar2(4000), -- Increased length
23 language_id number(9),
24 maximum_attendees number(9),
25 minimum_attendees number(9),
26 objectives varchar2(4000), -- Increased length
27 start_date date,
28 success_criteria varchar2(30),
29 user_status varchar2(30),
30 vendor_id number(15),
31 actual_cost number,
32 budget_cost number,
33 budget_currency_code varchar2(30),
34 expenses_allowed varchar2(30),
35 professional_credit_type varchar2(30),
36 professional_credits number(11,2),
37 maximum_internal_attendees number(9),
38 tav_information_category varchar2(30),
39 tav_information1 varchar2(150),
40 tav_information2 varchar2(150),
41 tav_information3 varchar2(150),
42 tav_information4 varchar2(150),
43 tav_information5 varchar2(150),
44 tav_information6 varchar2(150),
45 tav_information7 varchar2(150),
46 tav_information8 varchar2(150),
47 tav_information9 varchar2(150),
48 tav_information10 varchar2(150),
49 tav_information11 varchar2(150),
50 tav_information12 varchar2(150),
51 tav_information13 varchar2(150),
52 tav_information14 varchar2(150),
53 tav_information15 varchar2(150),
54 tav_information16 varchar2(150),
55 tav_information17 varchar2(150),
56 tav_information18 varchar2(150),
57 tav_information19 varchar2(150),
58 tav_information20 varchar2(150),
59 inventory_item_id number,
60 organization_id number,
61 rco_id number,
62 version_code varchar2(30),
63 business_group_id number(9),
64 data_source varchar2(30)
65 ,competency_update_level varchar2(30)
66
67 );
68 --
69 -- ----------------------------------------------------------------------------
70 -- | Global Definitions - Internal Development Use Only |
71 -- ----------------------------------------------------------------------------
72 --
73 g_old_rec g_rec_type; -- Global record definition
74 g_tab_nam constant varchar2(30) := 'OTA_ACTIVITY_VERSIONS';
75 g_api_dml boolean; -- Global api dml status
76 --
77 -- ----------------------------------------------------------------------------
78 -- |------------------------< return_api_dml_status >-------------------------|
79 -- ----------------------------------------------------------------------------
80 -- {Start Of Comments}
81 --
82 -- Description:
83 -- This function will return the current g_api_dml private global
84 -- boolean status.
85 -- The g_api_dml status determines if at the time of the function
86 -- being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
87 -- is being issued from within an api.
88 -- If the status is TRUE then a dml statement is being issued from
89 -- within this entity api.
90 -- This function is primarily to support database triggers which
91 -- need to maintain the object_version_number for non-supported
92 -- dml statements (i.e. dml statement issued outside of the api layer).
93 --
94 -- Pre Conditions:
95 -- None.
96 --
97 -- In Arguments:
98 -- None.
99 --
100 -- Post Success:
101 -- Processing continues.
102 -- If the function returns a TRUE value then, dml is being executed from
103 -- within this api.
104 --
105 -- Post Failure:
106 -- None.
107 --
108 -- Access Status:
109 -- Public.
110 --
111 -- {End Of Comments}
112 -- ----------------------------------------------------------------------------
113 Function return_api_dml_status Return Boolean;
114 --
115 -- ----------------------------------------------------------------------------
116 -- |---------------------------< constraint_error >---------------------------|
117 -- ----------------------------------------------------------------------------
118 -- {Start Of Comments}
119 --
120 -- Description:
121 -- This procedure is called when a constraint has been violated (i.e.
122 -- The exception hr_api.check_integrity_violated,
123 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
124 -- hr_api.unique_integrity_violated has been raised).
125 -- The exceptions can only be raised as follows:
126 -- 1) A check constraint can only be violated during an INSERT or UPDATE
127 -- dml operation.
128 -- 2) A parent integrity constraint can only be violated during an
129 -- INSERT or UPDATE dml operation.
130 -- 3) A child integrity constraint can only be violated during an
131 -- DELETE dml operation.
132 -- 4) A unique integrity constraint can only be violated during INSERT or
133 -- UPDATE dml operation.
134 --
135 -- Pre Conditions:
136 -- 1) Either hr_api.check_integrity_violated,
137 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
138 -- hr_api.unique_integrity_violated has been raised with the subsequent
139 -- stripping of the constraint name from the generated error message
140 -- text.
141 -- 2) Standalone validation test which correspond with a constraint error.
142 --
143 -- In Arguments:
144 -- p_constraint_name is in upper format and is just the constraint name
145 -- (e.g. not prefixed by brackets, schema owner etc).
146 --
147 -- Post Success:
148 -- Development dependant.
149 --
150 -- Post Failure:
151 -- Developement dependant.
152 --
153 -- Developer Implementation Notes:
154 -- For each constraint being checked the hr system package failure message
155 -- has been generated as a template only. These system error messages should
156 -- be modified as required (i.e. change the system failure message to a user
157 -- friendly defined error message).
158 --
159 -- Access Status:
160 -- Public.
161 --
162 -- {End Of Comments}
163 -- ----------------------------------------------------------------------------
164 Procedure constraint_error
165 (p_constraint_name in varchar2);
166 --
167 -- ----------------------------------------------------------------------------
168 -- |-----------------------------< api_updating >-----------------------------|
169 -- ----------------------------------------------------------------------------
170 -- {Start Of Comments}
171 --
172 -- Description:
173 -- This function is used to populate the g_old_rec record with the
174 -- current row from the database for the specified primary key
175 -- provided that the primary key exists and is valid and does not
176 -- already match the current g_old_rec. The function will always return
177 -- a TRUE value if the g_old_rec is populated with the current row.
178 -- A FALSE value will be returned if all of the primary key arguments
179 -- are null.
180 --
181 -- Pre Conditions:
182 -- None.
183 --
184 -- In Arguments:
185 --
186 -- Post Success:
187 -- A value of TRUE will be returned indiciating that the g_old_rec
188 -- is current.
189 -- A value of FALSE will be returned if all of the primary key arguments
190 -- have a null value (this indicates that the row has not be inserted into
191 -- the Schema), and therefore could never have a corresponding row.
192 --
193 -- Post Failure:
194 -- A failure can only occur under two circumstances:
195 -- 1) The primary key is invalid (i.e. a row does not exist for the
196 -- specified primary key values).
197 -- 2) If an object_version_number exists but is NOT the same as the current
198 -- g_old_rec value.
199 --
200 -- Developer Implementation Notes:
201 -- None.
202 --
203 -- Access Status:
204 -- Internal Development Use Only.
205 --
206 -- {End Of Comments}
207 -- ----------------------------------------------------------------------------
208 Function api_updating
209 (
210 p_activity_version_id in number,
211 p_object_version_number in number
212 ) Return Boolean;
213 --
214 -- ----------------------------------------------------------------------------
215 -- |---------------------------------< lck >----------------------------------|
216 -- ----------------------------------------------------------------------------
217 -- {Start Of Comments}
218 --
219 -- Description:
220 -- The Lck process has two main functions to perform. Firstly, the row to be
221 -- updated or deleted must be locked. The locking of the row will only be
222 -- successful if the row is not currently locked by another user.
223 -- Secondly, during the locking of the row, the row is selected into
224 -- the g_old_rec data structure which enables the current row values from the
225 -- server to be available to the api.
226 --
227 -- Pre Conditions:
228 -- When attempting to call the lock the object version number (if defined)
229 -- is mandatory.
230 --
231 -- In Arguments:
232 -- The arguments to the Lck process are the primary key(s) which uniquely
233 -- identify the row and the object version number of row.
234 --
235 -- Post Success:
236 -- On successful completion of the Lck process the row to be updated or
237 -- deleted will be locked and selected into the global data structure
238 -- g_old_rec.
239 --
240 -- Post Failure:
241 -- The Lck process can fail for three reasons:
242 -- 1) When attempting to lock the row the row could already be locked by
243 -- another user. This will raise the HR_Api.Object_Locked exception.
244 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
245 -- This error is trapped and reported using the message name
246 -- 'HR_7220_INVALID_PRIMARY_KEY'.
247 -- 3) The row although existing in the HR Schema has a different object
248 -- version number than the object version number specified.
249 -- This error is trapped and reported using the message name
250 -- 'HR_7155_OBJECT_INVALID'.
251 --
252 -- Developer Implementation Notes:
253 -- For each primary key and the object version number arguments add a
254 -- call to hr_api.mandatory_arg_error procedure to ensure that these
255 -- argument values are not null.
256 --
257 -- Access Status:
258 -- Public.
259 --
260 -- {End Of Comments}
261 -- ----------------------------------------------------------------------------
262 Procedure lck
263 (
264 p_activity_version_id in number,
265 p_object_version_number in number
266 );
267 --
268 -- ----------------------------------------------------------------------------
269 -- |-----------------------------< convert_args >-----------------------------|
270 -- ----------------------------------------------------------------------------
271 -- {Start Of Comments}
272 --
273 -- Description:
274 -- This function is used to turn attribute arguments into the record
275 -- structure g_rec_type.
276 --
277 -- Pre Conditions:
278 -- This is a private function and can only be called from the ins or upd
279 -- attribute processes.
280 --
281 -- In Arguments:
282 --
283 -- Post Success:
284 -- A returning record structure will be returned.
285 --
286 -- Post Failure:
287 -- No direct error handling is required within this function. Any possible
288 -- errors within this function will be a PL/SQL value error due to conversion
289 -- of datatypes or data lengths.
290 --
291 -- Developer Implementation Notes:
292 -- None.
293 --
294 -- Access Status:
295 -- Internal Development Use Only.
296 --
297 -- {End Of Comments}
298 -- ----------------------------------------------------------------------------
299 Function convert_args
300 (
301 p_activity_version_id in number,
302 p_activity_id in number,
303 p_superseded_by_act_version_id in number,
304 p_developer_organization_id in number,
305 p_controlling_person_id in number,
306 p_object_version_number in number,
307 p_version_name in varchar2,
308 p_comments in varchar2,
309 p_description in varchar2,
310 p_duration in number,
311 p_duration_units in varchar2,
312 p_end_date in date,
313 p_intended_audience in varchar2,
314 p_language_id in number,
315 p_maximum_attendees in number,
316 p_minimum_attendees in number,
317 p_objectives in varchar2,
318 p_start_date in date,
319 p_success_criteria in varchar2,
320 p_user_status in varchar2,
321 p_vendor_id in number,
322 p_actual_cost in number,
323 p_budget_cost in number,
324 p_budget_currency_code in varchar2,
325 p_expenses_allowed in varchar2,
326 p_professional_credit_type in varchar2,
327 p_professional_credits in number,
328 p_maximum_internal_attendees in number,
329 p_tav_information_category in varchar2,
330 p_tav_information1 in varchar2,
331 p_tav_information2 in varchar2,
332 p_tav_information3 in varchar2,
333 p_tav_information4 in varchar2,
334 p_tav_information5 in varchar2,
335 p_tav_information6 in varchar2,
336 p_tav_information7 in varchar2,
337 p_tav_information8 in varchar2,
338 p_tav_information9 in varchar2,
339 p_tav_information10 in varchar2,
340 p_tav_information11 in varchar2,
341 p_tav_information12 in varchar2,
342 p_tav_information13 in varchar2,
343 p_tav_information14 in varchar2,
344 p_tav_information15 in varchar2,
345 p_tav_information16 in varchar2,
346 p_tav_information17 in varchar2,
347 p_tav_information18 in varchar2,
348 p_tav_information19 in varchar2,
349 p_tav_information20 in varchar2,
350 p_inventory_item_id in number,
351 p_organization_id in number,
352 p_rco_id in number,
353 p_version_code in varchar2,
354 p_business_group_id in number,
355 p_data_source in varchar2
356 ,p_competency_update_level in varchar2
357
358 )
359 Return g_rec_type;
360 --
361 end ota_tav_shd;
362