1 Package ben_cpd_shd as
2 /* $Header: becpdrhi.pkh 120.1 2006/01/04 01:45 steotia noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (pl_id number(15)
10 ,lf_evt_ocrd_dt date
11 ,oipl_id number(15)
12 ,effective_date date
13 ,name varchar2(240)
14 ,group_pl_id number(15)
15 ,group_oipl_id number(15)
16 ,opt_hidden_flag varchar2(30)
17 ,opt_id number(15)
18 ,pl_uom varchar2(30)
19 ,pl_ordr_num number(15)
20 ,oipl_ordr_num number(15)
21 ,pl_xchg_rate number
22 ,opt_count number(9) -- Increased length
23 ,uses_bdgt_flag varchar2(30)
24 ,prsrv_bdgt_cd varchar2(30)
25 ,upd_start_dt date
26 ,upd_end_dt date
27 ,approval_mode varchar2(30)
28 ,enrt_perd_start_dt date
29 ,enrt_perd_end_dt date
30 ,yr_perd_start_dt date
31 ,yr_perd_end_dt date
32 ,wthn_yr_start_dt date
33 ,wthn_yr_end_dt date
34 ,enrt_perd_id number(15)
35 ,yr_perd_id number(15)
36 ,business_group_id number(15)
37 ,perf_revw_strt_dt date
38 ,asg_updt_eff_date date
39 ,emp_interview_typ_cd varchar2(30)
40 ,salary_change_reason varchar2(30)
41 ,ws_abr_id number(15)
42 ,ws_nnmntry_uom varchar2(30)
43 ,ws_rndg_cd varchar2(30)
44 ,ws_sub_acty_typ_cd varchar2(30)
45 ,dist_bdgt_abr_id number(15)
46 ,dist_bdgt_nnmntry_uom varchar2(30)
47 ,dist_bdgt_rndg_cd varchar2(30)
48 ,ws_bdgt_abr_id number(15)
49 ,ws_bdgt_nnmntry_uom varchar2(30)
50 ,ws_bdgt_rndg_cd varchar2(30)
51 ,rsrv_abr_id number(15)
52 ,rsrv_nnmntry_uom varchar2(30)
53 ,rsrv_rndg_cd varchar2(30)
54 ,elig_sal_abr_id number(15)
55 ,elig_sal_nnmntry_uom varchar2(30)
56 ,elig_sal_rndg_cd varchar2(30)
57 ,misc1_abr_id number(15)
58 ,misc1_nnmntry_uom varchar2(30)
59 ,misc1_rndg_cd varchar2(30)
60 ,misc2_abr_id number(15)
61 ,misc2_nnmntry_uom varchar2(30)
62 ,misc2_rndg_cd varchar2(30)
63 ,misc3_abr_id number(15)
64 ,misc3_nnmntry_uom varchar2(30)
65 ,misc3_rndg_cd varchar2(30)
66 ,stat_sal_abr_id number(15)
67 ,stat_sal_nnmntry_uom varchar2(30)
68 ,stat_sal_rndg_cd varchar2(30)
69 ,rec_abr_id number(15)
70 ,rec_nnmntry_uom varchar2(30)
71 ,rec_rndg_cd varchar2(30)
72 ,tot_comp_abr_id number(15)
73 ,tot_comp_nnmntry_uom varchar2(30)
74 ,tot_comp_rndg_cd varchar2(30)
75 ,oth_comp_abr_id number(15)
76 ,oth_comp_nnmntry_uom varchar2(30)
77 ,oth_comp_rndg_cd varchar2(30)
78 ,actual_flag varchar2(30)
79 ,acty_ref_perd_cd varchar2(30)
80 ,legislation_code varchar2(30)
81 ,pl_annulization_factor number
82 ,pl_stat_cd varchar2(30)
83 ,uom_precision number
84 ,ws_element_type_id number(15)
85 ,ws_input_value_id number(15)
86 ,data_freeze_date date
87 ,ws_amt_edit_cd varchar2(30)
88 ,ws_amt_edit_enf_cd_for_nulls varchar2(30)
89 ,ws_over_budget_edit_cd varchar2(30)
90 ,ws_over_budget_tolerance_pct number
91 ,bdgt_over_budget_edit_cd varchar2(30)
92 ,bdgt_over_budget_tolerance_pct number
93 ,auto_distr_flag varchar2(30)
94 ,pqh_document_short_name varchar2(30)
95 ,ovrid_rt_strt_dt date
96 ,do_not_process_flag varchar2(30)
97 ,ovr_perf_revw_strt_dt date
98 ,object_version_number number(9)
99 );
100 --
101 -- ----------------------------------------------------------------------------
102 -- | Global Definitions - Internal Development Use Only |
103 -- ----------------------------------------------------------------------------
104 --
105 g_old_rec g_rec_type; -- Global record definition
106 -- Global table name
107 g_tab_nam constant varchar2(30) := 'BEN_CWB_PL_DSGN';
108 g_api_dml boolean; -- Global api dml status
109 --
110 -- ----------------------------------------------------------------------------
111 -- |------------------------< return_api_dml_status >-------------------------|
112 -- ----------------------------------------------------------------------------
113 -- {Start Of Comments}
114 --
115 -- Description:
116 -- This function will return the current g_api_dml private global
117 -- boolean status.
118 -- The g_api_dml status determines if at the time of the function
119 -- being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
120 -- is being issued from within an api.
121 -- If the status is TRUE then a dml statement is being issued from
122 -- within this entity api.
123 -- This function is primarily to support database triggers which
124 -- need to maintain the object_version_number for non-supported
125 -- dml statements (i.e. dml statement issued outside of the api layer).
126 --
127 -- Prerequisites:
128 -- None.
129 --
130 -- In Parameters:
131 -- None.
132 --
133 -- Post Success:
134 -- Processing continues.
135 -- If the function returns a TRUE value then, dml is being executed from
136 -- within this api.
137 --
138 -- Post Failure:
139 -- None.
140 --
141 -- Access Status:
142 -- Internal Row Handler Use Only.
143 --
144 -- {End Of Comments}
145 -- ----------------------------------------------------------------------------
146 Function return_api_dml_status Return Boolean;
147 --
148 -- ----------------------------------------------------------------------------
149 -- |---------------------------< constraint_error >---------------------------|
150 -- ----------------------------------------------------------------------------
151 -- {Start Of Comments}
152 --
153 -- Description:
154 -- This procedure is called when a constraint has been violated (i.e.
155 -- The exception 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).
158 -- The exceptions can only be raised as follows:
159 -- 1) A check constraint can only be violated during an INSERT or UPDATE
160 -- dml operation.
161 -- 2) A parent integrity constraint can only be violated during an
162 -- INSERT or UPDATE dml operation.
163 -- 3) A child integrity constraint can only be violated during an
164 -- DELETE dml operation.
165 -- 4) A unique integrity constraint can only be violated during INSERT or
166 -- UPDATE dml operation.
167 --
168 -- Prerequisites:
169 -- 1) Either hr_api.check_integrity_violated,
170 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
171 -- hr_api.unique_integrity_violated has been raised with the subsequent
172 -- stripping of the constraint name from the generated error message
173 -- text.
174 -- 2) Standalone validation test which corresponds with a constraint error.
175 --
176 -- In Parameter:
177 -- p_constraint_name is in upper format and is just the constraint name
178 -- (e.g. not prefixed by brackets, schema owner etc).
179 --
180 -- Post Success:
181 -- Development dependant.
182 --
183 -- Post Failure:
184 -- Developement dependant.
185 --
186 -- Developer Implementation Notes:
187 -- For each constraint being checked the hr system package failure message
188 -- has been generated as a template only. These system error messages should
189 -- be modified as required (i.e. change the system failure message to a user
190 -- friendly defined error message).
191 --
192 -- Access Status:
193 -- Internal Development Use Only.
194 --
195 -- {End Of Comments}
196 -- ----------------------------------------------------------------------------
197 Procedure constraint_error
198 (p_constraint_name in all_constraints.constraint_name%TYPE);
199 --
200 -- ----------------------------------------------------------------------------
201 -- |-----------------------------< api_updating >-----------------------------|
202 -- ----------------------------------------------------------------------------
203 -- {Start Of Comments}
204 --
205 -- Description:
206 -- This function is used to populate the g_old_rec record with the
207 -- current row from the database for the specified primary key
208 -- provided that the primary key exists and is valid and does not
209 -- already match the current g_old_rec. The function will always return
210 -- a TRUE value if the g_old_rec is populated with the current row.
211 -- A FALSE value will be returned if all of the primary key arguments
212 -- are null.
213 --
214 -- Prerequisites:
215 -- None.
216 --
217 -- In Parameters:
218 --
219 -- Post Success:
220 -- A value of TRUE will be returned indiciating that the g_old_rec
221 -- is current.
222 -- A value of FALSE will be returned if all of the primary key arguments
223 -- have a null value (this indicates that the row has not be inserted into
224 -- the Schema), and therefore could never have a corresponding row.
225 --
226 -- Post Failure:
227 -- A failure can only occur under two circumstances:
228 -- 1) The primary key is invalid (i.e. a row does not exist for the
229 -- specified primary key values).
230 -- 2) If an object_version_number exists but is NOT the same as the current
231 -- g_old_rec value.
232 --
233 -- Developer Implementation Notes:
234 -- None.
235 --
236 -- Access Status:
237 -- Internal Development Use Only.
238 --
239 -- {End Of Comments}
240 -- ----------------------------------------------------------------------------
241 Function api_updating
242 (p_pl_id in number
243 ,p_lf_evt_ocrd_dt in date
244 ,p_oipl_id in number
245 ,p_object_version_number in number
246 ) Return Boolean;
247 --
248 -- ----------------------------------------------------------------------------
249 -- |---------------------------------< lck >----------------------------------|
250 -- ----------------------------------------------------------------------------
251 -- {Start of comments}
252 --
253 -- Description:
254 -- The Lck process has two main functions to perform. Firstly, the row to be
255 -- updated or deleted must be locked. The locking of the row will only be
256 -- successful if the row is not currently locked by another user.
257 -- Secondly, during the locking of the row, the row is selected into
258 -- the g_old_rec data structure which enables the current row values from
259 -- the server to be available to the api.
260 --
261 -- Prerequisites:
262 -- When attempting to call the lock the object version number (if defined)
263 -- is mandatory.
264 --
265 -- In Parameters:
266 -- The arguments to the Lck process are the primary key(s) which uniquely
270 -- On successful completion of the Lck process the row to be updated or
267 -- identify the row and the object version number of row.
268 --
269 -- Post Success:
271 -- deleted will be locked and selected into the global data structure
272 -- g_old_rec.
273 --
274 -- Post Failure:
275 -- The Lck process can fail for three reasons:
276 -- 1) When attempting to lock the row the row could already be locked by
277 -- another user. This will raise the HR_Api.Object_Locked exception.
278 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
279 -- This error is trapped and reported using the message name
280 -- 'HR_7220_INVALID_PRIMARY_KEY'.
281 -- 3) The row although existing in the HR Schema has a different object
282 -- version number than the object version number specified.
283 -- This error is trapped and reported using the message name
284 -- 'HR_7155_OBJECT_INVALID'.
285 --
286 -- Developer Implementation Notes:
287 -- For each primary key and the object version number arguments add a
288 -- call to hr_api.mandatory_arg_error procedure to ensure that these
289 -- argument values are not null.
290 --
291 -- Access Status:
292 -- Internal Development Use Only.
293 --
294 -- {End of comments}
295 -- ----------------------------------------------------------------------------
296 Procedure lck
297 (p_pl_id in number
298 ,p_lf_evt_ocrd_dt in date
299 ,p_oipl_id in number
300 ,p_object_version_number in number
301 );
302 --
303 -- ----------------------------------------------------------------------------
304 -- |-----------------------------< convert_args >-----------------------------|
305 -- ----------------------------------------------------------------------------
306 -- {Start Of Comments}
307 --
308 -- Description:
309 -- This function is used to turn attribute parameters into the record
310 -- structure parameter g_rec_type.
311 --
312 -- Prerequisites:
313 -- This is a private function and can only be called from the ins or upd
314 -- attribute processes.
315 --
316 -- In Parameters:
317 --
318 -- Post Success:
319 -- A returning record structure will be returned.
320 --
321 -- Post Failure:
322 -- No direct error handling is required within this function. Any possible
323 -- errors within this function will be a PL/SQL value error due to
324 -- conversion of datatypes or data lengths.
325 --
326 -- Developer Implementation Notes:
327 -- None.
328 --
329 -- Access Status:
330 -- Internal Row Handler Use Only.
331 --
332 -- {End Of Comments}
333 -- ----------------------------------------------------------------------------
334 Function convert_args
335 (p_pl_id in number
336 ,p_oipl_id in number
337 ,p_lf_evt_ocrd_dt in date
338 ,p_effective_date in date
339 ,p_name in varchar2
340 ,p_group_pl_id in number
341 ,p_group_oipl_id in number
342 ,p_opt_hidden_flag in varchar2
343 ,p_opt_id in number
344 ,p_pl_uom in varchar2
345 ,p_pl_ordr_num in number
346 ,p_oipl_ordr_num in number
347 ,p_pl_xchg_rate in number
348 ,p_opt_count in number
349 ,p_uses_bdgt_flag in varchar2
350 ,p_prsrv_bdgt_cd in varchar2
351 ,p_upd_start_dt in date
352 ,p_upd_end_dt in date
353 ,p_approval_mode in varchar2
354 ,p_enrt_perd_start_dt in date
355 ,p_enrt_perd_end_dt in date
356 ,p_yr_perd_start_dt in date
357 ,p_yr_perd_end_dt in date
358 ,p_wthn_yr_start_dt in date
359 ,p_wthn_yr_end_dt in date
360 ,p_enrt_perd_id in number
361 ,p_yr_perd_id in number
362 ,p_business_group_id in number
363 ,p_perf_revw_strt_dt in date
364 ,p_asg_updt_eff_date in date
368 ,p_ws_nnmntry_uom in varchar2
365 ,p_emp_interview_typ_cd in varchar2
366 ,p_salary_change_reason in varchar2
367 ,p_ws_abr_id in number
369 ,p_ws_rndg_cd in varchar2
370 ,p_ws_sub_acty_typ_cd in varchar2
371 ,p_dist_bdgt_abr_id in number
372 ,p_dist_bdgt_nnmntry_uom in varchar2
373 ,p_dist_bdgt_rndg_cd in varchar2
374 ,p_ws_bdgt_abr_id in number
375 ,p_ws_bdgt_nnmntry_uom in varchar2
376 ,p_ws_bdgt_rndg_cd in varchar2
377 ,p_rsrv_abr_id in number
378 ,p_rsrv_nnmntry_uom in varchar2
379 ,p_rsrv_rndg_cd in varchar2
380 ,p_elig_sal_abr_id in number
381 ,p_elig_sal_nnmntry_uom in varchar2
382 ,p_elig_sal_rndg_cd in varchar2
383 ,p_misc1_abr_id in number
384 ,p_misc1_nnmntry_uom in varchar2
385 ,p_misc1_rndg_cd in varchar2
386 ,p_misc2_abr_id in number
387 ,p_misc2_nnmntry_uom in varchar2
388 ,p_misc2_rndg_cd in varchar2
389 ,p_misc3_abr_id in number
390 ,p_misc3_nnmntry_uom in varchar2
391 ,p_misc3_rndg_cd in varchar2
392 ,p_stat_sal_abr_id in number
393 ,p_stat_sal_nnmntry_uom in varchar2
394 ,p_stat_sal_rndg_cd in varchar2
395 ,p_rec_abr_id in number
396 ,p_rec_nnmntry_uom in varchar2
397 ,p_rec_rndg_cd in varchar2
398 ,p_tot_comp_abr_id in number
399 ,p_tot_comp_nnmntry_uom in varchar2
400 ,p_tot_comp_rndg_cd in varchar2
401 ,p_oth_comp_abr_id in number
402 ,p_oth_comp_nnmntry_uom in varchar2
403 ,p_oth_comp_rndg_cd in varchar2
404 ,p_actual_flag in varchar2
405 ,p_acty_ref_perd_cd in varchar2
406 ,p_legislation_code in varchar2
407 ,p_pl_annulization_factor in number
408 ,p_pl_stat_cd in varchar2
409 ,p_uom_precision in number
410 ,p_ws_element_type_id in number
411 ,p_ws_input_value_id in number
412 ,p_data_freeze_date in date
413 ,p_ws_amt_edit_cd in varchar2
414 ,p_ws_amt_edit_enf_cd_for_nul in varchar2
415 ,p_ws_over_budget_edit_cd in varchar2
416 ,p_ws_over_budget_tol_pct in number
417 ,p_bdgt_over_budget_edit_cd in varchar2
418 ,p_bdgt_over_budget_tol_pct in number
419 ,p_auto_distr_flag in varchar2
420 ,p_pqh_document_short_name in varchar2
421 ,p_ovrid_rt_strt_dt in date
422 ,p_do_not_process_flag in varchar2
423 ,p_ovr_perf_revw_strt_dt in date
424 ,p_object_version_number in number
425 )
426 Return g_rec_type;
427 --
428 end ben_cpd_shd;