1 Package ota_tpc_shd as
2 /* $Header: ottpcrhi.pkh 120.0 2005/05/29 07:47:09 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (training_plan_cost_id number(9)
10 ,tp_measurement_type_id number(9)
11 ,training_plan_id number(9)
12 ,booking_id number(9)
13 ,event_id number(9)
14 ,amount number(15,5)
15 ,currency_code varchar2(15)
16 ,business_group_id number(15)
17 ,object_version_number number(9)
18 ,attribute_category varchar2(30)
19 ,attribute1 varchar2(150)
20 ,attribute2 varchar2(150)
21 ,attribute3 varchar2(150)
22 ,attribute4 varchar2(150)
23 ,attribute5 varchar2(150)
24 ,attribute6 varchar2(150)
25 ,attribute7 varchar2(150)
26 ,attribute8 varchar2(150)
27 ,attribute9 varchar2(150)
28 ,attribute10 varchar2(150)
29 ,attribute11 varchar2(150)
30 ,attribute12 varchar2(150)
31 ,attribute13 varchar2(150)
32 ,attribute14 varchar2(150)
33 ,attribute15 varchar2(150)
34 ,attribute16 varchar2(150)
35 ,attribute17 varchar2(150)
36 ,attribute18 varchar2(150)
37 ,attribute19 varchar2(150)
38 ,attribute20 varchar2(150)
39 ,attribute21 varchar2(150)
40 ,attribute22 varchar2(150)
41 ,attribute23 varchar2(150)
42 ,attribute24 varchar2(150)
43 ,attribute25 varchar2(150)
44 ,attribute26 varchar2(150)
45 ,attribute27 varchar2(150)
46 ,attribute28 varchar2(150)
47 ,attribute29 varchar2(150)
48 ,attribute30 varchar2(150)
49 ,information_category varchar2(30)
50 ,tp_cost_information1 varchar2(150)
51 ,tp_cost_information2 varchar2(150)
52 ,tp_cost_information3 varchar2(150)
53 ,tp_cost_information4 varchar2(150)
54 ,tp_cost_information5 varchar2(150)
55 ,tp_cost_information6 varchar2(150)
56 ,tp_cost_information7 varchar2(150)
57 ,tp_cost_information8 varchar2(150)
58 ,tp_cost_information9 varchar2(150)
59 ,tp_cost_information10 varchar2(150)
60 ,tp_cost_information11 varchar2(150)
61 ,tp_cost_information12 varchar2(150)
62 ,tp_cost_information13 varchar2(150)
63 ,tp_cost_information14 varchar2(150)
64 ,tp_cost_information15 varchar2(150)
65 ,tp_cost_information16 varchar2(150)
66 ,tp_cost_information17 varchar2(150)
67 ,tp_cost_information18 varchar2(150)
68 ,tp_cost_information19 varchar2(150)
69 ,tp_cost_information20 varchar2(150)
70 ,tp_cost_information21 varchar2(150)
71 ,tp_cost_information22 varchar2(150)
72 ,tp_cost_information23 varchar2(150)
73 ,tp_cost_information24 varchar2(150)
74 ,tp_cost_information25 varchar2(150)
75 ,tp_cost_information26 varchar2(150)
76 ,tp_cost_information27 varchar2(150)
77 ,tp_cost_information28 varchar2(150)
78 ,tp_cost_information29 varchar2(150)
79 ,tp_cost_information30 varchar2(150)
80 );
81 --
82 -- ----------------------------------------------------------------------------
83 -- | Global Definitions - Internal Development Use Only |
84 -- ----------------------------------------------------------------------------
85 --
86 g_old_rec g_rec_type; -- Global record definition
87 --
88 -- ----------------------------------------------------------------------------
89 -- |---------------------------< constraint_error >---------------------------|
90 -- ----------------------------------------------------------------------------
91 -- {Start Of Comments}
92 --
93 -- Description:
94 -- This procedure is called when a constraint has been violated (i.e.
95 -- The exception hr_api.check_integrity_violated,
96 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
97 -- hr_api.unique_integrity_violated has been raised).
98 -- The exceptions can only be raised as follows:
99 -- 1) A check constraint can only be violated during an INSERT or UPDATE
100 -- dml operation.
101 -- 2) A parent integrity constraint can only be violated during an
102 -- INSERT or UPDATE dml operation.
103 -- 3) A child integrity constraint can only be violated during an
104 -- DELETE dml operation.
105 -- 4) A unique integrity constraint can only be violated during INSERT or
106 -- UPDATE dml operation.
107 --
108 -- Prerequisites:
109 -- 1) Either hr_api.check_integrity_violated,
110 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
111 -- hr_api.unique_integrity_violated has been raised with the subsequent
112 -- stripping of the constraint name from the generated error message
113 -- text.
114 -- 2) Standalone validation test which corresponds with a constraint error.
115 --
116 -- In Parameter:
117 -- p_constraint_name is in upper format and is just the constraint name
118 -- (e.g. not prefixed by brackets, schema owner etc).
119 --
120 -- Post Success:
121 -- Development dependant.
122 --
123 -- Post Failure:
124 -- Developement dependant.
125 --
126 -- Developer Implementation Notes:
127 -- For each constraint being checked the hr system package failure message
128 -- has been generated as a template only. These system error messages should
129 -- be modified as required (i.e. change the system failure message to a user
130 -- friendly defined error message).
131 --
132 -- Access Status:
133 -- Internal Development Use Only.
134 --
135 -- {End Of Comments}
136 -- ----------------------------------------------------------------------------
137 Procedure constraint_error
138 (p_constraint_name in all_constraints.constraint_name%TYPE);
139 --
140 -- ----------------------------------------------------------------------------
141 -- |-----------------------------< api_updating >-----------------------------|
142 -- ----------------------------------------------------------------------------
143 -- {Start Of Comments}
144 --
145 -- Description:
146 -- This function is used to populate the g_old_rec record with the
147 -- current row from the database for the specified primary key
148 -- provided that the primary key exists and is valid and does not
149 -- already match the current g_old_rec. The function will always return
150 -- a TRUE value if the g_old_rec is populated with the current row.
151 -- A FALSE value will be returned if all of the primary key arguments
152 -- are null.
153 --
154 -- Prerequisites:
155 -- None.
156 --
157 -- In Parameters:
158 --
159 -- Post Success:
160 -- A value of TRUE will be returned indiciating that the g_old_rec
161 -- is current.
162 -- A value of FALSE will be returned if all of the primary key arguments
163 -- have a null value (this indicates that the row has not be inserted into
164 -- the Schema), and therefore could never have a corresponding row.
165 --
166 -- Post Failure:
167 -- A failure can only occur under two circumstances:
168 -- 1) The primary key is invalid (i.e. a row does not exist for the
169 -- specified primary key values).
170 -- 2) If an object_version_number exists but is NOT the same as the current
171 -- g_old_rec value.
172 --
173 -- Developer Implementation Notes:
174 -- None.
175 --
176 -- Access Status:
177 -- Internal Development Use Only.
178 --
179 -- {End Of Comments}
180 -- ----------------------------------------------------------------------------
181 Function api_updating
182 (p_training_plan_cost_id in number
183 ,p_object_version_number in number
184 ) Return Boolean;
185 --
186 -- ----------------------------------------------------------------------------
187 -- |---------------------------------< lck >----------------------------------|
188 -- ----------------------------------------------------------------------------
189 -- {Start of comments}
190 --
191 -- Description:
192 -- The Lck process has two main functions to perform. Firstly, the row to be
193 -- updated or deleted must be locked. The locking of the row will only be
194 -- successful if the row is not currently locked by another user.
195 -- Secondly, during the locking of the row, the row is selected into
196 -- the g_old_rec data structure which enables the current row values from the
197 -- server to be available to the api.
198 --
199 -- Prerequisites:
200 -- When attempting to call the lock the object version number (if defined)
201 -- is mandatory.
202 --
203 -- In Parameters:
204 -- The arguments to the Lck process are the primary key(s) which uniquely
205 -- identify the row and the object version number of row.
206 --
207 -- Post Success:
208 -- On successful completion of the Lck process the row to be updated or
209 -- deleted will be locked and selected into the global data structure
210 -- g_old_rec.
211 --
212 -- Post Failure:
213 -- The Lck process can fail for three reasons:
214 -- 1) When attempting to lock the row the row could already be locked by
215 -- another user. This will raise the HR_Api.Object_Locked exception.
216 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
217 -- This error is trapped and reported using the message name
218 -- 'HR_7220_INVALID_PRIMARY_KEY'.
219 -- 3) The row although existing in the HR Schema has a different object
220 -- version number than the object version number specified.
221 -- This error is trapped and reported using the message name
222 -- 'HR_7155_OBJECT_INVALID'.
223 --
224 -- Developer Implementation Notes:
225 -- For each primary key and the object version number arguments add a
226 -- call to hr_api.mandatory_arg_error procedure to ensure that these
227 -- argument values are not null.
228 --
229 -- Access Status:
230 -- Internal Development Use Only.
231 --
232 -- {End of comments}
233 -- ----------------------------------------------------------------------------
234 Procedure lck
235 (p_training_plan_cost_id in number
236 ,p_object_version_number in number
237 );
238 --
239 -- ----------------------------------------------------------------------------
240 -- |-----------------------------< convert_args >-----------------------------|
241 -- ----------------------------------------------------------------------------
242 -- {Start Of Comments}
243 --
244 -- Description:
245 -- This function is used to turn attribute parameters into the record
246 -- structure parameter g_rec_type.
247 --
248 -- Prerequisites:
249 -- This is a private function and can only be called from the ins or upd
250 -- attribute processes.
251 --
252 -- In Parameters:
253 --
254 -- Post Success:
255 -- A returning record structure will be returned.
256 --
257 -- Post Failure:
258 -- No direct error handling is required within this function. Any possible
259 -- errors within this function will be a PL/SQL value error due to conversion
260 -- of datatypes or data lengths.
261 --
262 -- Developer Implementation Notes:
263 -- None.
264 --
265 -- Access Status:
266 -- Internal Row Handler Use Only.
267 --
268 -- {End Of Comments}
269 -- ----------------------------------------------------------------------------
270 Function convert_args
271 (p_training_plan_cost_id in number
272 ,p_tp_measurement_type_id in number
273 ,p_training_plan_id in number
274 ,p_booking_id in number
275 ,p_event_id in number
276 ,p_amount in number
277 ,p_currency_code in varchar2
278 ,p_business_group_id in number
279 ,p_object_version_number in number
280 ,p_attribute_category in varchar2
281 ,p_attribute1 in varchar2
282 ,p_attribute2 in varchar2
283 ,p_attribute3 in varchar2
284 ,p_attribute4 in varchar2
285 ,p_attribute5 in varchar2
286 ,p_attribute6 in varchar2
287 ,p_attribute7 in varchar2
288 ,p_attribute8 in varchar2
289 ,p_attribute9 in varchar2
290 ,p_attribute10 in varchar2
291 ,p_attribute11 in varchar2
292 ,p_attribute12 in varchar2
293 ,p_attribute13 in varchar2
294 ,p_attribute14 in varchar2
295 ,p_attribute15 in varchar2
296 ,p_attribute16 in varchar2
297 ,p_attribute17 in varchar2
298 ,p_attribute18 in varchar2
299 ,p_attribute19 in varchar2
300 ,p_attribute20 in varchar2
301 ,p_attribute21 in varchar2
302 ,p_attribute22 in varchar2
303 ,p_attribute23 in varchar2
304 ,p_attribute24 in varchar2
305 ,p_attribute25 in varchar2
306 ,p_attribute26 in varchar2
307 ,p_attribute27 in varchar2
308 ,p_attribute28 in varchar2
309 ,p_attribute29 in varchar2
310 ,p_attribute30 in varchar2
311 ,p_information_category in varchar2
312 ,p_tp_cost_information1 in varchar2
313 ,p_tp_cost_information2 in varchar2
314 ,p_tp_cost_information3 in varchar2
315 ,p_tp_cost_information4 in varchar2
316 ,p_tp_cost_information5 in varchar2
317 ,p_tp_cost_information6 in varchar2
318 ,p_tp_cost_information7 in varchar2
319 ,p_tp_cost_information8 in varchar2
320 ,p_tp_cost_information9 in varchar2
321 ,p_tp_cost_information10 in varchar2
322 ,p_tp_cost_information11 in varchar2
323 ,p_tp_cost_information12 in varchar2
324 ,p_tp_cost_information13 in varchar2
325 ,p_tp_cost_information14 in varchar2
326 ,p_tp_cost_information15 in varchar2
327 ,p_tp_cost_information16 in varchar2
328 ,p_tp_cost_information17 in varchar2
329 ,p_tp_cost_information18 in varchar2
330 ,p_tp_cost_information19 in varchar2
331 ,p_tp_cost_information20 in varchar2
332 ,p_tp_cost_information21 in varchar2
333 ,p_tp_cost_information22 in varchar2
334 ,p_tp_cost_information23 in varchar2
335 ,p_tp_cost_information24 in varchar2
336 ,p_tp_cost_information25 in varchar2
337 ,p_tp_cost_information26 in varchar2
338 ,p_tp_cost_information27 in varchar2
339 ,p_tp_cost_information28 in varchar2
340 ,p_tp_cost_information29 in varchar2
341 ,p_tp_cost_information30 in varchar2
342 )
343 Return g_rec_type;
344 --
345 end ota_tpc_shd;