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