DBA Data[Home] [Help]

PACKAGE: APPS.PER_REI_SHD

Source


1 Package per_rei_shd as
2 /* $Header: pereirhi.pkh 120.0 2005/05/31 17:34:06 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                    Global Record Type Specification                      |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9   (contact_extra_info_id           number(15)
10   ,effective_start_date            date
11   ,effective_end_date              date
12   ,contact_relationship_id         number(15)
13   ,information_type                varchar2(30)
14   ,cei_information_category        varchar2(30)
15   ,cei_information1                varchar2(150)
16   ,cei_information2                varchar2(150)
17   ,cei_information3                varchar2(150)
18   ,cei_information4                varchar2(150)
19   ,cei_information5                varchar2(150)
20   ,cei_information6                varchar2(150)
21   ,cei_information7                varchar2(150)
22   ,cei_information8                varchar2(150)
23   ,cei_information9                varchar2(150)
24   ,cei_information10               varchar2(150)
25   ,cei_information11               varchar2(150)
26   ,cei_information12               varchar2(150)
27   ,cei_information13               varchar2(150)
28   ,cei_information14               varchar2(150)
29   ,cei_information15               varchar2(150)
30   ,cei_information16               varchar2(150)
31   ,cei_information17               varchar2(150)
32   ,cei_information18               varchar2(150)
33   ,cei_information19               varchar2(150)
34   ,cei_information20               varchar2(150)
35   ,cei_information21               varchar2(150)
36   ,cei_information22               varchar2(150)
37   ,cei_information23               varchar2(150)
38   ,cei_information24               varchar2(150)
39   ,cei_information25               varchar2(150)
40   ,cei_information26               varchar2(150)
41   ,cei_information27               varchar2(150)
42   ,cei_information28               varchar2(150)
43   ,cei_information29               varchar2(150)
44   ,cei_information30               varchar2(150)
45   ,cei_attribute_category          varchar2(30)
46   ,cei_attribute1                  varchar2(150)
47   ,cei_attribute2                  varchar2(150)
48   ,cei_attribute3                  varchar2(150)
49   ,cei_attribute4                  varchar2(150)
50   ,cei_attribute5                  varchar2(150)
51   ,cei_attribute6                  varchar2(150)
52   ,cei_attribute7                  varchar2(150)
53   ,cei_attribute8                  varchar2(150)
54   ,cei_attribute9                  varchar2(150)
55   ,cei_attribute10                 varchar2(150)
56   ,cei_attribute11                 varchar2(150)
57   ,cei_attribute12                 varchar2(150)
58   ,cei_attribute13                 varchar2(150)
59   ,cei_attribute14                 varchar2(150)
60   ,cei_attribute15                 varchar2(150)
61   ,cei_attribute16                 varchar2(150)
62   ,cei_attribute17                 varchar2(150)
63   ,cei_attribute18                 varchar2(150)
64   ,cei_attribute19                 varchar2(150)
65   ,cei_attribute20                 varchar2(150)
66   ,object_version_number           number(9)
67   ,request_id                      number(15)
68   ,program_application_id          number(15)
69   ,program_id                      number(15)
70   ,program_update_date             date
71   );
72 --
73 -- ----------------------------------------------------------------------------
74 -- |           Global Definitions - Internal Development Use Only             |
75 -- ----------------------------------------------------------------------------
76 --
77 g_old_rec  g_rec_type;                            -- Global record definition
78 -- Global table name
79 g_tab_nam  constant varchar2(30) := 'PER_CONTACT_EXTRA_INFO_F';
80 g_api_dml  boolean;                               -- Global api dml status
81 
82  -- Global flag set to true by forms code calling the row handler.  If true,
83  -- flexfield validation is not performed.
84 
85  g_called_from_form	BOOLEAN := FALSE;
86  g_end_of_time		DATE := TO_DATE('4712/12/31','YYYY/MM/DD');
87 
88 --
89 -- ----------------------------------------------------------------------------
90 -- |------------------------< return_api_dml_status >-------------------------|
91 -- ----------------------------------------------------------------------------
92 -- {Start Of Comments}
93 --
94 -- Description:
95 --   This function will return the current g_api_dml private global
96 --   boolean status.
97 --   The g_api_dml status determines if at the time of the function
98 --   being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
99 --   is being issued from within an api.
100 --   If the status is TRUE then a dml statement is being issued from
101 --   within this entity api.
102 --   This function is primarily to support database triggers which
103 --   need to maintain the object_version_number for non-supported
104 --   dml statements (i.e. dml statement issued outside of the api layer).
105 --
106 -- Prerequisites:
107 --   None.
108 --
109 -- In Parameters:
110 --   None.
111 --
112 -- Post Success:
113 --   Processing continues.
114 --   If the function returns a TRUE value then, dml is being executed from
115 --   within this api.
116 --
117 -- Post Failure:
118 --   None.
119 --
120 -- Access Status:
121 --   Internal Row Handler Use Only.
122 --
123 -- {End Of Comments}
124 -- ----------------------------------------------------------------------------
125 Function return_api_dml_status Return Boolean;
126 --
127 -- ----------------------------------------------------------------------------
128 -- |---------------------------< constraint_error >---------------------------|
129 -- ----------------------------------------------------------------------------
130 -- {Start Of Comments}
131 --
132 -- Description:
133 --   This procedure is called when a constraint has been violated (i.e.
134 --   The exception hr_api.check_integrity_violated,
135 --   hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
136 --   hr_api.unique_integrity_violated has been raised).
137 --   The exceptions can only be raised as follows:
138 --   1) A check constraint can only be violated during an INSERT or UPDATE
139 --      dml operation.
140 --   2) A parent integrity constraint can only be violated during an
141 --      INSERT or UPDATE dml operation.
142 --   3) A child integrity constraint can only be violated during an
143 --      DELETE dml operation.
144 --   4) A unique integrity constraint can only be violated during INSERT or
145 --      UPDATE dml operation.
146 --
147 -- Prerequisites:
148 --   1) Either hr_api.check_integrity_violated,
149 --      hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
150 --      hr_api.unique_integrity_violated has been raised with the subsequent
151 --      stripping of the constraint name from the generated error message
152 --      text.
153 --   2) Standalone validation test which corresponds with a constraint error.
154 --
155 -- In Parameter:
156 --   p_constraint_name is in upper format and is just the constraint name
157 --   (e.g. not prefixed by brackets, schema owner etc).
158 --
159 -- Post Success:
160 --   Development dependant.
161 --
162 -- Post Failure:
163 --   Developement dependant.
164 --
165 -- Developer Implementation Notes:
166 --   For each constraint being checked the hr system package failure message
167 --   has been generated as a template only. These system error messages should
168 --   be modified as required (i.e. change the system failure message to a user
169 --   friendly defined error message).
170 --
171 -- Access Status:
172 --   Internal Development Use Only.
173 --
174 -- {End Of Comments}
175 -- ----------------------------------------------------------------------------
176 Procedure constraint_error
177   (p_constraint_name in all_constraints.constraint_name%TYPE);
178 --
179 -- ----------------------------------------------------------------------------
180 -- |-----------------------------< api_updating >-----------------------------|
181 -- ----------------------------------------------------------------------------
182 --  {Start Of Comments}
183 --
184 -- Description:
185 --   This function is used to populate the g_old_rec record with the
186 --   current row from the database for the specified primary key
187 --   provided that the primary key exists and is valid and does not
188 --   already match the current g_old_rec. The function will always return
189 --   a TRUE value if the g_old_rec is populated with the current row.
190 --   A FALSE value will be returned if all of the primary key arguments
191 --   are null.
192 --
193 -- Prerequisites:
194 --   None.
195 --
196 -- In Parameters:
197 --
198 -- Post Success:
199 --   A value of TRUE will be returned indiciating that the g_old_rec
200 --   is current.
201 --   A value of FALSE will be returned if all of the primary key arguments
202 --   have a null value (this indicates that the row has not be inserted into
203 --   the Schema), and therefore could never have a corresponding row.
204 --
205 -- Post Failure:
206 --   A failure can only occur under two circumstances:
207 --   1) The primary key is invalid (i.e. a row does not exist for the
208 --      specified primary key values).
209 --   2) If an object_version_number exists but is NOT the same as the current
210 --      g_old_rec value.
211 --
212 -- Developer Implementation Notes:
213 --   None.
214 --
215 -- Access Status:
216 --   Internal Development Use Only.
217 --
218 -- {End Of Comments}
219 -- ----------------------------------------------------------------------------
220 Function api_updating
221   (p_effective_date                   in date
222   ,p_contact_extra_info_id            in number
223   ,p_object_version_number            in number
224   ) Return Boolean;
225 --
226 -- ----------------------------------------------------------------------------
227 -- |---------------------------< find_dt_upd_modes >--------------------------|
228 -- ----------------------------------------------------------------------------
229 -- {Start Of Comments}
230 --
231 -- Description:
232 --   This procedure is used to determine what datetrack update modes are
233 --   allowed as of the effective date for this entity. The procedure will
234 --   return a corresponding Boolean value for each of the update modes
235 --   available where TRUE indicates that the corresponding update mode
236 --   is available.
237 --
238 -- Prerequisites:
239 --   None.
240 --
241 -- In Parameters:
242 --   p_effective_date
243 --     Specifies the date at which the datetrack modes will be operated on.
244 --   p_base_key_value
245 --     Specifies the primary key value for this datetrack entity.
246 --     (E.g. For this entity the assignment of the argument would be:
247 --           p_base_key_value = :contact_extra_info_id).
248 --
249 -- Post Success:
250 --   Processing continues.
251 --
252 -- Post Failure:
253 --   Failure might occur if for the specified effective date and primary key
254 --   value a row doesn't exist.
255 --
256 -- Developer Implementation Notes:
257 --   This procedure could require changes if this entity has any sepcific
258 --   delete restrictions.
259 --   For example, this entity might disallow the datetrack update mode of
260 --   UPDATE. To implement this you would have to set and return a Boolean
261 --   value of FALSE after the call to the dt_api.find_dt_upd_modes procedure.
262 --
263 -- Access Status:
264 --   Internal Development Use Only.
265 --
266 -- {End Of Comments}
267 -- ----------------------------------------------------------------------------
268 Procedure find_dt_upd_modes
269   (p_effective_date         in date
270   ,p_base_key_value         in number
271   ,p_correction             out nocopy boolean
272   ,p_update                 out nocopy boolean
273   ,p_update_override        out nocopy boolean
274   ,p_update_change_insert   out nocopy boolean
275   );
276 --
277 -- ----------------------------------------------------------------------------
278 -- |---------------------------< find_dt_del_modes >--------------------------|
279 -- ----------------------------------------------------------------------------
280 -- {Start Of Comments}
281 --
282 -- Description:
283 --   This procedure is used to determine what datetrack delete modes are
284 --   allowed as of the effective date for this entity. The procedure will
285 --   return a corresponding Boolean value for each of the delete modes
286 --   available where TRUE indicates that the corresponding delete mode is
287 --   available.
288 --
289 -- Prerequisites:
290 --   None.
291 --
292 -- In Parameters:
293 --   p_effective_date
294 --     Specifies the date at which the datetrack modes will be operated on.
295 --   p_base_key_value
296 --     Specifies the primary key value for this datetrack entity.
297 --     (E.g. For this entity the assignment of the argument would be:
298 --           p_base_key_value = :contact_extra_info_id).
299 --
300 -- Post Success:
301 --   Processing continues.
302 --
303 -- Post Failure:
304 --   Failure might occur if for the specified effective date and primary key
305 --   value a row doesn't exist.
306 --
307 -- Developer Implementation Notes:
308 --   This procedure could require changes if this entity has any sepcific
309 --   delete restrictions.
310 --   For example, this entity might disallow the datetrack delete mode of
311 --   ZAP. To implement this you would have to set and return a Boolean value
312 --   of FALSE after the call to the dt_api.find_dt_del_modes procedure.
313 --
314 -- Access Status:
315 --   Internal Development Use Only.
316 --
317 -- {End Of Comments}
318 -- ----------------------------------------------------------------------------
319 Procedure find_dt_del_modes
320   (p_effective_date        in date
321   ,p_base_key_value        in number
322   ,p_zap                   out nocopy boolean
323   ,p_delete                out nocopy boolean
324   ,p_future_change         out nocopy boolean
325   ,p_delete_next_change    out nocopy boolean
326   );
327 --
328 -- ----------------------------------------------------------------------------
329 -- |-----------------------< upd_effective_end_date >-------------------------|
330 -- ----------------------------------------------------------------------------
331 -- {Start Of Comments}
332 --
333 -- Description:
334 --   This procedure will update the specified datetrack row with the
335 --   specified new effective end date. The object version number is also
336 --   set to the next object version number. DateTrack modes which call
337 --   this procedure are: UPDATE, UPDATE_CHANGE_INSERT,
338 --   UPDATE_OVERRIDE, DELETE, FUTURE_CHANGE and DELETE_NEXT_CHANGE.
339 --   This is an internal datetrack maintenance procedure which should
340 --   not be modified in anyway.
341 --
342 -- Prerequisites:
343 --   None.
344 --
345 -- In Parameters:
346 --   p_new_effective_end_date
347 --     Specifies the new effective end date which will be set for the
348 --     row as of the effective date.
349 --   p_base_key_value
350 --     Specifies the primary key value for this datetrack entity.
351 --     (E.g. For this entity the assignment of the argument would be:
352 --           p_base_key_value = :contact_extra_info_id).
353 --
354 -- Post Success:
355 --   The specified row will be updated with the new effective end date and
356 --   object_version_number.
357 --
358 -- Post Failure:
359 --   Failure might occur if for the specified effective date and primary key
360 --   value a row doesn't exist.
361 --
362 -- Developer Implementation Notes:
363 --   This is an internal datetrack maintenance procedure which should
364 --   not be modified in anyway.
365 --
366 -- Access Status:
367 --   Internal Row Handler Use Only.
368 --
369 -- {End Of Comments}
373   ,p_base_key_value         in number
370 -- ----------------------------------------------------------------------------
371 Procedure upd_effective_end_date
372   (p_effective_date         in date
374   ,p_new_effective_end_date in date
375   ,p_validation_start_date  in date
376   ,p_validation_end_date    in date
377   ,p_object_version_number  out nocopy number
378   );
379 --
380 -- ----------------------------------------------------------------------------
381 -- |---------------------------------< lck >----------------------------------|
382 -- ----------------------------------------------------------------------------
383 -- {Start Of Comments}
384 --
385 -- Description:
386 --   The Lck process for datetrack is complicated and comprises of the
387 --   following processing
388 --   The processing steps are as follows:
389 --   1) The row to be updated or deleted must be locked.
390 --      By locking this row, the g_old_rec record data type is populated.
391 --   2) If a comment exists the text is selected from hr_comments.
392 --   3) The datetrack mode is then validated to ensure the operation is
393 --      valid. If the mode is valid the validation start and end dates for
394 --      the mode will be derived and returned. Any required locking is
395 --      completed when the datetrack mode is validated.
396 --
397 -- Prerequisites:
398 --   When attempting to call the lck procedure the object version number,
399 --   primary key, effective date and datetrack mode must be specified.
400 --
401 -- In Parameters:
402 --   p_effective_date
403 --     Specifies the date of the datetrack update operation.
404 --   p_datetrack_mode
405 --     Determines the datetrack update or delete mode.
406 --
407 -- Post Success:
408 --   On successful completion of the Lck process the row to be updated or
409 --   deleted will be locked and selected into the global data structure
410 --   g_old_rec.
411 --
412 -- Post Failure:
413 --   The Lck process can fail for three reasons:
414 --   1) When attempting to lock the row the row could already be locked by
415 --      another user. This will raise the HR_Api.Object_Locked exception.
416 --   2) The row which is required to be locked doesn't exist in the HR Schema.
417 --      This error is trapped and reported using the message name
418 --      'HR_7220_INVALID_PRIMARY_KEY'.
419 --   3) The row although existing in the HR Schema has a different object
420 --      version number than the object version number specified.
421 --      This error is trapped and reported using the message name
422 --      'HR_7155_OBJECT_INVALID'.
423 --
424 -- Developer Implementation Notes:
425 --   None.
426 --
427 -- Access Status:
428 --   Internal Development Use Only.
429 --
430 -- {End Of Comments}
431 -- ----------------------------------------------------------------------------
432 Procedure lck
433   (p_effective_date                   in date
434   ,p_datetrack_mode                   in varchar2
435   ,p_contact_extra_info_id            in number
436   ,p_object_version_number            in number
437   ,p_validation_start_date            out nocopy date
438   ,p_validation_end_date              out nocopy date
439   );
440 --
441 -- ----------------------------------------------------------------------------
442 -- |-----------------------------< convert_args >-----------------------------|
443 -- ----------------------------------------------------------------------------
444 -- {Start Of Comments}
445 --
446 -- Description:
447 --   This function is used to turn attribute parameters into the record
448 --   structure parameter g_rec_type.
449 --
450 -- Prerequisites:
451 --   This is a private function and can only be called from the ins or upd
452 --   attribute processes.
453 --
454 -- In Parameters:
455 --
456 -- Post Success:
457 --   A returning record structure will be returned.
458 --
459 -- Post Failure:
460 --   No direct error handling is required within this function.  Any possible
461 --   errors within this function will be a PL/SQL value error due to
462 --   conversion of datatypes or data lengths.
463 --
464 -- Developer Implementation Notes:
465 --   None.
466 --
467 -- Access Status:
468 --   Internal Row Handler Use Only.
469 --
470 -- {End Of Comments}
471 -- ----------------------------------------------------------------------------
472 Function convert_args
473   (p_contact_extra_info_id          in number
474   ,p_effective_start_date           in date
475   ,p_effective_end_date             in date
476   ,p_contact_relationship_id        in number
477   ,p_information_type               in varchar2
478   ,p_cei_information_category       in varchar2
479   ,p_cei_information1               in varchar2
480   ,p_cei_information2               in varchar2
481   ,p_cei_information3               in varchar2
482   ,p_cei_information4               in varchar2
483   ,p_cei_information5               in varchar2
484   ,p_cei_information6               in varchar2
485   ,p_cei_information7               in varchar2
486   ,p_cei_information8               in varchar2
487   ,p_cei_information9               in varchar2
488   ,p_cei_information10              in varchar2
489   ,p_cei_information11              in varchar2
490   ,p_cei_information12              in varchar2
491   ,p_cei_information13              in varchar2
492   ,p_cei_information14              in varchar2
493   ,p_cei_information15              in varchar2
494   ,p_cei_information16              in varchar2
495   ,p_cei_information17              in varchar2
496   ,p_cei_information18              in varchar2
497   ,p_cei_information19              in varchar2
498   ,p_cei_information20              in varchar2
499   ,p_cei_information21              in varchar2
500   ,p_cei_information22              in varchar2
501   ,p_cei_information23              in varchar2
502   ,p_cei_information24              in varchar2
503   ,p_cei_information25              in varchar2
504   ,p_cei_information26              in varchar2
505   ,p_cei_information27              in varchar2
506   ,p_cei_information28              in varchar2
507   ,p_cei_information29              in varchar2
508   ,p_cei_information30              in varchar2
509   ,p_cei_attribute_category         in varchar2
510   ,p_cei_attribute1                 in varchar2
511   ,p_cei_attribute2                 in varchar2
512   ,p_cei_attribute3                 in varchar2
513   ,p_cei_attribute4                 in varchar2
514   ,p_cei_attribute5                 in varchar2
515   ,p_cei_attribute6                 in varchar2
516   ,p_cei_attribute7                 in varchar2
517   ,p_cei_attribute8                 in varchar2
518   ,p_cei_attribute9                 in varchar2
519   ,p_cei_attribute10                in varchar2
520   ,p_cei_attribute11                in varchar2
521   ,p_cei_attribute12                in varchar2
522   ,p_cei_attribute13                in varchar2
523   ,p_cei_attribute14                in varchar2
524   ,p_cei_attribute15                in varchar2
525   ,p_cei_attribute16                in varchar2
526   ,p_cei_attribute17                in varchar2
527   ,p_cei_attribute18                in varchar2
528   ,p_cei_attribute19                in varchar2
529   ,p_cei_attribute20                in varchar2
530   ,p_object_version_number          in number
531   ,p_request_id                     in number
532   ,p_program_application_id         in number
533   ,p_program_id                     in number
534   ,p_program_update_date            in date
535   )
536   Return g_rec_type;
537 --
538 -- ----------------------------------------------------------------------------
539 -- |-------------------------< set_called_from_form >-------------------------|
540 -- ----------------------------------------------------------------------------
541 -- {Start Of Comments}
542 --
543 -- Description:
544 --   This procedure is used to set the global g_called_from_form which controls
545 --   the execution of the df and ddf data validation. When set the df and ddf
546 --   validation is bypassed.
547 --
548 -- Prerequisites:
549 --   None.
550 --
551 -- In Parameters:
552 --   Name               Reqd    Type            Description
553 --   p_flag             Yes     BOOLEAN         If true, the df and ddf
554 --                                              validation is bypassed.
555 --
556 -- Post Success:
557 --   The global variable is set.
558 --
559 -- Post Failure:
560 --   No failure condition exists.
561 --
562 -- Developer Implementation Notes:
563 --   None.
564 --
565 -- Access Status:
566 --   Internal Development Use Only.
567 --
568 -- {End Of Comments}
569 -- ----------------------------------------------------------------------------
570  PROCEDURE set_called_from_form(
571   p_flag	IN	BOOLEAN);
572 --
573 end per_rei_shd;