1 Package ben_enp_shd as
2 /* $Header: beenprhi.pkh 120.1 2007/05/13 22:29:48 rtagarra noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (
10 enrt_perd_id number(15),
11 business_group_id number(15),
12 yr_perd_id number(15),
13 popl_enrt_typ_cycl_id number(15),
14 end_dt date,
15 strt_dt date,
16 asnd_lf_evt_dt date,
17 cls_enrt_dt_to_use_cd varchar2(30),
18 dflt_enrt_dt date,
19 enrt_cvg_strt_dt_cd varchar2(30),
20 rt_strt_dt_rl number(15),
21 enrt_cvg_end_dt_cd varchar2(30),
22 enrt_cvg_strt_dt_rl number(15),
23 enrt_cvg_end_dt_rl number(15),
24 procg_end_dt date,
25 rt_strt_dt_cd varchar2(30),
26 rt_end_dt_cd varchar2(30),
27 rt_end_dt_rl number(15),
28 bdgt_upd_strt_dt date,
29 bdgt_upd_end_dt date,
30 ws_upd_strt_dt date,
31 ws_upd_end_dt date,
32 dflt_ws_acc_cd varchar2(30),
33 prsvr_bdgt_cd varchar2(30),
34 uses_bdgt_flag varchar2(30),
35 auto_distr_flag varchar2(30),
36 hrchy_to_use_cd varchar2(30),
37 pos_structure_version_id number(15),
38 emp_interview_type_cd varchar2(30),
39 wthn_yr_perd_id number(15),
40 ler_id number(15),
41 perf_revw_strt_dt date,
42 asg_updt_eff_date date,
43 enp_attribute_category varchar2(30),
44 enp_attribute1 varchar2(150),
45 enp_attribute2 varchar2(150),
46 enp_attribute3 varchar2(150),
47 enp_attribute4 varchar2(150),
48 enp_attribute5 varchar2(150),
49 enp_attribute6 varchar2(150),
50 enp_attribute7 varchar2(150),
51 enp_attribute8 varchar2(150),
52 enp_attribute9 varchar2(150),
53 enp_attribute10 varchar2(150),
54 enp_attribute11 varchar2(150),
55 enp_attribute12 varchar2(150),
56 enp_attribute13 varchar2(150),
57 enp_attribute14 varchar2(150),
58 enp_attribute15 varchar2(150),
59 enp_attribute16 varchar2(150),
60 enp_attribute17 varchar2(150),
61 enp_attribute18 varchar2(150),
62 enp_attribute19 varchar2(150),
63 enp_attribute20 varchar2(150),
64 enp_attribute21 varchar2(150),
65 enp_attribute22 varchar2(150),
66 enp_attribute23 varchar2(150),
67 enp_attribute24 varchar2(150),
68 enp_attribute25 varchar2(150),
69 enp_attribute26 varchar2(150),
70 enp_attribute27 varchar2(150),
71 enp_attribute28 varchar2(150),
72 enp_attribute29 varchar2(150),
73 enp_attribute30 varchar2(150),
74 enrt_perd_det_ovrlp_bckdt_cd varchar2(30),
75 --cwb
76 data_freeze_date date ,
77 Sal_chg_reason_cd varchar2(30) ,
78 Approval_mode_cd varchar2(30) ,
79 hrchy_ame_trn_cd varchar2(30) ,
80 hrchy_rl number(15) ,
81 hrchy_ame_app_id number(15) ,
82 --
83 object_version_number number(9),
84 reinstate_cd varchar2(30),
85 reinstate_ovrdn_cd varchar2(30),
86 defer_deenrol_flag varchar2(30)
87 );
88 --
89 -- ----------------------------------------------------------------------------
90 -- | Global Definitions - Internal Development Use Only |
91 -- ----------------------------------------------------------------------------
92 --
93 g_old_rec g_rec_type; -- Global record definition
94 g_api_dml boolean; -- Global api dml status
95 --
96 -- ----------------------------------------------------------------------------
97 -- |------------------------< return_api_dml_status >-------------------------|
98 -- ----------------------------------------------------------------------------
99 -- {Start Of Comments}
100 --
101 -- Description:
102 -- This function will return the current g_api_dml private global
103 -- boolean status.
104 -- The g_api_dml status determines if at the time of the function
105 -- being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
106 -- is being issued from within an api.
107 -- If the status is TRUE then a dml statement is being issued from
108 -- within this entity api.
109 -- This function is primarily to support database triggers which
110 -- need to maintain the object_version_number for non-supported
111 -- dml statements (i.e. dml statement issued outside of the api layer).
112 --
113 -- Prerequisites:
114 -- None.
115 --
116 -- In Parameters:
117 -- None.
118 --
119 -- Post Success:
120 -- Processing continues.
121 -- If the function returns a TRUE value then, dml is being executed from
122 -- within this api.
123 --
124 -- Post Failure:
125 -- None.
126 --
127 -- Access Status:
128 -- Internal Row Handler Use Only.
129 --
130 -- {End Of Comments}
131 -- ----------------------------------------------------------------------------
132 Function return_api_dml_status Return Boolean;
133 --
134 -- ----------------------------------------------------------------------------
135 -- |---------------------------< constraint_error >---------------------------|
136 -- ----------------------------------------------------------------------------
137 -- {Start Of Comments}
138 --
139 -- Description:
140 -- This procedure is called when a constraint has been violated (i.e.
141 -- The exception hr_api.check_integrity_violated,
142 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
143 -- hr_api.unique_integrity_violated has been raised).
144 -- The exceptions can only be raised as follows:
145 -- 1) A check constraint can only be violated during an INSERT or UPDATE
146 -- dml operation.
147 -- 2) A parent integrity constraint can only be violated during an
148 -- INSERT or UPDATE dml operation.
149 -- 3) A child integrity constraint can only be violated during an
150 -- DELETE dml operation.
151 -- 4) A unique integrity constraint can only be violated during INSERT or
152 -- UPDATE dml operation.
153 --
154 -- Prerequisites:
155 -- 1) Either hr_api.check_integrity_violated,
156 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
157 -- hr_api.unique_integrity_violated has been raised with the subsequent
158 -- stripping of the constraint name from the generated error message
159 -- text.
160 -- 2) Standalone validation test which corresponds with a constraint error.
161 --
162 -- In Parameter:
163 -- p_constraint_name is in upper format and is just the constraint name
164 -- (e.g. not prefixed by brackets, schema owner etc).
165 --
166 -- Post Success:
167 -- Development dependant.
168 --
169 -- Post Failure:
170 -- Developement dependant.
171 --
172 -- Developer Implementation Notes:
173 -- For each constraint being checked the hr system package failure message
174 -- has been generated as a template only. These system error messages should
175 -- be modified as required (i.e. change the system failure message to a user
176 -- friendly defined error message).
177 --
178 -- Access Status:
179 -- Internal Development Use Only.
180 --
181 -- {End Of Comments}
182 -- ----------------------------------------------------------------------------
183 Procedure constraint_error
184 (p_constraint_name in all_constraints.constraint_name%TYPE);
185 --
186 -- ----------------------------------------------------------------------------
187 -- |-----------------------------< api_updating >-----------------------------|
188 -- ----------------------------------------------------------------------------
189 -- {Start Of Comments}
190 --
191 -- Description:
192 -- This function is used to populate the g_old_rec record with the
193 -- current row from the database for the specified primary key
194 -- provided that the primary key exists and is valid and does not
195 -- already match the current g_old_rec. The function will always return
196 -- a TRUE value if the g_old_rec is populated with the current row.
197 -- A FALSE value will be returned if all of the primary key arguments
198 -- are null.
199 --
200 -- Prerequisites:
201 -- None.
202 --
203 -- In Parameters:
204 --
205 -- Post Success:
206 -- A value of TRUE will be returned indiciating that the g_old_rec
207 -- is current.
208 -- A value of FALSE will be returned if all of the primary key arguments
209 -- have a null value (this indicates that the row has not be inserted into
210 -- the Schema), and therefore could never have a corresponding row.
211 --
212 -- Post Failure:
213 -- A failure can only occur under two circumstances:
214 -- 1) The primary key is invalid (i.e. a row does not exist for the
215 -- specified primary key values).
216 -- 2) If an object_version_number exists but is NOT the same as the current
217 -- g_old_rec value.
218 --
219 -- Developer Implementation Notes:
220 -- None.
221 --
222 -- Access Status:
223 -- Internal Development Use Only.
224 --
225 -- {End Of Comments}
226 -- ----------------------------------------------------------------------------
227 Function api_updating
228 (
229 p_enrt_perd_id in number,
230 p_object_version_number in number
231 ) Return Boolean;
232 --
233 -- ----------------------------------------------------------------------------
234 -- |---------------------------------< lck >----------------------------------|
235 -- ----------------------------------------------------------------------------
236 -- {Start Of Comments}
237 --
238 -- Description:
239 -- The Lck process has two main functions to perform. Firstly, the row to be
240 -- updated or deleted must be locked. The locking of the row will only be
241 -- successful if the row is not currently locked by another user.
242 -- Secondly, during the locking of the row, the row is selected into
243 -- the g_old_rec data structure which enables the current row values from the
244 -- server to be available to the api.
245 --
246 -- Prerequisites:
247 -- When attempting to call the lock the object version number (if defined)
248 -- is mandatory.
249 --
250 -- In Parameters:
251 -- The arguments to the Lck process are the primary key(s) which uniquely
252 -- identify the row and the object version number of row.
253 --
254 -- Post Success:
255 -- On successful completion of the Lck process the row to be updated or
256 -- deleted will be locked and selected into the global data structure
257 -- g_old_rec.
258 --
259 -- Post Failure:
260 -- The Lck process can fail for three reasons:
261 -- 1) When attempting to lock the row the row could already be locked by
262 -- another user. This will raise the HR_Api.Object_Locked exception.
263 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
264 -- This error is trapped and reported using the message name
265 -- 'HR_7220_INVALID_PRIMARY_KEY'.
266 -- 3) The row although existing in the HR Schema has a different object
267 -- version number than the object version number specified.
268 -- This error is trapped and reported using the message name
269 -- 'HR_7155_OBJECT_INVALID'.
270 --
271 -- Developer Implementation Notes:
272 -- For each primary key and the object version number arguments add a
273 -- call to hr_api.mandatory_arg_error procedure to ensure that these
274 -- argument values are not null.
275 --
276 -- Access Status:
277 -- Internal Development Use Only.
278 --
279 -- {End Of Comments}
280 -- ----------------------------------------------------------------------------
281 Procedure lck
282 (
283 p_enrt_perd_id in number,
284 p_object_version_number in number
285 );
286 --
287 -- ----------------------------------------------------------------------------
288 -- |-----------------------------< convert_args >-----------------------------|
289 -- ----------------------------------------------------------------------------
290 -- {Start Of Comments}
291 --
292 -- Description:
293 -- This function is used to turn attribute parameters into the record
294 -- structure parameter g_rec_type.
295 --
296 -- Prerequisites:
297 -- This is a private function and can only be called from the ins or upd
298 -- attribute processes.
299 --
300 -- In Parameters:
301 --
302 -- Post Success:
303 -- A returning record structure will be returned.
304 --
305 -- Post Failure:
306 -- No direct error handling is required within this function. Any possible
307 -- errors within this function will be a PL/SQL value error due to conversion
308 -- of datatypes or data lengths.
309 --
310 -- Developer Implementation Notes:
311 -- None.
312 --
313 -- Access Status:
314 -- Internal Row Handler Use Only.
315 --
316 -- {End Of Comments}
317 -- ----------------------------------------------------------------------------
318 Function convert_args
319 (
320 p_enrt_perd_id in number,
321 p_business_group_id in number,
322 p_yr_perd_id in number,
323 p_popl_enrt_typ_cycl_id in number,
324 p_end_dt in date,
325 p_strt_dt in date,
326 p_asnd_lf_evt_dt in date,
327 p_cls_enrt_dt_to_use_cd in varchar2,
328 p_dflt_enrt_dt in date,
329 p_enrt_cvg_strt_dt_cd in varchar2,
330 p_rt_strt_dt_rl in number,
331 p_enrt_cvg_end_dt_cd in varchar2,
332 p_enrt_cvg_strt_dt_rl in number,
333 p_enrt_cvg_end_dt_rl in number,
334 p_procg_end_dt in date,
335 p_rt_strt_dt_cd in varchar2,
336 p_rt_end_dt_cd in varchar2,
337 p_rt_end_dt_rl in number,
338 p_bdgt_upd_strt_dt in date,
339 p_bdgt_upd_end_dt in date,
340 p_ws_upd_strt_dt in date,
341 p_ws_upd_end_dt in date,
342 p_dflt_ws_acc_cd in varchar2,
343 p_prsvr_bdgt_cd in varchar2,
344 p_uses_bdgt_flag in varchar2,
345 p_auto_distr_flag in varchar2,
346 p_hrchy_to_use_cd in varchar2,
347 p_pos_structure_version_id in number,
348 p_emp_interview_type_cd in varchar2,
349 p_wthn_yr_perd_id in number,
350 p_ler_id in number,
351 p_perf_revw_strt_dt in date,
352 p_asg_updt_eff_date in date,
353 p_enp_attribute_category in varchar2,
354 p_enp_attribute1 in varchar2,
355 p_enp_attribute2 in varchar2,
356 p_enp_attribute3 in varchar2,
357 p_enp_attribute4 in varchar2,
358 p_enp_attribute5 in varchar2,
359 p_enp_attribute6 in varchar2,
360 p_enp_attribute7 in varchar2,
361 p_enp_attribute8 in varchar2,
362 p_enp_attribute9 in varchar2,
363 p_enp_attribute10 in varchar2,
364 p_enp_attribute11 in varchar2,
365 p_enp_attribute12 in varchar2,
366 p_enp_attribute13 in varchar2,
367 p_enp_attribute14 in varchar2,
368 p_enp_attribute15 in varchar2,
369 p_enp_attribute16 in varchar2,
370 p_enp_attribute17 in varchar2,
371 p_enp_attribute18 in varchar2,
372 p_enp_attribute19 in varchar2,
373 p_enp_attribute20 in varchar2,
374 p_enp_attribute21 in varchar2,
375 p_enp_attribute22 in varchar2,
376 p_enp_attribute23 in varchar2,
377 p_enp_attribute24 in varchar2,
378 p_enp_attribute25 in varchar2,
379 p_enp_attribute26 in varchar2,
380 p_enp_attribute27 in varchar2,
381 p_enp_attribute28 in varchar2,
382 p_enp_attribute29 in varchar2,
383 p_enp_attribute30 in varchar2,
384 p_enrt_perd_det_ovrlp_bckdt_cd in varchar2,
385 --cwb
386 p_data_freeze_date in date ,
387 p_Sal_chg_reason_cd in varchar2,
388 p_Approval_mode_cd in varchar2,
389 p_hrchy_ame_trn_cd in varchar2,
390 p_hrchy_rl in number,
391 p_hrchy_ame_app_id in number,
392 p_object_version_number in number,
393 p_reinstate_cd in varchar2,
394 p_reinstate_ovrdn_cd in varchar2,
395 p_defer_deenrol_flag varchar2
396 )
397 Return g_rec_type;
398 --
399 end ben_enp_shd;