1 Package ben_ecr_shd as
2 /* $Header: beecrrhi.pkh 120.0 2005/05/28 01:53:27 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (
10 enrt_rt_id NUMBER(15,0),
11 ordr_num number(15),
12 acty_typ_cd VARCHAR2(30),
13 tx_typ_cd VARCHAR2(30),
14 ctfn_rqd_flag VARCHAR2(30),
15 dflt_flag VARCHAR2(30),
16 dflt_pndg_ctfn_flag VARCHAR2(30),
17 dsply_on_enrt_flag VARCHAR2(30),
18 use_to_calc_net_flx_cr_flag VARCHAR2(30),
19 entr_val_at_enrt_flag VARCHAR2(30),
20 asn_on_enrt_flag VARCHAR2(30),
21 rl_crs_only_flag VARCHAR2(30),
22 dflt_val NUMBER,
23 ann_val NUMBER,
24 ann_mn_elcn_val NUMBER,
25 ann_mx_elcn_val NUMBER,
26 val NUMBER,
27 nnmntry_uom VARCHAR2(30),
28 mx_elcn_val NUMBER,
29 mn_elcn_val NUMBER,
30 incrmt_elcn_val NUMBER,
31 cmcd_acty_ref_perd_cd VARCHAR2(30),
32 cmcd_mn_elcn_val NUMBER,
33 cmcd_mx_elcn_val NUMBER,
34 cmcd_val NUMBER,
35 cmcd_dflt_val NUMBER,
36 rt_usg_cd VARCHAR2(30),
37 ann_dflt_val NUMBER(15,2),
38 bnft_rt_typ_cd VARCHAR2(30),
39 rt_mlt_cd VARCHAR2(30),
40 dsply_mn_elcn_val NUMBER(15,2),
41 dsply_mx_elcn_val NUMBER(15,2),
42 entr_ann_val_flag VARCHAR2(30),
43 rt_strt_dt DATE,
44 rt_strt_dt_cd VARCHAR2(30),
45 rt_strt_dt_rl NUMBER(15,0),
46 rt_typ_cd VARCHAR2(30),
47 elig_per_elctbl_chc_id NUMBER(15,0),
48 acty_base_rt_id NUMBER(15,0),
49 spcl_rt_enrt_rt_id NUMBER(15,0),
50 enrt_bnft_id NUMBER(15),
51 prtt_rt_val_id NUMBER(15,0),
52 decr_bnft_prvdr_pool_id NUMBER(15),
53 cvg_amt_calc_mthd_id NUMBER(15),
54 actl_prem_id NUMBER(15),
55 comp_lvl_fctr_id NUMBER(15),
56 ptd_comp_lvl_fctr_id NUMBER(15),
57 clm_comp_lvl_fctr_id NUMBER(15),
58 business_group_id NUMBER(15),
59 --cwb
60 iss_val number,
61 val_last_upd_date date,
62 val_last_upd_person_id number(15),
63 --cwb
64 pp_in_yr_used_num number(15),
65 ecr_attribute_category VARCHAR2(30),
66 ecr_attribute1 VARCHAR2(150),
67 ecr_attribute2 VARCHAR2(150),
68 ecr_attribute3 VARCHAR2(150),
69 ecr_attribute4 VARCHAR2(150),
70 ecr_attribute5 VARCHAR2(150),
71 ecr_attribute6 VARCHAR2(150),
72 ecr_attribute7 VARCHAR2(150),
73 ecr_attribute8 VARCHAR2(150),
74 ecr_attribute9 VARCHAR2(150),
75 ecr_attribute10 VARCHAR2(150),
76 ecr_attribute11 VARCHAR2(150),
77 ecr_attribute12 VARCHAR2(150),
78 ecr_attribute13 VARCHAR2(150),
79 ecr_attribute14 VARCHAR2(150),
80 ecr_attribute15 VARCHAR2(150),
81 ecr_attribute16 VARCHAR2(150),
82 ecr_attribute17 VARCHAR2(150),
83 ecr_attribute18 VARCHAR2(150),
84 ecr_attribute19 VARCHAR2(150),
85 ecr_attribute20 VARCHAR2(150),
86 ecr_attribute21 VARCHAR2(150),
87 ecr_attribute22 VARCHAR2(150),
88 ecr_attribute23 VARCHAR2(150),
89 ecr_attribute24 VARCHAR2(150),
90 ecr_attribute25 VARCHAR2(150),
91 ecr_attribute26 VARCHAR2(150),
92 ecr_attribute27 VARCHAR2(150),
93 ecr_attribute28 VARCHAR2(150),
94 ecr_attribute29 VARCHAR2(150),
95 ecr_attribute30 VARCHAR2(150),
96 last_update_login NUMBER(15),
97 created_by NUMBER(15),
98 creation_date DATE,
99 last_updated_by NUMBER(15),
100 last_update_date DATE,
101 request_id NUMBER(15),
102 program_application_id NUMBER(15),
103 program_id NUMBER(15),
104 program_update_date DATE,
105 object_version_number NUMBER(9)
106 );
107 --
108 -- ----------------------------------------------------------------------------
109 -- | Global Definitions - Internal Development Use Only |
110 -- ----------------------------------------------------------------------------
111 --
112 g_old_rec g_rec_type; -- Global record definition
113 g_api_dml boolean; -- Global api dml status
114 --
115 -- ----------------------------------------------------------------------------
116 -- |------------------------< return_api_dml_status >-------------------------|
117 -- ----------------------------------------------------------------------------
118 -- {Start Of Comments}
119 --
120 -- Description:
121 -- This function will return the current g_api_dml private global
122 -- boolean status.
123 -- The g_api_dml status determines if at the time of the function
124 -- being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
125 -- is being issued from within an api.
126 -- If the status is TRUE then a dml statement is being issued from
127 -- within this entity api.
128 -- This function is primarily to support database triggers which
129 -- need to maintain the object_version_number for non-supported
130 -- dml statements (i.e. dml statement issued outside of the api layer).
131 --
132 -- Prerequisites:
133 -- None.
134 --
135 -- In Parameters:
136 -- None.
137 --
138 -- Post Success:
139 -- Processing continues.
140 -- If the function returns a TRUE value then, dml is being executed from
141 -- within this api.
142 --
143 -- Post Failure:
144 -- None.
145 --
146 -- Access Status:
147 -- Internal Row Handler Use Only.
148 --
149 -- {End Of Comments}
150 -- ----------------------------------------------------------------------------
151 Function return_api_dml_status Return Boolean;
152 --
153 -- ----------------------------------------------------------------------------
154 -- |---------------------------< constraint_error >---------------------------|
155 -- ----------------------------------------------------------------------------
156 -- {Start Of Comments}
157 --
158 -- Description:
159 -- This procedure is called when a constraint has been violated (i.e.
160 -- The exception hr_api.check_integrity_violated,
161 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
162 -- hr_api.unique_integrity_violated has been raised).
163 -- The exceptions can only be raised as follows:
164 -- 1) A check constraint can only be violated during an INSERT or UPDATE
165 -- dml operation.
166 -- 2) A parent integrity constraint can only be violated during an
167 -- INSERT or UPDATE dml operation.
168 -- 3) A child integrity constraint can only be violated during an
169 -- DELETE dml operation.
170 -- 4) A unique integrity constraint can only be violated during INSERT or
171 -- UPDATE dml operation.
172 --
173 -- Prerequisites:
174 -- 1) Either hr_api.check_integrity_violated,
175 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
176 -- hr_api.unique_integrity_violated has been raised with the subsequent
177 -- stripping of the constraint name from the generated error message
178 -- text.
179 -- 2) Standalone validation test which corresponds with a constraint error.
180 --
181 -- In Parameter:
182 -- p_constraint_name is in upper format and is just the constraint name
183 -- (e.g. not prefixed by brackets, schema owner etc).
184 --
185 -- Post Success:
186 -- Development dependant.
187 --
188 -- Post Failure:
189 -- Developement dependant.
190 --
191 -- Developer Implementation Notes:
192 -- For each constraint being checked the hr system package failure message
193 -- has been generated as a template only. These system error messages should
194 -- be modified as required (i.e. change the system failure message to a user
195 -- friendly defined error message).
196 --
197 -- Access Status:
198 -- Internal Development Use Only.
199 --
200 -- {End Of Comments}
201 -- ----------------------------------------------------------------------------
202 Procedure constraint_error
203 (p_constraint_name in all_constraints.constraint_name%TYPE);
204 --
205 -- ----------------------------------------------------------------------------
206 -- |-----------------------------< api_updating >-----------------------------|
207 -- ----------------------------------------------------------------------------
208 -- {Start Of Comments}
209 --
210 -- Description:
211 -- This function is used to populate the g_old_rec record with the
212 -- current row from the database for the specified primary key
213 -- provided that the primary key exists and is valid and does not
214 -- already match the current g_old_rec. The function will always return
215 -- a TRUE value if the g_old_rec is populated with the current row.
216 -- A FALSE value will be returned if all of the primary key arguments
217 -- are null.
218 --
219 -- Prerequisites:
220 -- None.
221 --
222 -- In Parameters:
223 --
224 -- Post Success:
225 -- A value of TRUE will be returned indiciating that the g_old_rec
226 -- is current.
227 -- A value of FALSE will be returned if all of the primary key arguments
228 -- have a null value (this indicates that the row has not be inserted into
229 -- the Schema), and therefore could never have a corresponding row.
230 --
231 -- Post Failure:
232 -- A failure can only occur under two circumstances:
233 -- 1) The primary key is invalid (i.e. a row does not exist for the
234 -- specified primary key values).
235 -- 2) If an object_version_number exists but is NOT the same as the current
236 -- g_old_rec value.
237 --
238 -- Developer Implementation Notes:
239 -- None.
240 --
241 -- Access Status:
242 -- Internal Development Use Only.
243 --
244 -- {End Of Comments}
245 -- ----------------------------------------------------------------------------
246 Function api_updating
247 (
248 p_enrt_rt_id in number,
249 p_object_version_number in number
250 ) Return Boolean;
251 --
252 -- ----------------------------------------------------------------------------
253 -- |---------------------------------< lck >----------------------------------|
254 -- ----------------------------------------------------------------------------
255 -- {Start Of Comments}
256 --
257 -- Description:
258 -- The Lck process has two main functions to perform. Firstly, the row to be
259 -- updated or deleted must be locked. The locking of the row will only be
260 -- successful if the row is not currently locked by another user.
261 -- Secondly, during the locking of the row, the row is selected into
262 -- the g_old_rec data structure which enables the current row values from the
263 -- server to be available to the api.
264 --
265 -- Prerequisites:
266 -- When attempting to call the lock the object version number (if defined)
267 -- is mandatory.
268 --
269 -- In Parameters:
270 -- The arguments to the Lck process are the primary key(s) which uniquely
271 -- identify the row and the object version number of row.
272 --
273 -- Post Success:
274 -- On successful completion of the Lck process the row to be updated or
275 -- deleted will be locked and selected into the global data structure
276 -- g_old_rec.
277 --
278 -- Post Failure:
279 -- The Lck process can fail for three reasons:
280 -- 1) When attempting to lock the row the row could already be locked by
281 -- another user. This will raise the HR_Api.Object_Locked exception.
282 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
283 -- This error is trapped and reported using the message name
284 -- 'HR_7220_INVALID_PRIMARY_KEY'.
285 -- 3) The row although existing in the HR Schema has a different object
286 -- version number than the object version number specified.
287 -- This error is trapped and reported using the message name
288 -- 'HR_7155_OBJECT_INVALID'.
289 --
290 -- Developer Implementation Notes:
291 -- For each primary key and the object version number arguments add a
292 -- call to hr_api.mandatory_arg_error procedure to ensure that these
293 -- argument values are not null.
294 --
295 -- Access Status:
296 -- Internal Development Use Only.
297 --
298 -- {End Of Comments}
299 -- ----------------------------------------------------------------------------
300 Procedure lck
301 (
302 p_enrt_rt_id in number,
303 p_object_version_number in number
304 );
305 --
306 -- ----------------------------------------------------------------------------
307 -- |-----------------------------< convert_args >-----------------------------|
308 -- ----------------------------------------------------------------------------
309 -- {Start Of Comments}
310 --
311 -- Description:
312 -- This function is used to turn attribute parameters into the record
313 -- structure parameter g_rec_type.
314 --
315 -- Prerequisites:
316 -- This is a private function and can only be called from the ins or upd
317 -- attribute processes.
318 --
319 -- In Parameters:
320 --
321 -- Post Success:
322 -- A returning record structure will be returned.
323 --
324 -- Post Failure:
325 -- No direct error handling is required within this function. Any possible
326 -- errors within this function will be a PL/SQL value error due to conversion
327 -- of datatypes or data lengths.
328 --
329 -- Developer Implementation Notes:
330 -- None.
331 --
332 -- Access Status:
333 -- Internal Row Handler Use Only.
334 --
335 -- {End Of Comments}
336 -- ----------------------------------------------------------------------------
337 Function convert_args
338 (
339 p_enrt_rt_id in NUMBER,
340 p_ordr_num in number,
341 p_acty_typ_cd in VARCHAR2,
342 p_tx_typ_cd in VARCHAR2,
343 p_ctfn_rqd_flag in VARCHAR2,
344 p_dflt_flag in VARCHAR2,
345 p_dflt_pndg_ctfn_flag in VARCHAR2,
346 p_dsply_on_enrt_flag in VARCHAR2,
347 p_use_to_calc_net_flx_cr_flag in VARCHAR2,
348 p_entr_val_at_enrt_flag in VARCHAR2,
349 p_asn_on_enrt_flag in VARCHAR2,
350 p_rl_crs_only_flag in VARCHAR2,
351 p_dflt_val in NUMBER,
352 p_ann_val in NUMBER,
353 p_ann_mn_elcn_val in NUMBER,
354 p_ann_mx_elcn_val in NUMBER,
355 p_val in NUMBER,
356 p_nnmntry_uom in VARCHAR2,
357 p_mx_elcn_val in NUMBER,
358 p_mn_elcn_val in NUMBER,
359 p_incrmt_elcn_val in NUMBER,
360 p_cmcd_acty_ref_perd_cd in VARCHAR2,
361 p_cmcd_mn_elcn_val in NUMBER,
362 p_cmcd_mx_elcn_val in NUMBER,
363 p_cmcd_val in NUMBER,
364 p_cmcd_dflt_val in NUMBER,
365 p_rt_usg_cd in VARCHAR2,
366 p_ann_dflt_val in NUMBER,
367 p_bnft_rt_typ_cd in VARCHAR2,
371 p_entr_ann_val_flag in VARCHAR2,
368 p_rt_mlt_cd in VARCHAR2,
369 p_dsply_mn_elcn_val in NUMBER,
370 p_dsply_mx_elcn_val in NUMBER,
372 p_rt_strt_dt in DATE,
373 p_rt_strt_dt_cd in VARCHAR2,
374 p_rt_strt_dt_rl in NUMBER,
375 p_rt_typ_cd in VARCHAR2,
376 p_elig_per_elctbl_chc_id in NUMBER,
377 p_acty_base_rt_id in NUMBER,
378 p_spcl_rt_enrt_rt_id in NUMBER,
379 p_enrt_bnft_id in NUMBER,
380 p_prtt_rt_val_id in NUMBER,
381 p_decr_bnft_prvdr_pool_id in NUMBER,
382 p_cvg_amt_calc_mthd_id in NUMBER,
383 p_actl_prem_id in NUMBER,
384 p_comp_lvl_fctr_id in NUMBER,
385 p_ptd_comp_lvl_fctr_id in NUMBER,
386 p_clm_comp_lvl_fctr_id in NUMBER,
387 p_business_group_id in NUMBER,
388 --cwb
389 p_iss_val in number,
390 p_val_last_upd_date in date,
391 p_val_last_upd_person_id in number,
392 --cwb
393 p_pp_in_yr_used_num in number,
394 p_ecr_attribute_category in VARCHAR2,
395 p_ecr_attribute1 in VARCHAR2,
396 p_ecr_attribute2 in VARCHAR2,
397 p_ecr_attribute3 in VARCHAR2,
398 p_ecr_attribute4 in VARCHAR2,
399 p_ecr_attribute5 in VARCHAR2,
400 p_ecr_attribute6 in VARCHAR2,
401 p_ecr_attribute7 in VARCHAR2,
402 p_ecr_attribute8 in VARCHAR2,
403 p_ecr_attribute9 in VARCHAR2,
404 p_ecr_attribute10 in VARCHAR2,
405 p_ecr_attribute11 in VARCHAR2,
406 p_ecr_attribute12 in VARCHAR2,
407 p_ecr_attribute13 in VARCHAR2,
408 p_ecr_attribute14 in VARCHAR2,
409 p_ecr_attribute15 in VARCHAR2,
410 p_ecr_attribute16 in VARCHAR2,
411 p_ecr_attribute17 in VARCHAR2,
412 p_ecr_attribute18 in VARCHAR2,
413 p_ecr_attribute19 in VARCHAR2,
414 p_ecr_attribute20 in VARCHAR2,
415 p_ecr_attribute21 in VARCHAR2,
416 p_ecr_attribute22 in VARCHAR2,
417 p_ecr_attribute23 in VARCHAR2,
418 p_ecr_attribute24 in VARCHAR2,
419 p_ecr_attribute25 in VARCHAR2,
420 p_ecr_attribute26 in VARCHAR2,
421 p_ecr_attribute27 in VARCHAR2,
422 p_ecr_attribute28 in VARCHAR2,
423 p_ecr_attribute29 in VARCHAR2,
424 p_ecr_attribute30 in VARCHAR2,
425 p_last_update_login in NUMBER,
426 p_created_by in NUMBER,
427 p_creation_date in DATE,
428 p_last_updated_by in NUMBER,
429 p_last_update_date in DATE,
430 p_request_id in NUMBER,
431 p_program_application_id in NUMBER,
432 p_program_id in NUMBER,
433 p_program_update_date in DATE,
434 p_object_version_number in NUMBER
435 )
436 Return g_rec_type;
437 --
438 end ben_ecr_shd;