1 Package per_qua_shd as
2 /* $Header: pequarhi.pkh 120.0.12010000.1 2008/07/28 05:32:25 appldev ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (
10 qualification_id number(9),
11 business_group_id number(15),
12 object_version_number number(9),
13 person_id per_qualifications.person_id%TYPE,
14 title varchar2(120),
15 grade_attained varchar2(100),
16 status varchar2(100),
17 awarded_date date,
18 fee number(15,2),
19 fee_currency varchar2(15),
20 training_completed_amount number(15,2),
21 reimbursement_arrangements varchar2(2000),
22 training_completed_units varchar2(100),
23 total_training_amount number(15,2),
24 start_date date,
25 end_date date,
26 license_number varchar2(60),
27 expiry_date date,
28 license_restrictions varchar2(255),
29 projected_completion_date date,
30 awarding_body varchar2(100),
31 tuition_method varchar2(30),
32 group_ranking varchar2(100),
33 comments varchar2(2000), -- pseudo column
34 qualification_type_id number(9),
35 attendance_id number(9),
36 attribute_category varchar2(30),
37 attribute1 varchar2(150),
38 attribute2 varchar2(150),
39 attribute3 varchar2(150),
40 attribute4 varchar2(150),
41 attribute5 varchar2(150),
42 attribute6 varchar2(150),
43 attribute7 varchar2(150),
44 attribute8 varchar2(150),
45 attribute9 varchar2(150),
46 attribute10 varchar2(150),
47 attribute11 varchar2(150),
48 attribute12 varchar2(150),
49 attribute13 varchar2(150),
50 attribute14 varchar2(150),
51 attribute15 varchar2(150),
52 attribute16 varchar2(150),
53 attribute17 varchar2(150),
54 attribute18 varchar2(150),
55 attribute19 varchar2(150),
56 attribute20 varchar2(150),
57 qua_information_category varchar2(30),
58 qua_information1 varchar2(150),
59 qua_information2 varchar2(150),
60 qua_information3 varchar2(150),
61 qua_information4 varchar2(150),
62 qua_information5 varchar2(150),
63 qua_information6 varchar2(150),
64 qua_information7 varchar2(150),
65 qua_information8 varchar2(150),
66 qua_information9 varchar2(150),
67 qua_information10 varchar2(150),
68 qua_information11 varchar2(150),
69 qua_information12 varchar2(150),
70 qua_information13 varchar2(150),
71 qua_information14 varchar2(150),
72 qua_information15 varchar2(150),
73 qua_information16 varchar2(150),
74 qua_information17 varchar2(150),
75 qua_information18 varchar2(150),
76 qua_information19 varchar2(150),
77 qua_information20 varchar2(150),
78 professional_body_name varchar2(80),
79 membership_number varchar2(80),
80 membership_category varchar2(80),
81 subscription_payment_method varchar2(80),
82 party_id per_qualifications.party_id%TYPE -- HR/TCA merge
83 );
84 --
85 -- ----------------------------------------------------------------------------
86 -- | Global Definitions - Internal Development Use Only |
87 -- ----------------------------------------------------------------------------
88 --
89 g_old_rec g_rec_type; -- Global record definition
90 g_api_dml boolean; -- Global api dml status
91 g_tab_nam constant varchar2(30) := 'PER_QUALIFICATIONS';
92 --
93 -- ----------------------------------------------------------------------------
94 -- |------------------------< return_api_dml_status >-------------------------|
95 -- ----------------------------------------------------------------------------
96 -- {Start Of Comments}
97 --
98 -- Description:
99 -- This function will return the current g_api_dml private global
100 -- boolean status.
101 -- The g_api_dml status determines if at the time of the function
102 -- being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
103 -- is being issued from within an api.
104 -- If the status is TRUE then a dml statement is being issued from
105 -- within this entity api.
106 -- This function is primarily to support database triggers which
107 -- need to maintain the object_version_number for non-supported
108 -- dml statements (i.e. dml statement issued outside of the api layer).
109 --
110 -- Pre Conditions:
111 -- None.
112 --
113 -- In Parameters:
114 -- None.
115 --
116 -- Post Success:
117 -- Processing continues.
118 -- If the function returns a TRUE value then, dml is being executed from
119 -- within this api.
120 --
121 -- Post Failure:
122 -- None.
123 --
124 -- Access Status:
125 -- Internal Table Handler Use Only.
126 --
127 -- {End Of Comments}
128 -- ----------------------------------------------------------------------------
129 Function return_api_dml_status Return Boolean;
130 --
131 -- ----------------------------------------------------------------------------
132 -- |---------------------------< constraint_error >---------------------------|
133 -- ----------------------------------------------------------------------------
134 -- {Start Of Comments}
135 --
136 -- Description:
137 -- This procedure is called when a constraint has been violated (i.e.
138 -- The exception hr_api.check_integrity_violated,
139 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
140 -- hr_api.unique_integrity_violated has been raised).
141 -- The exceptions can only be raised as follows:
142 -- 1) A check constraint can only be violated during an INSERT or UPDATE
143 -- dml operation.
144 -- 2) A parent integrity constraint can only be violated during an
145 -- INSERT or UPDATE dml operation.
146 -- 3) A child integrity constraint can only be violated during an
147 -- DELETE dml operation.
148 -- 4) A unique integrity constraint can only be violated during INSERT or
149 -- UPDATE dml operation.
150 --
151 -- Pre Conditions:
152 -- 1) Either hr_api.check_integrity_violated,
153 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
154 -- hr_api.unique_integrity_violated has been raised with the subsequent
155 -- stripping of the constraint name from the generated error message
156 -- text.
157 -- 2) Standalone validation test which corresponds with a constraint error.
158 --
159 -- In Parameter:
160 -- p_constraint_name is in upper format and is just the constraint name
161 -- (e.g. not prefixed by brackets, schema owner etc).
162 --
163 -- Post Success:
164 -- Development dependant.
165 --
166 -- Post Failure:
167 -- Developement dependant.
168 --
169 -- Developer Implementation Notes:
170 -- For each constraint being checked the hr system package failure message
171 -- has been generated as a template only. These system error messages should
172 -- be modified as required (i.e. change the system failure message to a user
173 -- friendly defined error message).
174 --
175 -- Access Status:
176 -- Internal Development Use Only.
177 --
178 -- {End Of Comments}
179 -- ----------------------------------------------------------------------------
180 Procedure constraint_error
181 (p_constraint_name in all_constraints.constraint_name%TYPE);
182 --
183 -- ----------------------------------------------------------------------------
184 -- |-----------------------------< api_updating >-----------------------------|
185 -- ----------------------------------------------------------------------------
186 -- {Start Of Comments}
187 --
188 -- Description:
189 -- This function is used to populate the g_old_rec record with the
190 -- current row from the database for the specified primary key
191 -- provided that the primary key exists and is valid and does not
192 -- already match the current g_old_rec. The function will always return
193 -- a TRUE value if the g_old_rec is populated with the current row.
194 -- A FALSE value will be returned if all of the primary key arguments
195 -- are null.
196 --
197 -- Pre Conditions:
198 -- None.
199 --
200 -- In Parameters:
201 --
202 -- Post Success:
203 -- A value of TRUE will be returned indiciating that the g_old_rec
204 -- is current.
205 -- A value of FALSE will be returned if all of the primary key arguments
206 -- have a null value (this indicates that the row has not be inserted into
207 -- the Schema), and therefore could never have a corresponding row.
208 --
209 -- Post Failure:
210 -- A failure can only occur under two circumstances:
211 -- 1) The primary key is invalid (i.e. a row does not exist for the
212 -- specified primary key values).
213 -- 2) If an object_version_number exists but is NOT the same as the current
214 -- g_old_rec value.
215 --
216 -- Developer Implementation Notes:
217 -- None.
218 --
219 -- Access Status:
220 -- Internal Development Use Only.
221 --
222 -- {End Of Comments}
223 -- ----------------------------------------------------------------------------
224 Function api_updating
225 (
226 p_qualification_id in number,
227 p_object_version_number in number
228 ) Return Boolean;
229 --
230 -- ----------------------------------------------------------------------------
231 -- |---------------------------------< lck >----------------------------------|
232 -- ----------------------------------------------------------------------------
233 -- {Start Of Comments}
234 --
235 -- Description:
236 -- The Lck process has two main functions to perform. Firstly, the row to be
237 -- updated or deleted must be locked. The locking of the row will only be
238 -- successful if the row is not currently locked by another user.
239 -- Secondly, during the locking of the row, the row is selected into
240 -- the g_old_rec data structure which enables the current row values from the
241 -- server to be available to the api.
242 --
243 -- Pre Conditions:
244 -- When attempting to call the lock the object version number (if defined)
245 -- is mandatory.
246 --
247 -- In Parameters:
248 -- The arguments to the Lck process are the primary key(s) which uniquely
249 -- identify the row and the object version number of row.
250 --
251 -- Post Success:
252 -- On successful completion of the Lck process the row to be updated or
253 -- deleted will be locked and selected into the global data structure
254 -- g_old_rec.
255 --
256 -- Post Failure:
257 -- The Lck process can fail for three reasons:
258 -- 1) When attempting to lock the row the row could already be locked by
259 -- another user. This will raise the HR_Api.Object_Locked exception.
260 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
261 -- This error is trapped and reported using the message name
262 -- 'HR_7220_INVALID_PRIMARY_KEY'.
263 -- 3) The row although existing in the HR Schema has a different object
264 -- version number than the object version number specified.
265 -- This error is trapped and reported using the message name
266 -- 'HR_7155_OBJECT_INVALID'.
267 --
268 -- Developer Implementation Notes:
269 -- For each primary key and the object version number arguments add a
270 -- call to hr_api.mandatory_arg_error procedure to ensure that these
271 -- argument values are not null.
272 --
273 -- Access Status:
274 -- Internal Development Use Only.
275 --
276 -- {End Of Comments}
277 -- ----------------------------------------------------------------------------
278 Procedure lck
279 (
280 p_qualification_id in number,
281 p_object_version_number in number
282 );
283 --
284 -- ----------------------------------------------------------------------------
285 -- |-----------------------------< convert_args >-----------------------------|
286 -- ----------------------------------------------------------------------------
287 -- {Start Of Comments}
288 --
289 -- Description:
290 -- This function is used to turn attribute parameters into the record
291 -- structure parameter g_rec_type.
292 --
293 -- Pre Conditions:
294 -- This is a private function and can only be called from the ins or upd
295 -- attribute processes.
296 --
297 -- In Parameters:
298 --
299 -- Post Success:
300 -- A returning record structure will be returned.
301 --
302 -- Post Failure:
303 -- No direct error handling is required within this function. Any possible
304 -- errors within this function will be a PL/SQL value error due to conversion
305 -- of datatypes or data lengths.
306 --
307 -- Developer Implementation Notes:
308 -- None.
309 --
310 -- Access Status:
311 -- Internal Table Handler Use Only.
312 --
313 -- {End Of Comments}
314 -- ----------------------------------------------------------------------------
315 Function convert_args
316 (
317 p_qualification_id in number,
318 p_business_group_id in number,
319 p_object_version_number in number,
320 p_person_id in number,
321 p_title in varchar2,
322 p_grade_attained in varchar2,
323 p_status in varchar2,
324 p_awarded_date in date,
325 p_fee in number,
326 p_fee_currency in varchar2,
327 p_training_completed_amount in number,
328 p_reimbursement_arrangements in varchar2,
329 p_training_completed_units in varchar2,
330 p_total_training_amount in number,
331 p_start_date in date,
332 p_end_date in date,
333 p_license_number in varchar2,
334 p_expiry_date in date,
335 p_license_restrictions in varchar2,
336 p_projected_completion_date in date,
337 p_awarding_body in varchar2,
338 p_tuition_method in varchar2,
339 p_group_ranking in varchar2,
340 p_comments in varchar2,
341 p_qualification_type_id in number,
342 p_attendance_id in number,
343 p_attribute_category in varchar2,
344 p_attribute1 in varchar2,
345 p_attribute2 in varchar2,
346 p_attribute3 in varchar2,
347 p_attribute4 in varchar2,
348 p_attribute5 in varchar2,
349 p_attribute6 in varchar2,
350 p_attribute7 in varchar2,
351 p_attribute8 in varchar2,
352 p_attribute9 in varchar2,
353 p_attribute10 in varchar2,
354 p_attribute11 in varchar2,
355 p_attribute12 in varchar2,
356 p_attribute13 in varchar2,
357 p_attribute14 in varchar2,
358 p_attribute15 in varchar2,
359 p_attribute16 in varchar2,
360 p_attribute17 in varchar2,
361 p_attribute18 in varchar2,
362 p_attribute19 in varchar2,
363 p_attribute20 in varchar2,
364 p_qua_information_category in varchar2,
365 p_qua_information1 in varchar2,
366 p_qua_information2 in varchar2,
367 p_qua_information3 in varchar2,
368 p_qua_information4 in varchar2,
369 p_qua_information5 in varchar2,
370 p_qua_information6 in varchar2,
371 p_qua_information7 in varchar2,
372 p_qua_information8 in varchar2,
373 p_qua_information9 in varchar2,
374 p_qua_information10 in varchar2,
375 p_qua_information11 in varchar2,
376 p_qua_information12 in varchar2,
377 p_qua_information13 in varchar2,
378 p_qua_information14 in varchar2,
379 p_qua_information15 in varchar2,
380 p_qua_information16 in varchar2,
381 p_qua_information17 in varchar2,
382 p_qua_information18 in varchar2,
383 p_qua_information19 in varchar2,
384 p_qua_information20 in varchar2,
385 p_professional_body_name in varchar2,
386 p_membership_number in varchar2,
387 p_membership_category in varchar2,
388 p_subscription_payment_method in varchar2,
389 p_party_id in number default null
390 )
391 Return g_rec_type;
392 --
393 end per_qua_shd ;