1 Package pqh_asa_shd as
2 /* $Header: pqasarhi.pkh 120.0 2005/05/29 01:25:12 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (assignment_acco_id number(15)
10 ,effective_start_date date
11 ,effective_end_date date
12 ,business_group_id number(15)
13 ,assignment_id number(10)
14 ,accommodation_given varchar2(10)
15 ,temporary_assignment varchar2(10)
16 ,accommodation_id number(15)
17 ,acceptance_date date
18 ,moving_date date
19 ,refusal_date date
20 ,comments varchar2(2000) -- pseudo column
21 ,indemnity_entitlement varchar2(10)
22 ,indemnity_amount number(15)
23 ,type_of_payment varchar2(50)
24 ,information_category varchar2(30)
25 ,information1 varchar2(150)
26 ,information2 varchar2(150)
27 ,information3 varchar2(150)
28 ,information4 varchar2(150)
29 ,information5 varchar2(150)
30 ,information6 varchar2(150)
31 ,information7 varchar2(150)
32 ,information8 varchar2(150)
33 ,information9 varchar2(150)
34 ,information10 varchar2(150)
35 ,information11 varchar2(150)
36 ,information12 varchar2(150)
37 ,information13 varchar2(150)
38 ,information14 varchar2(150)
39 ,information15 varchar2(150)
40 ,information16 varchar2(150)
41 ,information17 varchar2(150)
42 ,information18 varchar2(150)
43 ,information19 varchar2(150)
44 ,information20 varchar2(150)
45 ,information21 varchar2(150)
46 ,information22 varchar2(150)
47 ,information23 varchar2(150)
48 ,information24 varchar2(150)
49 ,information25 varchar2(150)
50 ,information26 varchar2(150)
51 ,information27 varchar2(150)
52 ,information28 varchar2(150)
53 ,information29 varchar2(150)
54 ,information30 varchar2(150)
55 ,attribute_category varchar2(30)
56 ,attribute1 varchar2(150)
57 ,attribute2 varchar2(150)
58 ,attribute3 varchar2(150)
59 ,attribute4 varchar2(150)
60 ,attribute5 varchar2(150)
61 ,attribute6 varchar2(150)
62 ,attribute7 varchar2(150)
63 ,attribute8 varchar2(150)
64 ,attribute9 varchar2(150)
65 ,attribute10 varchar2(150)
66 ,attribute11 varchar2(150)
67 ,attribute12 varchar2(150)
68 ,attribute13 varchar2(150)
69 ,attribute14 varchar2(150)
70 ,attribute15 varchar2(150)
71 ,attribute16 varchar2(150)
72 ,attribute17 varchar2(150)
73 ,attribute18 varchar2(150)
74 ,attribute19 varchar2(150)
75 ,attribute20 varchar2(150)
76 ,attribute21 varchar2(150)
77 ,attribute22 varchar2(150)
78 ,attribute23 varchar2(150)
79 ,attribute24 varchar2(150)
80 ,attribute25 varchar2(150)
81 ,attribute26 varchar2(150)
82 ,attribute27 varchar2(150)
83 ,attribute28 varchar2(150)
84 ,attribute29 varchar2(150)
85 ,attribute30 varchar2(150)
86 ,object_version_number number(9)
87 ,reason_for_no_acco varchar2(30)
88 ,indemnity_currency varchar2(30)
89 );
90 --
91 -- ----------------------------------------------------------------------------
92 -- | Global Definitions - Internal Development Use Only |
93 -- ----------------------------------------------------------------------------
94 --
95 g_old_rec g_rec_type; -- Global record definition
96 -- Global table name
97 g_tab_nam constant varchar2(30) := 'PQH_ASSIGN_ACCOMMODATIONS_F';
98 --
99 -- ----------------------------------------------------------------------------
100 -- |---------------------------< constraint_error >---------------------------|
101 -- ----------------------------------------------------------------------------
102 -- {Start Of Comments}
103 --
104 -- Description:
105 -- This procedure is called when a constraint has been violated (i.e.
106 -- The exception hr_api.check_integrity_violated,
107 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
108 -- hr_api.unique_integrity_violated has been raised).
109 -- The exceptions can only be raised as follows:
110 -- 1) A check constraint can only be violated during an INSERT or UPDATE
111 -- dml operation.
112 -- 2) A parent integrity constraint can only be violated during an
113 -- INSERT or UPDATE dml operation.
114 -- 3) A child integrity constraint can only be violated during an
115 -- DELETE dml operation.
116 -- 4) A unique integrity constraint can only be violated during INSERT or
117 -- UPDATE dml operation.
118 --
119 -- Prerequisites:
120 -- 1) Either hr_api.check_integrity_violated,
121 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
122 -- hr_api.unique_integrity_violated has been raised with the subsequent
123 -- stripping of the constraint name from the generated error message
124 -- text.
125 -- 2) Standalone validation test which corresponds with a constraint error.
126 --
127 -- In Parameter:
128 -- p_constraint_name is in upper format and is just the constraint name
129 -- (e.g. not prefixed by brackets, schema owner etc).
130 --
131 -- Post Success:
132 -- Development dependant.
133 --
134 -- Post Failure:
135 -- Developement dependant.
136 --
137 -- Developer Implementation Notes:
138 -- For each constraint being checked the hr system package failure message
139 -- has been generated as a template only. These system error messages should
140 -- be modified as required (i.e. change the system failure message to a user
141 -- friendly defined error message).
142 --
143 -- Access Status:
144 -- Internal Development Use Only.
145 --
146 -- {End Of Comments}
147 -- ----------------------------------------------------------------------------
148 Procedure constraint_error
149 (p_constraint_name in all_constraints.constraint_name%TYPE);
150 --
151 -- ----------------------------------------------------------------------------
152 -- |-----------------------------< api_updating >-----------------------------|
153 -- ----------------------------------------------------------------------------
154 -- {Start Of Comments}
155 --
156 -- Description:
157 -- This function is used to populate the g_old_rec record with the
158 -- current row from the database for the specified primary key
159 -- provided that the primary key exists and is valid and does not
160 -- already match the current g_old_rec. The function will always return
161 -- a TRUE value if the g_old_rec is populated with the current row.
162 -- A FALSE value will be returned if all of the primary key arguments
163 -- are null.
164 --
165 -- Prerequisites:
166 -- None.
167 --
168 -- In Parameters:
169 --
170 -- Post Success:
171 -- A value of TRUE will be returned indiciating that the g_old_rec
172 -- is current.
173 -- A value of FALSE will be returned if all of the primary key arguments
174 -- have a null value (this indicates that the row has not be inserted into
175 -- the Schema), and therefore could never have a corresponding row.
176 --
177 -- Post Failure:
178 -- A failure can only occur under two circumstances:
179 -- 1) The primary key is invalid (i.e. a row does not exist for the
180 -- specified primary key values).
181 -- 2) If an object_version_number exists but is NOT the same as the current
182 -- g_old_rec value.
183 --
184 -- Developer Implementation Notes:
185 -- None.
186 --
187 -- Access Status:
188 -- Internal Development Use Only.
189 --
190 -- {End Of Comments}
191 -- ----------------------------------------------------------------------------
192 Function api_updating
193 (p_effective_date in date
194 ,p_assignment_acco_id in number
195 ,p_object_version_number in number
196 ) Return Boolean;
197 --
198 -- ----------------------------------------------------------------------------
199 -- |---------------------------< find_dt_upd_modes >--------------------------|
200 -- ----------------------------------------------------------------------------
201 -- {Start Of Comments}
202 --
203 -- Description:
204 -- This procedure is used to determine what datetrack update modes are
205 -- allowed as of the effective date for this entity. The procedure will
206 -- return a corresponding Boolean value for each of the update modes
207 -- available where TRUE indicates that the corresponding update mode
208 -- is available.
209 --
210 -- Prerequisites:
211 -- None.
212 --
213 -- In Parameters:
214 -- p_effective_date
215 -- Specifies the date at which the datetrack modes will be operated on.
216 -- p_base_key_value
217 -- Specifies the primary key value for this datetrack entity.
218 -- (E.g. For this entity the assignment of the argument would be:
219 -- p_base_key_value = :assignment_acco_id).
220 --
221 -- Post Success:
222 -- Processing continues.
223 --
224 -- Post Failure:
225 -- Failure might occur if for the specified effective date and primary key
226 -- value a row doesn't exist.
227 --
228 -- Developer Implementation Notes:
229 -- This procedure could require changes if this entity has any sepcific
230 -- delete restrictions.
231 -- For example, this entity might disallow the datetrack update mode of
232 -- UPDATE. To implement this you would have to set and return a Boolean
233 -- value of FALSE after the call to the dt_api.find_dt_upd_modes procedure.
234 --
235 -- Access Status:
236 -- Internal Development Use Only.
237 --
238 -- {End Of Comments}
239 -- ----------------------------------------------------------------------------
240 Procedure find_dt_upd_modes
241 (p_effective_date in date
242 ,p_base_key_value in number
243 ,p_correction out nocopy boolean
244 ,p_update out nocopy boolean
245 ,p_update_override out nocopy boolean
246 ,p_update_change_insert out nocopy boolean
247 );
248 --
249 -- ----------------------------------------------------------------------------
250 -- |---------------------------< find_dt_del_modes >--------------------------|
251 -- ----------------------------------------------------------------------------
252 -- {Start Of Comments}
253 --
254 -- Description:
255 -- This procedure is used to determine what datetrack delete modes are
256 -- allowed as of the effective date for this entity. The procedure will
257 -- return a corresponding Boolean value for each of the delete modes
258 -- available where TRUE indicates that the corresponding delete mode is
259 -- available.
260 --
261 -- Prerequisites:
262 -- None.
263 --
264 -- In Parameters:
265 -- p_effective_date
266 -- Specifies the date at which the datetrack modes will be operated on.
267 -- p_base_key_value
268 -- Specifies the primary key value for this datetrack entity.
269 -- (E.g. For this entity the assignment of the argument would be:
270 -- p_base_key_value = :assignment_acco_id).
271 --
272 -- Post Success:
273 -- Processing continues.
274 --
275 -- Post Failure:
276 -- Failure might occur if for the specified effective date and primary key
277 -- value a row doesn't exist.
278 --
279 -- Developer Implementation Notes:
280 -- This procedure could require changes if this entity has any sepcific
281 -- delete restrictions.
282 -- For example, this entity might disallow the datetrack delete mode of
283 -- ZAP. To implement this you would have to set and return a Boolean value
284 -- of FALSE after the call to the dt_api.find_dt_del_modes procedure.
285 --
286 -- Access Status:
287 -- Internal Development Use Only.
288 --
289 -- {End Of Comments}
290 -- ----------------------------------------------------------------------------
291 Procedure find_dt_del_modes
292 (p_effective_date in date
293 ,p_base_key_value in number
294 ,p_zap out nocopy boolean
295 ,p_delete out nocopy boolean
296 ,p_future_change out nocopy boolean
297 ,p_delete_next_change out nocopy boolean
298 );
299 --
300 -- ----------------------------------------------------------------------------
301 -- |-----------------------< upd_effective_end_date >-------------------------|
302 -- ----------------------------------------------------------------------------
303 -- {Start Of Comments}
304 --
305 -- Description:
306 -- This procedure will update the specified datetrack row with the
307 -- specified new effective end date. The object version number is also
308 -- set to the next object version number. DateTrack modes which call
309 -- this procedure are: UPDATE, UPDATE_CHANGE_INSERT,
310 -- UPDATE_OVERRIDE, DELETE, FUTURE_CHANGE and DELETE_NEXT_CHANGE.
314 -- Prerequisites:
311 -- This is an internal datetrack maintenance procedure which should
312 -- not be modified in anyway.
313 --
315 -- None.
316 --
317 -- In Parameters:
318 -- p_new_effective_end_date
319 -- Specifies the new effective end date which will be set for the
320 -- row as of the effective date.
321 -- p_base_key_value
322 -- Specifies the primary key value for this datetrack entity.
323 -- (E.g. For this entity the assignment of the argument would be:
324 -- p_base_key_value = :assignment_acco_id).
325 --
326 -- Post Success:
327 -- The specified row will be updated with the new effective end date and
328 -- object_version_number.
329 --
330 -- Post Failure:
331 -- Failure might occur if for the specified effective date and primary key
332 -- value a row doesn't exist.
333 --
334 -- Developer Implementation Notes:
335 -- This is an internal datetrack maintenance procedure which should
336 -- not be modified in anyway.
337 --
338 -- Access Status:
339 -- Internal Row Handler Use Only.
340 --
341 -- {End Of Comments}
342 -- ----------------------------------------------------------------------------
343 Procedure upd_effective_end_date
344 (p_effective_date in date
345 ,p_base_key_value in number
346 ,p_new_effective_end_date in date
347 ,p_validation_start_date in date
348 ,p_validation_end_date in date
349 ,p_object_version_number out nocopy number
350 );
351 --
352 -- ----------------------------------------------------------------------------
353 -- |---------------------------------< lck >----------------------------------|
354 -- ----------------------------------------------------------------------------
355 -- {Start Of Comments}
356 --
357 -- Description:
358 -- The Lck process for datetrack is complicated and comprises of the
359 -- following processing
360 -- The processing steps are as follows:
361 -- 1) The row to be updated or deleted must be locked.
362 -- By locking this row, the g_old_rec record data type is populated.
363 -- 2) If a comment exists the text is selected from hr_comments.
364 -- 3) The datetrack mode is then validated to ensure the operation is
365 -- valid. If the mode is valid the validation start and end dates for
366 -- the mode will be derived and returned. Any required locking is
367 -- completed when the datetrack mode is validated.
368 --
369 -- Prerequisites:
370 -- When attempting to call the lck procedure the object version number,
371 -- primary key, effective date and datetrack mode must be specified.
372 --
373 -- In Parameters:
374 -- p_effective_date
375 -- Specifies the date of the datetrack update operation.
376 -- p_datetrack_mode
377 -- Determines the datetrack update or delete mode.
378 --
379 -- Post Success:
380 -- On successful completion of the Lck process the row to be updated or
381 -- deleted will be locked and selected into the global data structure
382 -- g_old_rec.
383 --
384 -- Post Failure:
385 -- The Lck process can fail for three reasons:
386 -- 1) When attempting to lock the row the row could already be locked by
387 -- another user. This will raise the HR_Api.Object_Locked exception.
388 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
389 -- This error is trapped and reported using the message name
390 -- 'HR_7220_INVALID_PRIMARY_KEY'.
391 -- 3) The row although existing in the HR Schema has a different object
392 -- version number than the object version number specified.
393 -- This error is trapped and reported using the message name
394 -- 'HR_7155_OBJECT_INVALID'.
395 --
396 -- Developer Implementation Notes:
397 -- None.
398 --
399 -- Access Status:
400 -- Internal Development Use Only.
401 --
402 -- {End Of Comments}
403 -- ----------------------------------------------------------------------------
404 Procedure lck
405 (p_effective_date in date
406 ,p_datetrack_mode in varchar2
407 ,p_assignment_acco_id in number
408 ,p_object_version_number in number
409 ,p_validation_start_date out nocopy date
410 ,p_validation_end_date out nocopy date
411 );
412 --
413 -- ----------------------------------------------------------------------------
414 -- |-----------------------------< convert_args >-----------------------------|
415 -- ----------------------------------------------------------------------------
416 -- {Start Of Comments}
417 --
418 -- Description:
419 -- This function is used to turn attribute parameters into the record
420 -- structure parameter g_rec_type.
421 --
422 -- Prerequisites:
423 -- This is a private function and can only be called from the ins or upd
424 -- attribute processes.
425 --
426 -- In Parameters:
427 --
428 -- Post Success:
429 -- A returning record structure will be returned.
430 --
431 -- Post Failure:
432 -- No direct error handling is required within this function. Any possible
433 -- errors within this function will be a PL/SQL value error due to
434 -- conversion of datatypes or data lengths.
435 --
436 -- Developer Implementation Notes:
437 -- None.
438 --
439 -- Access Status:
443 -- ----------------------------------------------------------------------------
440 -- Internal Row Handler Use Only.
441 --
442 -- {End Of Comments}
444 Function convert_args
445 (p_assignment_acco_id in number
446 ,p_effective_start_date in date
447 ,p_effective_end_date in date
448 ,p_business_group_id in number
449 ,p_assignment_id in number
450 ,p_accommodation_given in varchar2
451 ,p_temporary_assignment in varchar2
452 ,p_accommodation_id in number
453 ,p_acceptance_date in date
454 ,p_moving_date in date
455 ,p_refusal_date in date
456 ,p_comments in varchar2
457 ,p_indemnity_entitlement in varchar2
458 ,p_indemnity_amount in number
459 ,p_type_of_payment in varchar2
460 ,p_information_category in varchar2
461 ,p_information1 in varchar2
462 ,p_information2 in varchar2
463 ,p_information3 in varchar2
464 ,p_information4 in varchar2
465 ,p_information5 in varchar2
466 ,p_information6 in varchar2
467 ,p_information7 in varchar2
468 ,p_information8 in varchar2
469 ,p_information9 in varchar2
470 ,p_information10 in varchar2
471 ,p_information11 in varchar2
472 ,p_information12 in varchar2
473 ,p_information13 in varchar2
474 ,p_information14 in varchar2
475 ,p_information15 in varchar2
476 ,p_information16 in varchar2
477 ,p_information17 in varchar2
478 ,p_information18 in varchar2
479 ,p_information19 in varchar2
480 ,p_information20 in varchar2
481 ,p_information21 in varchar2
482 ,p_information22 in varchar2
483 ,p_information23 in varchar2
484 ,p_information24 in varchar2
485 ,p_information25 in varchar2
486 ,p_information26 in varchar2
487 ,p_information27 in varchar2
488 ,p_information28 in varchar2
489 ,p_information29 in varchar2
490 ,p_information30 in varchar2
491 ,p_attribute_category in varchar2
492 ,p_attribute1 in varchar2
493 ,p_attribute2 in varchar2
494 ,p_attribute3 in varchar2
495 ,p_attribute4 in varchar2
496 ,p_attribute5 in varchar2
497 ,p_attribute6 in varchar2
498 ,p_attribute7 in varchar2
499 ,p_attribute8 in varchar2
500 ,p_attribute9 in varchar2
501 ,p_attribute10 in varchar2
502 ,p_attribute11 in varchar2
503 ,p_attribute12 in varchar2
504 ,p_attribute13 in varchar2
505 ,p_attribute14 in varchar2
506 ,p_attribute15 in varchar2
507 ,p_attribute16 in varchar2
508 ,p_attribute17 in varchar2
509 ,p_attribute18 in varchar2
510 ,p_attribute19 in varchar2
511 ,p_attribute20 in varchar2
512 ,p_attribute21 in varchar2
513 ,p_attribute22 in varchar2
514 ,p_attribute23 in varchar2
515 ,p_attribute24 in varchar2
516 ,p_attribute25 in varchar2
517 ,p_attribute26 in varchar2
518 ,p_attribute27 in varchar2
519 ,p_attribute28 in varchar2
520 ,p_attribute29 in varchar2
521 ,p_attribute30 in varchar2
522 ,p_object_version_number in number
523 ,p_reason_for_no_acco in varchar2
524 ,p_indemnity_currency in varchar2
525 )
526 Return g_rec_type;
527 --
528 end pqh_asa_shd;