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