1 Package per_cel_shd as
2 /* $Header: pecelrhi.pkh 120.1.12010000.2 2008/08/06 09:06:10 ubhat ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (
10 competence_element_id number,
11 object_version_number number(9),
12 type varchar2(30),
13 business_group_id number(15),
14 enterprise_id number(15),
15 competence_id number(15),
16 proficiency_level_id number(15),
17 high_proficiency_level_id number(15),
18 weighting_level_id number(15),
19 rating_level_id number(15),
20 person_id per_competence_elements.person_id%TYPE,
21 job_id number(15),
22 valid_grade_id number(15),
23 position_id number(15),
24 organization_id number(15),
25 parent_competence_element_id number(15),
26 activity_version_id number(15),
27 assessment_id number(15),
28 assessment_type_id number(15),
29 mandatory varchar2(30),
30 effective_date_from date,
31 effective_date_to date,
32 group_competence_type varchar2(30),
33 competence_type varchar2(30),
34 normal_elapse_duration number(9),
35 normal_elapse_duration_unit varchar2(30),
36 sequence_number number(9),
37 source_of_proficiency_level varchar2(80),
38 line_score number(9),
39 certification_date date,
40 certification_method varchar2(30),
41 next_certification_date date,
42 comments varchar2(2000), -- pseudo column
43 attribute_category varchar2(30),
44 attribute1 varchar2(150),
45 attribute2 varchar2(150),
46 attribute3 varchar2(150),
47 attribute4 varchar2(150),
48 attribute5 varchar2(150),
49 attribute6 varchar2(150),
50 attribute7 varchar2(150),
51 attribute8 varchar2(150),
52 attribute9 varchar2(150),
53 attribute10 varchar2(150),
54 attribute11 varchar2(150),
55 attribute12 varchar2(150),
56 attribute13 varchar2(150),
57 attribute14 varchar2(150),
58 attribute15 varchar2(150),
59 attribute16 varchar2(150),
60 attribute17 varchar2(150),
61 attribute18 varchar2(150),
62 attribute19 varchar2(150),
63 attribute20 varchar2(150),
64 object_id number(15),
65 object_name varchar2(30),
66 party_id per_competence_elements.party_id%TYPE,-- HR/TCA merge
67 -- BUG3356369
68 qualification_type_id number(10),
69 unit_standard_type varchar2(60),
70 status varchar2(40),
71 information_category varchar2(30),
72 information1 varchar2(150),
73 information2 varchar2(150),
74 information3 varchar2(150),
75 information4 varchar2(150),
76 information5 varchar2(150),
77 information6 varchar2(150),
78 information7 varchar2(150),
79 information8 varchar2(150),
80 information9 varchar2(150),
81 information10 varchar2(150),
82 information11 varchar2(150),
83 information12 varchar2(150),
84 information13 varchar2(150),
85 information14 varchar2(150),
86 information15 varchar2(150),
87 information16 varchar2(150),
88 information17 varchar2(150),
89 information18 varchar2(150),
90 information19 varchar2(150),
91 information20 varchar2(150),
92 achieved_date date,
93 appr_line_score number
94 );
95 --
96 -- ----------------------------------------------------------------------------
97 -- | Global Definitions - Internal Development Use Only |
98 -- ----------------------------------------------------------------------------
99 --
100 g_old_rec g_rec_type; -- Global record definition
101 g_api_dml boolean; -- Global api dml status
102 g_bus_grp boolean; -- business group id status
103 g_tab_nam constant varchar2(30) := 'PER_COMPETENCE_ELEMENTS';
104 --
105 -- ----------------------------------------------------------------------------
106 -- |------------------------< return_api_dml_status >-------------------------|
107 -- ----------------------------------------------------------------------------
108 -- {Start Of Comments}
109 --
110 -- Description:
111 -- This function will return the current g_api_dml private global
112 -- boolean status.
113 -- The g_api_dml status determines if at the time of the function
114 -- being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
115 -- is being issued from within an api.
116 -- If the status is TRUE then a dml statement is being issued from
117 -- within this entity api.
118 -- This function is primarily to support database triggers which
119 -- need to maintain the object_version_number for non-supported
120 -- dml statements (i.e. dml statement issued outside of the api layer).
121 --
122 -- Pre Conditions:
123 -- None.
124 --
125 -- In Parameters:
126 -- None.
127 --
128 -- Post Success:
129 -- Processing continues.
130 -- If the function returns a TRUE value then, dml is being executed from
131 -- within this api.
132 --
133 -- Post Failure:
134 -- None.
135 --
136 -- Access Status:
137 -- Internal Table Handler Use Only.
138 --
139 -- {End Of Comments}
140 -- ----------------------------------------------------------------------------
141 Function return_api_dml_status Return Boolean;
142 --
143 -- ----------------------------------------------------------------------------
144 -- |---------------------------< constraint_error >---------------------------|
145 -- ----------------------------------------------------------------------------
146 -- {Start Of Comments}
147 --
148 -- Description:
149 -- This procedure is called when a constraint has been violated (i.e.
150 -- The exception hr_api.check_integrity_violated,
151 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
152 -- hr_api.unique_integrity_violated has been raised).
153 -- The exceptions can only be raised as follows:
154 -- 1) A check constraint can only be violated during an INSERT or UPDATE
155 -- dml operation.
156 -- 2) A parent integrity constraint can only be violated during an
157 -- INSERT or UPDATE dml operation.
158 -- 3) A child integrity constraint can only be violated during an
159 -- DELETE dml operation.
160 -- 4) A unique integrity constraint can only be violated during INSERT or
161 -- UPDATE dml operation.
162 --
163 -- Pre Conditions:
164 -- 1) Either hr_api.check_integrity_violated,
165 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
166 -- hr_api.unique_integrity_violated has been raised with the subsequent
167 -- stripping of the constraint name from the generated error message
168 -- text.
169 -- 2) Standalone validation test which corresponds with a constraint error.
170 --
171 -- In Parameter:
172 -- p_constraint_name is in upper format and is just the constraint name
173 -- (e.g. not prefixed by brackets, schema owner etc).
174 --
175 -- Post Success:
176 -- Development dependant.
177 --
178 -- Post Failure:
179 -- Developement dependant.
180 --
181 -- Developer Implementation Notes:
182 -- For each constraint being checked the hr system package failure message
183 -- has been generated as a template only. These system error messages should
184 -- be modified as required (i.e. change the system failure message to a user
185 -- friendly defined error message).
186 --
187 -- Access Status:
188 -- Internal Development Use Only.
189 --
190 -- {End Of Comments}
191 -- ----------------------------------------------------------------------------
192 Procedure constraint_error
193 (p_constraint_name in all_constraints.constraint_name%TYPE);
194 --
195 -- ----------------------------------------------------------------------------
196 -- |-----------------------------< api_updating >-----------------------------|
197 -- ----------------------------------------------------------------------------
198 -- {Start Of Comments}
199 --
200 -- Description:
201 -- This function is used to populate the g_old_rec record with the
202 -- current row from the database for the specified primary key
203 -- provided that the primary key exists and is valid and does not
204 -- already match the current g_old_rec. The function will always return
205 -- a TRUE value if the g_old_rec is populated with the current row.
206 -- A FALSE value will be returned if all of the primary key arguments
207 -- are null.
208 --
209 -- Pre Conditions:
210 -- None.
211 --
212 -- In Parameters:
213 --
214 -- Post Success:
215 -- A value of TRUE will be returned indiciating that the g_old_rec
216 -- is current.
217 -- A value of FALSE will be returned if all of the primary key arguments
218 -- have a null value (this indicates that the row has not be inserted into
219 -- the Schema), and therefore could never have a corresponding row.
220 --
221 -- Post Failure:
222 -- A failure can only occur under two circumstances:
223 -- 1) The primary key is invalid (i.e. a row does not exist for the
224 -- specified primary key values).
225 -- 2) If an object_version_number exists but is NOT the same as the current
226 -- g_old_rec value.
227 --
228 -- Developer Implementation Notes:
229 -- None.
230 --
231 -- Access Status:
232 -- Internal Development Use Only.
233 --
234 -- {End Of Comments}
235 -- ----------------------------------------------------------------------------
236 Function api_updating
237 (
238 p_competence_element_id in number,
239 p_object_version_number in number
240 ) Return Boolean;
241 --
242 -- ----------------------------------------------------------------------------
243 -- |---------------------------------< lck >----------------------------------|
244 -- ----------------------------------------------------------------------------
245 -- {Start Of Comments}
246 --
247 -- Description:
248 -- The Lck process has two main functions to perform. Firstly, the row to be
249 -- updated or deleted must be locked. The locking of the row will only be
250 -- successful if the row is not currently locked by another user.
251 -- Secondly, during the locking of the row, the row is selected into
252 -- the g_old_rec data structure which enables the current row values from the
253 -- server to be available to the api.
254 --
255 -- Pre Conditions:
256 -- When attempting to call the lock the object version number (if defined)
257 -- is mandatory.
258 --
259 -- In Parameters:
260 -- The arguments to the Lck process are the primary key(s) which uniquely
261 -- identify the row and the object version number of row.
262 --
263 -- Post Success:
264 -- On successful completion of the Lck process the row to be updated or
265 -- deleted will be locked and selected into the global data structure
266 -- g_old_rec.
267 --
268 -- Post Failure:
269 -- The Lck process can fail for three reasons:
270 -- 1) When attempting to lock the row the row could already be locked by
271 -- another user. This will raise the HR_Api.Object_Locked exception.
272 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
273 -- This error is trapped and reported using the message name
274 -- 'HR_7220_INVALID_PRIMARY_KEY'.
275 -- 3) The row although existing in the HR Schema has a different object
276 -- version number than the object version number specified.
277 -- This error is trapped and reported using the message name
278 -- 'HR_7155_OBJECT_INVALID'.
279 --
280 -- Developer Implementation Notes:
281 -- For each primary key and the object version number arguments add a
282 -- call to hr_api.mandatory_arg_error procedure to ensure that these
283 -- argument values are not null.
284 --
285 -- Access Status:
286 -- Internal Development Use Only.
287 --
288 -- {End Of Comments}
289 -- ----------------------------------------------------------------------------
290 Procedure lck
291 (
292 p_competence_element_id in number,
293 p_object_version_number in number
294 );
295 --
296 -- ----------------------------------------------------------------------------
297 -- |-----------------------------< convert_args >-----------------------------|
298 -- ----------------------------------------------------------------------------
299 -- {Start Of Comments}
300 --
301 -- Description:
302 -- This function is used to turn attribute parameters into the record
303 -- structure parameter g_rec_type.
304 --
305 -- Pre Conditions:
306 -- This is a private function and can only be called from the ins or upd
307 -- attribute processes.
308 --
309 -- In Parameters:
310 --
311 -- Post Success:
312 -- A returning record structure will be returned.
313 --
314 -- Post Failure:
315 -- No direct error handling is required within this function. Any possible
316 -- errors within this function will be a PL/SQL value error due to conversion
317 -- of datatypes or data lengths.
318 --
319 -- Developer Implementation Notes:
320 -- None.
321 --
322 -- Access Status:
323 -- Internal Table Handler Use Only.
327 Function convert_args
324 --
325 -- {End Of Comments}
326 -- ----------------------------------------------------------------------------
328 (
329 p_competence_element_id in number,
330 p_object_version_number in number,
331 p_type in varchar2,
332 p_business_group_id in number,
333 p_enterprise_id in number,
334 p_competence_id in number,
335 p_proficiency_level_id in number,
336 p_high_proficiency_level_id in number,
337 p_weighting_level_id in number,
338 p_rating_level_id in number,
339 p_person_id in number,
340 p_job_id in number,
341 p_valid_grade_id in number,
342 p_position_id in number,
343 p_organization_id in number,
344 p_parent_competence_element_id in number,
345 p_activity_version_id in number,
346 p_assessment_id in number,
347 p_assessment_type_id in number,
348 p_mandatory in varchar2,
349 p_effective_date_from in date,
350 p_effective_date_to in date,
351 p_group_competence_type in varchar2,
352 p_competence_type in varchar2,
353 p_normal_elapse_duration in number,
354 p_normal_elapse_duration_unit in varchar2,
355 p_sequence_number in number,
356 p_source_of_proficiency_level in varchar2,
357 p_line_score in number,
358 p_certification_date in date,
359 p_certification_method in varchar2,
360 p_next_certification_date in date,
361 p_comments in varchar2,
362 p_attribute_category in varchar2,
363 p_attribute1 in varchar2,
364 p_attribute2 in varchar2,
365 p_attribute3 in varchar2,
366 p_attribute4 in varchar2,
367 p_attribute5 in varchar2,
368 p_attribute6 in varchar2,
369 p_attribute7 in varchar2,
370 p_attribute8 in varchar2,
371 p_attribute9 in varchar2,
372 p_attribute10 in varchar2,
373 p_attribute11 in varchar2,
374 p_attribute12 in varchar2,
375 p_attribute13 in varchar2,
376 p_attribute14 in varchar2,
377 p_attribute15 in varchar2,
378 p_attribute16 in varchar2,
379 p_attribute17 in varchar2,
380 p_attribute18 in varchar2,
381 p_attribute19 in varchar2,
382 p_attribute20 in varchar2,
383 p_object_id in number,
384 p_object_name in varchar2,
385 p_party_id in number default null
386 -- BUG3356369
387 ,p_qualification_type_id in number
388 ,p_unit_standard_type in varchar2
389 ,p_status in varchar2
390 ,p_information_category in varchar2
391 ,p_information1 in varchar2
392 ,p_information2 in varchar2
393 ,p_information3 in varchar2
394 ,p_information4 in varchar2
395 ,p_information5 in varchar2
396 ,p_information6 in varchar2
397 ,p_information7 in varchar2
398 ,p_information8 in varchar2
399 ,p_information9 in varchar2
400 ,p_information10 in varchar2
401 ,p_information11 in varchar2
402 ,p_information12 in varchar2
403 ,p_information13 in varchar2
404 ,p_information14 in varchar2
405 ,p_information15 in varchar2
406 ,p_information16 in varchar2
407 ,p_information17 in varchar2
408 ,p_information18 in varchar2
409 ,p_information19 in varchar2
410 ,p_information20 in varchar2
411 ,p_achieved_date in date
412 ,p_appr_line_score in number
413 )
414 Return g_rec_type;
415 --
416 end per_cel_shd;