1 Package ben_dce_shd as
2 /* $Header: bedcerhi.pkh 120.0 2005/05/28 01:31:47 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (
10 dpnt_cvg_eligy_prfl_id number(15),
11 effective_end_date date,
12 effective_start_date date,
13 business_group_id number(15),
14 regn_id number(15),
15 name varchar2(240), -- UTF8 Change Bug 2254683
16 dpnt_cvg_eligy_prfl_stat_cd varchar2(30),
17 dce_desc varchar2(240),
18 -- military_status_rqmt_ind varchar2(30),
19 dpnt_cvg_elig_det_rl number(15),
20 dce_attribute_category varchar2(30),
21 dce_attribute1 varchar2(150),
22 dce_attribute2 varchar2(150),
23 dce_attribute3 varchar2(150),
24 dce_attribute4 varchar2(150),
25 dce_attribute5 varchar2(150),
26 dce_attribute6 varchar2(150),
27 dce_attribute7 varchar2(150),
28 dce_attribute8 varchar2(150),
29 dce_attribute9 varchar2(150),
30 dce_attribute10 varchar2(150),
31 dce_attribute11 varchar2(150),
32 dce_attribute12 varchar2(150),
33 dce_attribute13 varchar2(150),
34 dce_attribute14 varchar2(150),
35 dce_attribute15 varchar2(150),
36 dce_attribute16 varchar2(150),
37 dce_attribute17 varchar2(150),
38 dce_attribute18 varchar2(150),
39 dce_attribute19 varchar2(150),
40 dce_attribute20 varchar2(150),
41 dce_attribute21 varchar2(150),
42 dce_attribute22 varchar2(150),
43 dce_attribute23 varchar2(150),
44 dce_attribute24 varchar2(150),
45 dce_attribute25 varchar2(150),
46 dce_attribute26 varchar2(150),
47 dce_attribute27 varchar2(150),
48 dce_attribute28 varchar2(150),
49 dce_attribute29 varchar2(150),
50 dce_attribute30 varchar2(150),
51 object_version_number number(9),
52 dpnt_rlshp_flag varchar2(30),
53 dpnt_age_flag varchar2(30),
54 dpnt_stud_flag varchar2(30),
55 dpnt_dsbld_flag varchar2(30),
56 dpnt_mrtl_flag varchar2(30),
57 dpnt_mltry_flag varchar2(30),
58 dpnt_pstl_flag varchar2(30),
59 dpnt_cvrd_in_anthr_pl_flag varchar2(30),
60 dpnt_dsgnt_crntly_enrld_flag varchar2(30)
61 );
62 --
63 -- ----------------------------------------------------------------------------
64 -- | Global Definitions - Internal Development Use Only |
65 -- ----------------------------------------------------------------------------
66 --
67 g_old_rec g_rec_type; -- Global record definition
68 g_api_dml boolean; -- Global api dml status
69 --
70 -- ----------------------------------------------------------------------------
71 -- |------------------------< return_api_dml_status >-------------------------|
72 -- ----------------------------------------------------------------------------
73 -- {Start Of Comments}
74 --
75 -- Description:
76 -- This function will return the current g_api_dml private global
77 -- boolean status.
78 -- The g_api_dml status determines if at the time of the function
79 -- being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
80 -- is being issued from within an api.
81 -- If the status is TRUE then a dml statement is being issued from
82 -- within this entity api.
83 -- This function is primarily to support database triggers which
84 -- need to maintain the object_version_number for non-supported
85 -- dml statements (i.e. dml statement issued outside of the api layer).
86 --
87 -- Prerequisites:
88 -- None.
89 --
90 -- In Parameters:
91 -- None.
92 --
93 -- Post Success:
94 -- Processing continues.
95 -- If the function returns a TRUE value then, dml is being executed from
96 -- within this api.
97 --
98 -- Post Failure:
99 -- None.
100 --
101 -- Access Status:
102 -- Internal Row Handler Use Only.
103 --
104 -- {End Of Comments}
105 -- ----------------------------------------------------------------------------
106 Function return_api_dml_status Return Boolean;
107 --
108 -- ----------------------------------------------------------------------------
109 -- |---------------------------< constraint_error >---------------------------|
110 -- ----------------------------------------------------------------------------
111 -- {Start Of Comments}
112 --
113 -- Description:
114 -- This procedure is called when a constraint has been violated (i.e.
115 -- The exception hr_api.check_integrity_violated,
116 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
117 -- hr_api.unique_integrity_violated has been raised).
118 -- The exceptions can only be raised as follows:
119 -- 1) A check constraint can only be violated during an INSERT or UPDATE
120 -- dml operation.
121 -- 2) A parent integrity constraint can only be violated during an
122 -- INSERT or UPDATE dml operation.
123 -- 3) A child integrity constraint can only be violated during an
124 -- DELETE dml operation.
125 -- 4) A unique integrity constraint can only be violated during INSERT or
126 -- UPDATE dml operation.
127 --
128 -- Prerequisites:
129 -- 1) Either hr_api.check_integrity_violated,
130 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
131 -- hr_api.unique_integrity_violated has been raised with the subsequent
132 -- stripping of the constraint name from the generated error message
133 -- text.
134 -- 2) Standalone validation test which corresponds with a constraint error.
135 --
136 -- In Parameter:
137 -- p_constraint_name is in upper format and is just the constraint name
138 -- (e.g. not prefixed by brackets, schema owner etc).
139 --
140 -- Post Success:
141 -- Development dependant.
142 --
143 -- Post Failure:
144 -- Developement dependant.
145 --
146 -- Developer Implementation Notes:
147 -- For each constraint being checked the hr system package failure message
148 -- has been generated as a template only. These system error messages should
149 -- be modified as required (i.e. change the system failure message to a user
150 -- friendly defined error message).
151 --
152 -- Access Status:
153 -- Internal Development Use Only.
154 --
155 -- {End Of Comments}
156 -- ----------------------------------------------------------------------------
157 Procedure constraint_error
158 (p_constraint_name in all_constraints.constraint_name%TYPE);
159 --
160 -- ----------------------------------------------------------------------------
161 -- |-----------------------------< api_updating >-----------------------------|
162 -- ----------------------------------------------------------------------------
163 -- {Start Of Comments}
164 --
165 -- Description:
166 -- This function is used to populate the g_old_rec record with the current
167 -- row from the database for the specified primary key provided that the
168 -- primary key exists, and is valid, and does not already match the current
169 -- g_old_rec.
170 -- The function will always return a TRUE value if the g_old_rec is
171 -- populated with the current row. A FALSE value will be returned if all of
172 -- the primary key arguments are null.
173 --
174 -- Prerequisites:
175 -- None.
176 --
177 -- In Parameters:
178 --
179 -- Post Success:
180 -- A value of TRUE will be returned indiciating that the g_old_rec is
181 -- current.
182 -- A value of FALSE will be returned if all of the primary key arguments
183 -- have a null value (this indicates that the row has not be inserted into
184 -- the Schema), and therefore could never have a corresponding row.
185 --
186 -- Post Failure:
187 -- A failure can only occur under two circumstances:
188 -- 1) The primary key is invalid (i.e. a row does not exist for the
189 -- specified primary key values).
190 -- 2) If an object_version_number exists but is NOT the same as the current
191 -- g_old_rec value.
192 --
193 -- Developer Implementation Notes:
194 -- None.
195 --
196 -- Access Status:
197 -- Internal Development Use Only.
198 --
199 -- {End Of Comments}
200 -- ----------------------------------------------------------------------------
201 Function api_updating
202 (p_effective_date in date,
203 p_dpnt_cvg_eligy_prfl_id in number,
204 p_object_version_number in number
205 ) Return Boolean;
206 --
207 -- ----------------------------------------------------------------------------
208 -- |--------------------------< find_dt_del_modes >---------------------------|
209 -- ----------------------------------------------------------------------------
210 -- {Start Of Comments}
211 --
212 -- Description:
213 -- This procedure is used to determine what datetrack delete modes are
214 -- allowed as of the effective date for this entity. The procedure will
215 -- return a corresponding Boolean value for each of the delete modes
216 -- available where TRUE indicates that the corresponding delete mode is
217 -- available.
218 --
219 -- Prerequisites:
220 -- None.
221 --
222 -- In Parameters:
223 -- p_effective_date
224 -- Specifies the date at which the datetrack modes will be operated on.
225 -- p_base_key_value
226 -- Specifies the primary key value for this datetrack entity.
227 -- (E.g. For this entity the assignment of the argument would be:
228 -- p_base_key_value = :dpnt_cvg_eligy_prfl_id).
229 --
230 -- Post Success:
231 -- Processing continues.
232 --
233 -- Post Failure:
234 -- Failure might occur if for the specified effective date and primary key
235 -- value a row doesn't exist.
236 --
237 -- Developer Implementation Notes:
238 -- This procedure could require changes if this entity has any sepcific
239 -- delete restrictions.
240 -- For example, this entity might disallow the datetrack delete mode of
241 -- ZAP. To implement this you would have to set and return a Boolean value
242 -- of FALSE after the call to the dt_api.find_dt_del_modes procedure.
243 --
244 -- Access Status:
245 -- Internal Development Use Only.
246 --
247 -- {End Of Comments}
248 -- ----------------------------------------------------------------------------
249 Procedure find_dt_del_modes
250 (p_effective_date in date,
251 p_base_key_value in number,
252 p_zap out nocopy boolean,
253 p_delete out nocopy boolean,
254 p_future_change out nocopy boolean,
255 p_delete_next_change out nocopy boolean);
256 --
257 -- ----------------------------------------------------------------------------
258 -- |--------------------------< find_dt_upd_modes >---------------------------|
259 -- ----------------------------------------------------------------------------
260 -- {Start Of Comments}
261 --
262 -- Description:
263 -- This procedure is used to determine what datetrack update modes are
264 -- allowed as of the effective date for this entity. The procedure will
265 -- return a corresponding Boolean value for each of the update modes
266 -- available where TRUE indicates that the corresponding update mode
267 -- is available.
268 --
269 -- Prerequisites:
270 -- None.
271 --
272 -- In Parameters:
273 -- p_effective_date
274 -- Specifies the date at which the datetrack modes will be operated on.
275 -- p_base_key_value
276 -- Specifies the primary key value for this datetrack entity.
277 -- (E.g. For this entity the assignment of the argument would be:
278 -- p_base_key_value = :dpnt_cvg_eligy_prfl_id).
279 --
280 -- Post Success:
281 -- Processing continues.
282 --
283 -- Post Failure:
284 -- Failure might occur if for the specified effective date and primary key
285 -- value a row doesn't exist.
286 --
287 -- Developer Implementation Notes:
288 -- This procedure could require changes if this entity has any sepcific
289 -- delete restrictions.
290 -- For example, this entity might disallow the datetrack update mode of
291 -- UPDATE. To implement this you would have to set and return a Boolean
292 -- value of FALSE after the call to the dt_api.find_dt_upd_modes procedure.
293 --
294 -- Access Status:
295 -- Internal Development Use Only.
296 --
297 -- {End Of Comments}
298 -- ----------------------------------------------------------------------------
299 Procedure find_dt_upd_modes
300 (p_effective_date in date,
301 p_base_key_value in number,
302 p_correction out nocopy boolean,
303 p_update out nocopy boolean,
304 p_update_override out nocopy boolean,
305 p_update_change_insert out nocopy boolean);
306 --
307 -- ----------------------------------------------------------------------------
308 -- |------------------------< upd_effective_end_date >------------------------|
309 -- ----------------------------------------------------------------------------
310 -- {Start Of Comments}
311 --
312 -- Description:
313 -- This procedure will update the specified datetrack row with the
314 -- specified new effective end date. The object version number is also
315 -- set to the next object version number. DateTrack modes which call
316 -- this procedure are: UPDATE, UPDATE_CHANGE_INSERT,
317 -- UPDATE_OVERRIDE, DELETE, FUTURE_CHANGE and DELETE_NEXT_CHANGE.
318 -- This is an internal datetrack maintenance procedure which should
319 -- not be modified in anyway.
320 --
321 -- Prerequisites:
322 -- None.
323 --
324 -- In Parameters:
325 -- p_new_effective_end_date
326 -- Specifies the new effective end date which will be set for the
327 -- row as of the effective date.
328 -- p_base_key_value
329 -- Specifies the primary key value for this datetrack entity.
330 -- (E.g. For this entity the assignment of the argument would be:
331 -- p_base_key_value = :dpnt_cvg_eligy_prfl_id).
332 --
333 -- Post Success:
334 -- The specified row will be updated with the new effective end date and
335 -- object_version_number.
336 --
337 -- Post Failure:
338 -- Failure might occur if for the specified effective date and primary key
339 -- value a row doesn't exist.
340 --
341 -- Developer Implementation Notes:
342 -- This is an internal datetrack maintenance procedure which should
343 -- not be modified in anyway.
344 --
345 -- Access Status:
346 -- Internal Row Handler Use Only.
347 --
348 -- {End Of Comments}
349 -- ----------------------------------------------------------------------------
350 Procedure upd_effective_end_date
351 (p_effective_date in date,
352 p_base_key_value in number,
353 p_new_effective_end_date in date,
354 p_validation_start_date in date,
355 p_validation_end_date in date,
356 p_object_version_number out nocopy number);
357 --
358 -- ----------------------------------------------------------------------------
359 -- |---------------------------------< lck >----------------------------------|
360 -- ----------------------------------------------------------------------------
361 -- {Start Of Comments}
362 --
363 -- Description:
364 -- The Lck process for datetrack is complicated and comprises of the
365 -- following processing
366 -- The processing steps are as follows:
367 -- 1) The row to be updated or deleted must be locked.
368 -- By locking this row, the g_old_rec record data type is populated.
372 -- the mode will be derived and returned. Any required locking is
369 -- 2) If a comment exists the text is selected from hr_comments.
370 -- 3) The datetrack mode is then validated to ensure the operation is
371 -- valid. If the mode is valid the validation start and end dates for
373 -- completed when the datetrack mode is validated.
374 --
375 -- Prerequisites:
376 -- When attempting to call the lck procedure the object version number,
377 -- primary key, effective date and datetrack mode must be specified.
378 --
379 -- In Parameters:
380 -- p_effective_date
381 -- Specifies the date of the datetrack update operation.
382 -- p_datetrack_mode
383 -- Determines the datetrack update or delete mode.
384 --
385 -- Post Success:
386 -- On successful completion of the Lck process the row to be updated or
387 -- deleted will be locked and selected into the global data structure
388 -- g_old_rec.
389 --
390 -- Post Failure:
391 -- The Lck process can fail for three reasons:
392 -- 1) When attempting to lock the row the row could already be locked by
393 -- another user. This will raise the HR_Api.Object_Locked exception.
394 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
395 -- This error is trapped and reported using the message name
396 -- 'HR_7220_INVALID_PRIMARY_KEY'.
397 -- 3) The row although existing in the HR Schema has a different object
398 -- version number than the object version number specified.
399 -- This error is trapped and reported using the message name
400 -- 'HR_7155_OBJECT_INVALID'.
401 --
402 -- Developer Implementation Notes:
403 -- None.
404 --
405 -- Access Status:
406 -- Internal Development Use Only.
407 --
408 -- {End Of Comments}
409 -- ----------------------------------------------------------------------------
410 Procedure lck
411 (p_effective_date in date,
412 p_datetrack_mode in varchar2,
413 p_dpnt_cvg_eligy_prfl_id in number,
414 p_object_version_number in number,
415 p_validation_start_date out nocopy date,
416 p_validation_end_date out nocopy date);
417 --
418 -- ----------------------------------------------------------------------------
419 -- |-----------------------------< convert_args >-----------------------------|
420 -- ----------------------------------------------------------------------------
421 -- {Start Of Comments}
422 --
423 -- Description:
424 -- This function is used to turn attribute parameters into the record
425 -- structure parameter g_rec_type.
426 --
427 -- Prerequisites:
428 -- This is a private function and can only be called from the ins or upd
429 -- attribute processes.
430 --
431 -- In Parameters:
432 --
433 -- Post Success:
434 -- A returning record structure will be returned.
435 --
436 -- Post Failure:
437 -- No direct error handling is required within this function. Any possible
438 -- errors within this function will be a PL/SQL value error due to conversion
439 -- of datatypes or data lengths.
440 --
441 -- Developer Implementation Notes:
442 -- None.
443 --
444 -- Access Status:
445 -- Internal Row Handler Use Only.
446 --
447 -- {End Of Comments}
448 -- ----------------------------------------------------------------------------
449 Function convert_args
450 (
451 p_dpnt_cvg_eligy_prfl_id in number,
452 p_effective_end_date in date,
453 p_effective_start_date in date,
454 p_business_group_id in number,
455 p_regn_id in number,
456 p_name in varchar2,
457 p_dpnt_cvg_eligy_prfl_stat_cd in varchar2,
458 p_dce_desc in varchar2,
459 -- p_military_status_rqmt_ind in varchar2,
460 p_dpnt_cvg_elig_det_rl in number,
461 p_dce_attribute_category in varchar2,
462 p_dce_attribute1 in varchar2,
463 p_dce_attribute2 in varchar2,
464 p_dce_attribute3 in varchar2,
465 p_dce_attribute4 in varchar2,
466 p_dce_attribute5 in varchar2,
467 p_dce_attribute6 in varchar2,
468 p_dce_attribute7 in varchar2,
469 p_dce_attribute8 in varchar2,
470 p_dce_attribute9 in varchar2,
471 p_dce_attribute10 in varchar2,
472 p_dce_attribute11 in varchar2,
473 p_dce_attribute12 in varchar2,
474 p_dce_attribute13 in varchar2,
475 p_dce_attribute14 in varchar2,
476 p_dce_attribute15 in varchar2,
477 p_dce_attribute16 in varchar2,
478 p_dce_attribute17 in varchar2,
479 p_dce_attribute18 in varchar2,
480 p_dce_attribute19 in varchar2,
481 p_dce_attribute20 in varchar2,
482 p_dce_attribute21 in varchar2,
483 p_dce_attribute22 in varchar2,
484 p_dce_attribute23 in varchar2,
485 p_dce_attribute24 in varchar2,
486 p_dce_attribute25 in varchar2,
487 p_dce_attribute26 in varchar2,
488 p_dce_attribute27 in varchar2,
489 p_dce_attribute28 in varchar2,
490 p_dce_attribute29 in varchar2,
491 p_dce_attribute30 in varchar2,
492 p_object_version_number in number,
493 p_dpnt_rlshp_flag in varchar2,
494 p_dpnt_age_flag in varchar2,
495 p_dpnt_stud_flag in varchar2,
496 p_dpnt_dsbld_flag in varchar2,
497 p_dpnt_mrtl_flag in varchar2,
498 p_dpnt_mltry_flag in varchar2,
499 p_dpnt_pstl_flag in varchar2,
500 p_dpnt_cvrd_in_anthr_pl_flag in varchar2,
501 p_dpnt_dsgnt_crntly_enrld_flag in varchar2
502 )
503 Return g_rec_type;
504 --
505 end ben_dce_shd;