1 Package ben_ler_shd AUTHID CURRENT_USER as
2 /* $Header: belerrhi.pkh 120.2 2006/11/03 10:24:29 vborkar noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (
10 ler_id number(15),
11 effective_start_date date,
12 effective_end_date date,
13 name varchar2(240),
14 business_group_id number(15),
15 typ_cd varchar2(30),
16 lf_evt_oper_cd varchar2(30),
17 short_name varchar2(30),
18 short_code varchar2(30),
19 ptnl_ler_trtmt_cd varchar2(30),
20 ck_rltd_per_elig_flag varchar2(30),
21 ler_eval_rl number(15),
22 cm_aply_flag varchar2(30),
23 ovridg_le_flag varchar2(30),
24 qualg_evt_flag varchar2(30),
25 whn_to_prcs_cd varchar2(30),
26 desc_txt varchar2(2000),
27 tmlns_eval_cd varchar2(30),
28 tmlns_perd_cd varchar2(30),
29 tmlns_dys_num number(15),
30 tmlns_perd_rl number(15),
31 ocrd_dt_det_cd varchar2(30),
32 ler_stat_cd varchar2(30),
33 slctbl_slf_svc_cd varchar2(30),
34 ss_pcp_disp_cd varchar2(30),
35 ler_attribute_category varchar2(30),
36 ler_attribute1 varchar2(150),
37 ler_attribute2 varchar2(150),
38 ler_attribute3 varchar2(150),
39 ler_attribute4 varchar2(150),
40 ler_attribute5 varchar2(150),
41 ler_attribute6 varchar2(150),
42 ler_attribute7 varchar2(150),
43 ler_attribute8 varchar2(150),
44 ler_attribute9 varchar2(150),
45 ler_attribute10 varchar2(150),
46 ler_attribute11 varchar2(150),
47 ler_attribute12 varchar2(150),
48 ler_attribute13 varchar2(150),
49 ler_attribute14 varchar2(150),
50 ler_attribute15 varchar2(150),
51 ler_attribute16 varchar2(150),
52 ler_attribute17 varchar2(150),
53 ler_attribute18 varchar2(150),
54 ler_attribute19 varchar2(150),
55 ler_attribute20 varchar2(150),
56 ler_attribute21 varchar2(150),
57 ler_attribute22 varchar2(150),
58 ler_attribute23 varchar2(150),
59 ler_attribute24 varchar2(150),
60 ler_attribute25 varchar2(150),
61 ler_attribute26 varchar2(150),
62 ler_attribute27 varchar2(150),
63 ler_attribute28 varchar2(150),
64 ler_attribute29 varchar2(150),
65 ler_attribute30 varchar2(150),
66 object_version_number number(9)
67 );
68 --
69 -- ----------------------------------------------------------------------------
70 -- | Global Definitions - Internal Development Use Only |
71 -- ----------------------------------------------------------------------------
72 --
73 g_old_rec g_rec_type; -- Global record definition
74 g_api_dml boolean; -- Global api dml status
75 --
76 -- ----------------------------------------------------------------------------
77 -- |------------------------< return_api_dml_status >-------------------------|
78 -- ----------------------------------------------------------------------------
79 -- {Start Of Comments}
80 --
81 -- Description:
82 -- This function will return the current g_api_dml private global
83 -- boolean status.
84 -- The g_api_dml status determines if at the time of the function
85 -- being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
86 -- is being issued from within an api.
87 -- If the status is TRUE then a dml statement is being issued from
88 -- within this entity api.
89 -- This function is primarily to support database triggers which
90 -- need to maintain the object_version_number for non-supported
91 -- dml statements (i.e. dml statement issued outside of the api layer).
92 --
93 -- Prerequisites:
94 -- None.
95 --
96 -- In Parameters:
97 -- None.
98 --
99 -- Post Success:
100 -- Processing continues.
101 -- If the function returns a TRUE value then, dml is being executed from
102 -- within this api.
103 --
104 -- Post Failure:
105 -- None.
106 --
107 -- Access Status:
108 -- Internal Row Handler Use Only.
109 --
110 -- {End Of Comments}
111 -- ----------------------------------------------------------------------------
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 -- Prerequisites:
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 corresponds with a constraint error.
142 --
143 -- In Parameter:
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 -- Internal Development Use Only.
161 --
162 -- {End Of Comments}
163 -- ----------------------------------------------------------------------------
164 Procedure constraint_error
165 (p_constraint_name in all_constraints.constraint_name%TYPE);
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 current
174 -- row from the database for the specified primary key provided that the
175 -- primary key exists, and is valid, and does not already match the current
176 -- g_old_rec.
177 -- The function will always return a TRUE value if the g_old_rec is
178 -- populated with the current row. A FALSE value will be returned if all of
179 -- the primary key arguments are null.
180 --
181 -- Prerequisites:
182 -- None.
183 --
184 -- In Parameters:
185 --
186 -- Post Success:
187 -- A value of TRUE will be returned indiciating that the g_old_rec is
188 -- 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 (p_effective_date in date,
210 p_ler_id in number,
211 p_object_version_number in number
212 ) Return Boolean;
213 --
214 -- ----------------------------------------------------------------------------
215 -- |--------------------------< find_dt_del_modes >---------------------------|
216 -- ----------------------------------------------------------------------------
217 -- {Start Of Comments}
218 --
219 -- Description:
220 -- This procedure is used to determine what datetrack delete modes are
221 -- allowed as of the effective date for this entity. The procedure will
222 -- return a corresponding Boolean value for each of the delete modes
223 -- available where TRUE indicates that the corresponding delete mode is
224 -- available.
225 --
226 -- Prerequisites:
227 -- None.
228 --
229 -- In Parameters:
230 -- p_effective_date
231 -- Specifies the date at which the datetrack modes will be operated on.
232 -- p_base_key_value
233 -- Specifies the primary key value for this datetrack entity.
234 -- (E.g. For this entity the assignment of the argument would be:
235 -- p_base_key_value = :ler_id).
236 --
237 -- Post Success:
238 -- Processing continues.
239 --
240 -- Post Failure:
241 -- Failure might occur if for the specified effective date and primary key
242 -- value a row doesn't exist.
243 --
244 -- Developer Implementation Notes:
245 -- This procedure could require changes if this entity has any sepcific
246 -- delete restrictions.
247 -- For example, this entity might disallow the datetrack delete mode of
248 -- ZAP. To implement this you would have to set and return a Boolean value
249 -- of FALSE after the call to the dt_api.find_dt_del_modes procedure.
250 --
251 -- Access Status:
252 -- Internal Development Use Only.
253 --
254 -- {End Of Comments}
255 -- ----------------------------------------------------------------------------
256 Procedure find_dt_del_modes
257 (p_effective_date in date,
258 p_base_key_value in number,
259 p_zap out nocopy boolean,
260 p_delete out nocopy boolean,
261 p_future_change out nocopy boolean,
262 p_delete_next_change out nocopy boolean);
263 --
264 -- ----------------------------------------------------------------------------
265 -- |--------------------------< find_dt_upd_modes >---------------------------|
266 -- ----------------------------------------------------------------------------
267 -- {Start Of Comments}
268 --
269 -- Description:
270 -- This procedure is used to determine what datetrack update modes are
271 -- allowed as of the effective date for this entity. The procedure will
272 -- return a corresponding Boolean value for each of the update modes
273 -- available where TRUE indicates that the corresponding update mode
274 -- is available.
275 --
276 -- Prerequisites:
277 -- None.
278 --
279 -- In Parameters:
280 -- p_effective_date
281 -- Specifies the date at which the datetrack modes will be operated on.
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 = :ler_id).
286 --
287 -- Post Success:
288 -- Processing continues.
289 --
290 -- Post Failure:
291 -- Failure might occur if for the specified effective date and primary key
292 -- value a row doesn't exist.
293 --
294 -- Developer Implementation Notes:
295 -- This procedure could require changes if this entity has any sepcific
296 -- delete restrictions.
297 -- For example, this entity might disallow the datetrack update mode of
298 -- UPDATE. To implement this you would have to set and return a Boolean
299 -- value of FALSE after the call to the dt_api.find_dt_upd_modes procedure.
300 --
301 -- Access Status:
302 -- Internal Development Use Only.
303 --
304 -- {End Of Comments}
305 -- ----------------------------------------------------------------------------
306 Procedure find_dt_upd_modes
307 (p_effective_date in date,
308 p_base_key_value in number,
309 p_correction out nocopy boolean,
310 p_update out nocopy boolean,
311 p_update_override out nocopy boolean,
312 p_update_change_insert out nocopy boolean);
313 --
314 -- ----------------------------------------------------------------------------
315 -- |------------------------< upd_effective_end_date >------------------------|
316 -- ----------------------------------------------------------------------------
317 -- {Start Of Comments}
318 --
319 -- Description:
320 -- This procedure will update the specified datetrack row with the
321 -- specified new effective end date. The object version number is also
322 -- set to the next object version number. DateTrack modes which call
323 -- this procedure are: UPDATE, UPDATE_CHANGE_INSERT,
324 -- UPDATE_OVERRIDE, DELETE, FUTURE_CHANGE and DELETE_NEXT_CHANGE.
325 -- This is an internal datetrack maintenance procedure which should
326 -- not be modified in anyway.
327 --
328 -- Prerequisites:
329 -- None.
330 --
331 -- In Parameters:
332 -- p_new_effective_end_date
333 -- Specifies the new effective end date which will be set for the
334 -- row as of the effective date.
335 -- p_base_key_value
336 -- Specifies the primary key value for this datetrack entity.
337 -- (E.g. For this entity the assignment of the argument would be:
338 -- p_base_key_value = :ler_id).
339 --
340 -- Post Success:
341 -- The specified row will be updated with the new effective end date and
342 -- object_version_number.
343 --
344 -- Post Failure:
345 -- Failure might occur if for the specified effective date and primary key
346 -- value a row doesn't exist.
347 --
348 -- Developer Implementation Notes:
349 -- This is an internal datetrack maintenance procedure which should
350 -- not be modified in anyway.
351 --
352 -- Access Status:
353 -- Internal Row Handler Use Only.
354 --
355 -- {End Of Comments}
356 -- ----------------------------------------------------------------------------
357 Procedure upd_effective_end_date
358 (p_effective_date in date,
359 p_base_key_value in number,
360 p_new_effective_end_date in date,
361 p_validation_start_date in date,
362 p_validation_end_date in date,
363 p_object_version_number out nocopy number);
364 --
365 -- ----------------------------------------------------------------------------
366 -- |---------------------------------< lck >----------------------------------|
367 -- ----------------------------------------------------------------------------
368 -- {Start Of Comments}
372 -- following processing
369 --
370 -- Description:
371 -- The Lck process for datetrack is complicated and comprises of the
373 -- The processing steps are as follows:
374 -- 1) The row to be updated or deleted must be locked.
375 -- By locking this row, the g_old_rec record data type is populated.
376 -- 2) If a comment exists the text is selected from hr_comments.
377 -- 3) The datetrack mode is then validated to ensure the operation is
378 -- valid. If the mode is valid the validation start and end dates for
379 -- the mode will be derived and returned. Any required locking is
380 -- completed when the datetrack mode is validated.
381 --
382 -- Prerequisites:
383 -- When attempting to call the lck procedure the object version number,
384 -- primary key, effective date and datetrack mode must be specified.
385 --
386 -- In Parameters:
387 -- p_effective_date
388 -- Specifies the date of the datetrack update operation.
389 -- p_datetrack_mode
390 -- Determines the datetrack update or delete mode.
391 --
392 -- Post Success:
393 -- On successful completion of the Lck process the row to be updated or
394 -- deleted will be locked and selected into the global data structure
395 -- g_old_rec.
396 --
397 -- Post Failure:
398 -- The Lck process can fail for three reasons:
399 -- 1) When attempting to lock the row the row could already be locked by
400 -- another user. This will raise the HR_Api.Object_Locked exception.
401 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
402 -- This error is trapped and reported using the message name
403 -- 'HR_7220_INVALID_PRIMARY_KEY'.
404 -- 3) The row although existing in the HR Schema has a different object
405 -- version number than the object version number specified.
406 -- This error is trapped and reported using the message name
407 -- 'HR_7155_OBJECT_INVALID'.
408 --
409 -- Developer Implementation Notes:
410 -- None.
411 --
412 -- Access Status:
413 -- Internal Development Use Only.
414 --
415 -- {End Of Comments}
416 -- ----------------------------------------------------------------------------
417 Procedure lck
418 (p_effective_date in date,
419 p_datetrack_mode in varchar2,
420 p_ler_id in number,
421 p_object_version_number in number,
422 p_validation_start_date out nocopy date,
423 p_validation_end_date out nocopy date);
424 --
425 -- ----------------------------------------------------------------------------
426 -- |-----------------------------< convert_args >-----------------------------|
427 -- ----------------------------------------------------------------------------
428 -- {Start Of Comments}
429 --
430 -- Description:
431 -- This function is used to turn attribute parameters into the record
432 -- structure parameter g_rec_type.
433 --
434 -- Prerequisites:
435 -- This is a private function and can only be called from the ins or upd
436 -- attribute processes.
437 --
438 -- In Parameters:
439 --
440 -- Post Success:
441 -- A returning record structure will be returned.
442 --
443 -- Post Failure:
444 -- No direct error handling is required within this function. Any possible
445 -- errors within this function will be a PL/SQL value error due to conversion
446 -- of datatypes or data lengths.
447 --
448 -- Developer Implementation Notes:
449 -- None.
450 --
451 -- Access Status:
452 -- Internal Row Handler Use Only.
453 --
454 -- {End Of Comments}
455 -- ----------------------------------------------------------------------------
456 Function convert_args
457 (
458 p_ler_id in number,
459 p_effective_start_date in date,
460 p_effective_end_date in date,
461 p_name in varchar2,
462 p_business_group_id in number,
463 p_typ_cd in varchar2,
464 p_lf_evt_oper_cd in varchar2,
465 p_short_name in varchar2,
466 p_short_code in varchar2,
467 p_ptnl_ler_trtmt_cd in varchar2,
468 p_ck_rltd_per_elig_flag in varchar2,
469 p_ler_eval_rl in number,
470 p_cm_aply_flag in varchar2,
471 p_ovridg_le_flag in varchar2,
472 p_qualg_evt_flag in varchar2,
473 p_whn_to_prcs_cd in varchar2,
474 p_desc_txt in varchar2,
475 p_tmlns_eval_cd in varchar2,
476 p_tmlns_perd_cd in varchar2,
477 p_tmlns_dys_num in number,
478 p_tmlns_perd_rl in number,
479 p_ocrd_dt_det_cd in varchar2,
480 p_ler_stat_cd in varchar2,
481 p_slctbl_slf_svc_cd in varchar2,
482 p_ss_pcp_disp_cd in varchar2,
483 p_ler_attribute_category in varchar2,
484 p_ler_attribute1 in varchar2,
485 p_ler_attribute2 in varchar2,
486 p_ler_attribute3 in varchar2,
487 p_ler_attribute4 in varchar2,
488 p_ler_attribute5 in varchar2,
489 p_ler_attribute6 in varchar2,
490 p_ler_attribute7 in varchar2,
491 p_ler_attribute8 in varchar2,
492 p_ler_attribute9 in varchar2,
493 p_ler_attribute10 in varchar2,
494 p_ler_attribute11 in varchar2,
495 p_ler_attribute12 in varchar2,
496 p_ler_attribute13 in varchar2,
497 p_ler_attribute14 in varchar2,
498 p_ler_attribute15 in varchar2,
499 p_ler_attribute16 in varchar2,
500 p_ler_attribute17 in varchar2,
501 p_ler_attribute18 in varchar2,
502 p_ler_attribute19 in varchar2,
503 p_ler_attribute20 in varchar2,
504 p_ler_attribute21 in varchar2,
505 p_ler_attribute22 in varchar2,
506 p_ler_attribute23 in varchar2,
507 p_ler_attribute24 in varchar2,
508 p_ler_attribute25 in varchar2,
509 p_ler_attribute26 in varchar2,
510 p_ler_attribute27 in varchar2,
511 p_ler_attribute28 in varchar2,
512 p_ler_attribute29 in varchar2,
513 p_ler_attribute30 in varchar2,
514 p_object_version_number in number
515 )
516 Return g_rec_type;
517 --
518 Procedure add_language;
519 --
520 end ben_ler_shd;