1 Package ben_cty_shd as
2 /* $Header: bectyrhi.pkh 120.0 2005/05/28 01:29:13 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (comptncy_rt_id number(15)
10 ,effective_start_date date
11 ,effective_end_date date
12 ,competence_id number(15)
13 ,rating_level_id number(15)
14 ,excld_flag varchar2(30)
15 ,business_group_id number(15)
16 ,vrbl_rt_prfl_id number(15)
17 ,object_version_number number(9)
18 ,ordr_num number(15)
19 ,cty_attribute_category varchar2(30)
20 ,cty_attribute1 varchar2(150)
21 ,cty_attribute2 varchar2(150)
22 ,cty_attribute3 varchar2(150)
23 ,cty_attribute4 varchar2(150)
24 ,cty_attribute5 varchar2(150)
25 ,cty_attribute6 varchar2(150)
26 ,cty_attribute7 varchar2(150)
27 ,cty_attribute8 varchar2(150)
28 ,cty_attribute9 varchar2(150)
29 ,cty_attribute10 varchar2(150)
30 ,cty_attribute11 varchar2(150)
31 ,cty_attribute12 varchar2(150)
32 ,cty_attribute13 varchar2(150)
33 ,cty_attribute14 varchar2(150)
34 ,cty_attribute15 varchar2(150)
35 ,cty_attribute16 varchar2(150)
36 ,cty_attribute17 varchar2(150)
37 ,cty_attribute18 varchar2(150)
38 ,cty_attribute19 varchar2(150)
39 ,cty_attribute20 varchar2(150)
40 ,cty_attribute21 varchar2(150)
41 ,cty_attribute22 varchar2(150)
42 ,cty_attribute23 varchar2(150)
43 ,cty_attribute24 varchar2(150)
44 ,cty_attribute25 varchar2(150)
45 ,cty_attribute26 varchar2(150)
46 ,cty_attribute27 varchar2(150)
47 ,cty_attribute28 varchar2(150)
48 ,cty_attribute29 varchar2(150)
49 ,cty_attribute30 varchar2(150)
50 );
51 --
52 -- ----------------------------------------------------------------------------
53 -- | Global Definitions - Internal Development Use Only |
54 -- ----------------------------------------------------------------------------
55 --
56 g_old_rec g_rec_type; -- Global record definition
57 -- Global table name
58 g_tab_nam constant varchar2(30) := 'BEN_COMPTNCY_RT_F';
59 --
60 -- ----------------------------------------------------------------------------
61 -- |---------------------------< constraint_error >---------------------------|
62 -- ----------------------------------------------------------------------------
63 -- {Start Of Comments}
64 --
65 -- Description:
66 -- This procedure is called when a constraint has been violated (i.e.
67 -- The exception hr_api.check_integrity_violated,
68 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
69 -- hr_api.unique_integrity_violated has been raised).
70 -- The exceptions can only be raised as follows:
71 -- 1) A check constraint can only be violated during an INSERT or UPDATE
72 -- dml operation.
73 -- 2) A parent integrity constraint can only be violated during an
74 -- INSERT or UPDATE dml operation.
75 -- 3) A child integrity constraint can only be violated during an
76 -- DELETE dml operation.
77 -- 4) A unique integrity constraint can only be violated during INSERT or
78 -- UPDATE dml operation.
79 --
80 -- Prerequisites:
81 -- 1) Either hr_api.check_integrity_violated,
82 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
83 -- hr_api.unique_integrity_violated has been raised with the subsequent
84 -- stripping of the constraint name from the generated error message
85 -- text.
86 -- 2) Standalone validation test which corresponds with a constraint error.
87 --
88 -- In Parameter:
89 -- p_constraint_name is in upper format and is just the constraint name
90 -- (e.g. not prefixed by brackets, schema owner etc).
91 --
92 -- Post Success:
93 -- Development dependant.
94 --
95 -- Post Failure:
96 -- Developement dependant.
97 --
98 -- Developer Implementation Notes:
99 -- For each constraint being checked the hr system package failure message
100 -- has been generated as a template only. These system error messages should
101 -- be modified as required (i.e. change the system failure message to a user
102 -- friendly defined error message).
103 --
104 -- Access Status:
105 -- Internal Development Use Only.
106 --
107 -- {End Of Comments}
108 -- ----------------------------------------------------------------------------
109 Procedure constraint_error
110 (p_constraint_name in all_constraints.constraint_name%TYPE);
111 --
112 -- ----------------------------------------------------------------------------
113 -- |-----------------------------< api_updating >-----------------------------|
114 -- ----------------------------------------------------------------------------
115 -- {Start Of Comments}
116 --
117 -- Description:
118 -- This function is used to populate the g_old_rec record with the
119 -- current row from the database for the specified primary key
120 -- provided that the primary key exists and is valid and does not
121 -- already match the current g_old_rec. The function will always return
122 -- a TRUE value if the g_old_rec is populated with the current row.
123 -- A FALSE value will be returned if all of the primary key arguments
124 -- are null.
125 --
126 -- Prerequisites:
127 -- None.
128 --
129 -- In Parameters:
130 --
131 -- Post Success:
132 -- A value of TRUE will be returned indiciating that the g_old_rec
133 -- is current.
134 -- A value of FALSE will be returned if all of the primary key arguments
135 -- have a null value (this indicates that the row has not be inserted into
136 -- the Schema), and therefore could never have a corresponding row.
137 --
138 -- Post Failure:
139 -- A failure can only occur under two circumstances:
140 -- 1) The primary key is invalid (i.e. a row does not exist for the
141 -- specified primary key values).
142 -- 2) If an object_version_number exists but is NOT the same as the current
143 -- g_old_rec value.
144 --
145 -- Developer Implementation Notes:
146 -- None.
147 --
148 -- Access Status:
149 -- Internal Development Use Only.
150 --
151 -- {End Of Comments}
152 -- ----------------------------------------------------------------------------
153 Function api_updating
154 (p_effective_date in date
155 ,p_comptncy_rt_id in number
156 ,p_object_version_number in number
157 ) Return Boolean;
158 --
159 -- ----------------------------------------------------------------------------
160 -- |---------------------------< find_dt_upd_modes >--------------------------|
161 -- ----------------------------------------------------------------------------
162 -- {Start Of Comments}
163 --
164 -- Description:
165 -- This procedure is used to determine what datetrack update modes are
166 -- allowed as of the effective date for this entity. The procedure will
167 -- return a corresponding Boolean value for each of the update modes
168 -- available where TRUE indicates that the corresponding update mode
169 -- is available.
170 --
171 -- Prerequisites:
172 -- None.
173 --
174 -- In Parameters:
175 -- p_effective_date
176 -- Specifies the date at which the datetrack modes will be operated on.
177 -- p_base_key_value
178 -- Specifies the primary key value for this datetrack entity.
179 -- (E.g. For this entity the assignment of the argument would be:
180 -- p_base_key_value = :comptncy_rt_id).
181 --
182 -- Post Success:
183 -- Processing continues.
184 --
185 -- Post Failure:
186 -- Failure might occur if for the specified effective date and primary key
187 -- value a row doesn't exist.
188 --
189 -- Developer Implementation Notes:
190 -- This procedure could require changes if this entity has any sepcific
191 -- delete restrictions.
192 -- For example, this entity might disallow the datetrack update mode of
193 -- UPDATE. To implement this you would have to set and return a Boolean
194 -- value of FALSE after the call to the dt_api.find_dt_upd_modes procedure.
195 --
196 -- Access Status:
197 -- Internal Development Use Only.
198 --
199 -- {End Of Comments}
200 -- ----------------------------------------------------------------------------
201 Procedure find_dt_upd_modes
202 (p_effective_date in date
203 ,p_base_key_value in number
204 ,p_correction out nocopy boolean
205 ,p_update out nocopy boolean
206 ,p_update_override out nocopy boolean
207 ,p_update_change_insert out nocopy boolean
208 );
209 --
210 -- ----------------------------------------------------------------------------
211 -- |---------------------------< find_dt_del_modes >--------------------------|
212 -- ----------------------------------------------------------------------------
213 -- {Start Of Comments}
214 --
215 -- Description:
216 -- This procedure is used to determine what datetrack delete modes are
217 -- allowed as of the effective date for this entity. The procedure will
218 -- return a corresponding Boolean value for each of the delete modes
219 -- available where TRUE indicates that the corresponding delete mode is
220 -- available.
221 --
222 -- Prerequisites:
223 -- None.
224 --
225 -- In Parameters:
226 -- p_effective_date
227 -- Specifies the date at which the datetrack modes will be operated on.
228 -- p_base_key_value
229 -- Specifies the primary key value for this datetrack entity.
230 -- (E.g. For this entity the assignment of the argument would be:
231 -- p_base_key_value = :comptncy_rt_id).
232 --
233 -- Post Success:
234 -- Processing continues.
235 --
236 -- Post Failure:
237 -- Failure might occur if for the specified effective date and primary key
238 -- value a row doesn't exist.
239 --
240 -- Developer Implementation Notes:
241 -- This procedure could require changes if this entity has any sepcific
242 -- delete restrictions.
243 -- For example, this entity might disallow the datetrack delete mode of
244 -- ZAP. To implement this you would have to set and return a Boolean value
245 -- of FALSE after the call to the dt_api.find_dt_del_modes procedure.
246 --
247 -- Access Status:
248 -- Internal Development Use Only.
249 --
250 -- {End Of Comments}
251 -- ----------------------------------------------------------------------------
252 Procedure find_dt_del_modes
253 (p_effective_date in date
254 ,p_base_key_value in number
255 ,p_zap out nocopy boolean
256 ,p_delete out nocopy boolean
257 ,p_future_change out nocopy boolean
258 ,p_delete_next_change out nocopy boolean
259 );
260 --
261 -- ----------------------------------------------------------------------------
262 -- |-----------------------< upd_effective_end_date >-------------------------|
263 -- ----------------------------------------------------------------------------
264 -- {Start Of Comments}
265 --
266 -- Description:
267 -- This procedure will update the specified datetrack row with the
268 -- specified new effective end date. The object version number is also
269 -- set to the next object version number. DateTrack modes which call
270 -- this procedure are: UPDATE, UPDATE_CHANGE_INSERT,
271 -- UPDATE_OVERRIDE, DELETE, FUTURE_CHANGE and DELETE_NEXT_CHANGE.
272 -- This is an internal datetrack maintenance procedure which should
273 -- not be modified in anyway.
274 --
275 -- Prerequisites:
276 -- None.
277 --
278 -- In Parameters:
279 -- p_new_effective_end_date
280 -- Specifies the new effective end date which will be set for the
281 -- row as of the effective date.
282 -- p_base_key_value
283 -- Specifies the primary key value for this datetrack entity.
284 -- (E.g. For this entity the assignment of the argument would be:
285 -- p_base_key_value = :comptncy_rt_id).
286 --
287 -- Post Success:
288 -- The specified row will be updated with the new effective end date and
289 -- object_version_number.
290 --
291 -- Post Failure:
292 -- Failure might occur if for the specified effective date and primary key
293 -- value a row doesn't exist.
294 --
295 -- Developer Implementation Notes:
296 -- This is an internal datetrack maintenance procedure which should
297 -- not be modified in anyway.
298 --
299 -- Access Status:
300 -- Internal Row Handler Use Only.
301 --
302 -- {End Of Comments}
303 -- ----------------------------------------------------------------------------
304 Procedure upd_effective_end_date
305 (p_effective_date in date
306 ,p_base_key_value in number
307 ,p_new_effective_end_date in date
308 ,p_validation_start_date in date
309 ,p_validation_end_date in date
310 ,p_object_version_number out nocopy number
311 );
312 --
313 -- ----------------------------------------------------------------------------
314 -- |---------------------------------< lck >----------------------------------|
315 -- ----------------------------------------------------------------------------
316 -- {Start Of Comments}
317 --
318 -- Description:
319 -- The Lck process for datetrack is complicated and comprises of the
320 -- following processing
321 -- The processing steps are as follows:
322 -- 1) The row to be updated or deleted must be locked.
323 -- By locking this row, the g_old_rec record data type is populated.
324 -- 2) If a comment exists the text is selected from hr_comments.
325 -- 3) The datetrack mode is then validated to ensure the operation is
326 -- valid. If the mode is valid the validation start and end dates for
327 -- the mode will be derived and returned. Any required locking is
328 -- completed when the datetrack mode is validated.
329 --
330 -- Prerequisites:
331 -- When attempting to call the lck procedure the object version number,
332 -- primary key, effective date and datetrack mode must be specified.
333 --
334 -- In Parameters:
335 -- p_effective_date
336 -- Specifies the date of the datetrack update operation.
337 -- p_datetrack_mode
338 -- Determines the datetrack update or delete mode.
339 --
340 -- Post Success:
341 -- On successful completion of the Lck process the row to be updated or
342 -- deleted will be locked and selected into the global data structure
343 -- g_old_rec.
344 --
345 -- Post Failure:
346 -- The Lck process can fail for three reasons:
347 -- 1) When attempting to lock the row the row could already be locked by
348 -- another user. This will raise the HR_Api.Object_Locked exception.
349 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
350 -- This error is trapped and reported using the message name
351 -- 'HR_7220_INVALID_PRIMARY_KEY'.
352 -- 3) The row although existing in the HR Schema has a different object
353 -- version number than the object version number specified.
354 -- This error is trapped and reported using the message name
355 -- 'HR_7155_OBJECT_INVALID'.
356 --
357 -- Developer Implementation Notes:
358 -- None.
359 --
360 -- Access Status:
361 -- Internal Development Use Only.
362 --
363 -- {End Of Comments}
364 -- ----------------------------------------------------------------------------
365 Procedure lck
366 (p_effective_date in date
367 ,p_datetrack_mode in varchar2
371 ,p_validation_end_date out nocopy date
368 ,p_comptncy_rt_id in number
369 ,p_object_version_number in number
370 ,p_validation_start_date out nocopy date
372 );
373 --
374 -- ----------------------------------------------------------------------------
375 -- |-----------------------------< convert_args >-----------------------------|
376 -- ----------------------------------------------------------------------------
377 -- {Start Of Comments}
378 --
379 -- Description:
380 -- This function is used to turn attribute parameters into the record
381 -- structure parameter g_rec_type.
382 --
383 -- Prerequisites:
384 -- This is a private function and can only be called from the ins or upd
385 -- attribute processes.
386 --
387 -- In Parameters:
388 --
389 -- Post Success:
390 -- A returning record structure will be returned.
391 --
392 -- Post Failure:
393 -- No direct error handling is required within this function. Any possible
394 -- errors within this function will be a PL/SQL value error due to
395 -- conversion of datatypes or data lengths.
396 --
397 -- Developer Implementation Notes:
398 -- None.
399 --
400 -- Access Status:
401 -- Internal Row Handler Use Only.
402 --
403 -- {End Of Comments}
404 -- ----------------------------------------------------------------------------
405 Function convert_args
406 (p_comptncy_rt_id in number
407 ,p_effective_start_date in date
408 ,p_effective_end_date in date
409 ,p_competence_id in number
410 ,p_rating_level_id in number
411 ,p_excld_flag in varchar2
412 ,p_business_group_id in number
413 ,p_vrbl_rt_prfl_id in number
414 ,p_object_version_number in number
415 ,p_ordr_num in number
416 ,p_cty_attribute_category in varchar2
417 ,p_cty_attribute1 in varchar2
418 ,p_cty_attribute2 in varchar2
419 ,p_cty_attribute3 in varchar2
420 ,p_cty_attribute4 in varchar2
421 ,p_cty_attribute5 in varchar2
422 ,p_cty_attribute6 in varchar2
423 ,p_cty_attribute7 in varchar2
424 ,p_cty_attribute8 in varchar2
425 ,p_cty_attribute9 in varchar2
426 ,p_cty_attribute10 in varchar2
427 ,p_cty_attribute11 in varchar2
428 ,p_cty_attribute12 in varchar2
429 ,p_cty_attribute13 in varchar2
430 ,p_cty_attribute14 in varchar2
431 ,p_cty_attribute15 in varchar2
432 ,p_cty_attribute16 in varchar2
433 ,p_cty_attribute17 in varchar2
434 ,p_cty_attribute18 in varchar2
435 ,p_cty_attribute19 in varchar2
436 ,p_cty_attribute20 in varchar2
437 ,p_cty_attribute21 in varchar2
438 ,p_cty_attribute22 in varchar2
439 ,p_cty_attribute23 in varchar2
440 ,p_cty_attribute24 in varchar2
441 ,p_cty_attribute25 in varchar2
442 ,p_cty_attribute26 in varchar2
443 ,p_cty_attribute27 in varchar2
444 ,p_cty_attribute28 in varchar2
445 ,p_cty_attribute29 in varchar2
446 ,p_cty_attribute30 in varchar2
447 )
448 Return g_rec_type;
449 --
450 end ben_cty_shd;