1 Package ben_ecc_shd AUTHID CURRENT_USER as
2 /* $Header: beeccrhi.pkh 120.0 2005/05/28 01:49:11 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (
10 elctbl_chc_ctfn_id number(15),
11 enrt_ctfn_typ_cd varchar2(30),
12 rqd_flag varchar2(30),
13 elig_per_elctbl_chc_id number(15),
14 enrt_bnft_id number(15),
15 business_group_id number(15),
16 ecc_attribute_category varchar2(30),
17 ecc_attribute1 varchar2(150),
18 ecc_attribute2 varchar2(150),
19 ecc_attribute3 varchar2(150),
20 ecc_attribute4 varchar2(150),
21 ecc_attribute5 varchar2(150),
22 ecc_attribute6 varchar2(150),
23 ecc_attribute7 varchar2(150),
24 ecc_attribute8 varchar2(150),
25 ecc_attribute9 varchar2(150),
26 ecc_attribute10 varchar2(150),
27 ecc_attribute11 varchar2(150),
28 ecc_attribute12 varchar2(150),
29 ecc_attribute13 varchar2(150),
30 ecc_attribute14 varchar2(150),
31 ecc_attribute15 varchar2(150),
32 ecc_attribute16 varchar2(150),
33 ecc_attribute17 varchar2(150),
34 ecc_attribute18 varchar2(150),
35 ecc_attribute19 varchar2(150),
36 ecc_attribute20 varchar2(150),
37 ecc_attribute21 varchar2(150),
38 ecc_attribute22 varchar2(150),
39 ecc_attribute23 varchar2(150),
40 ecc_attribute24 varchar2(150),
41 ecc_attribute25 varchar2(150),
42 ecc_attribute26 varchar2(150),
43 ecc_attribute27 varchar2(150),
44 ecc_attribute28 varchar2(150),
45 ecc_attribute29 varchar2(150),
46 ecc_attribute30 varchar2(150),
47 susp_if_ctfn_not_prvd_flag varchar2(30),
48 ctfn_determine_cd varchar2(30),
49 request_id number(15),
50 program_application_id number(15),
51 program_id number(15),
52 program_update_date date,
53 object_version_number number(9)
54 );
55 --
56 -- ----------------------------------------------------------------------------
57 -- | Global Definitions - Internal Development Use Only |
58 -- ----------------------------------------------------------------------------
59 --
60 g_old_rec g_rec_type; -- Global record definition
61 g_api_dml boolean; -- Global api dml status
62 --
63 -- ----------------------------------------------------------------------------
64 -- |------------------------< return_api_dml_status >-------------------------|
65 -- ----------------------------------------------------------------------------
66 -- {Start Of Comments}
67 --
68 -- Description:
69 -- This function will return the current g_api_dml private global
70 -- boolean status.
71 -- The g_api_dml status determines if at the time of the function
72 -- being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
73 -- is being issued from within an api.
74 -- If the status is TRUE then a dml statement is being issued from
75 -- within this entity api.
76 -- This function is primarily to support database triggers which
77 -- need to maintain the object_version_number for non-supported
78 -- dml statements (i.e. dml statement issued outside of the api layer).
79 --
80 -- Prerequisites:
81 -- None.
82 --
83 -- In Parameters:
84 -- None.
85 --
86 -- Post Success:
87 -- Processing continues.
88 -- If the function returns a TRUE value then, dml is being executed from
89 -- within this api.
90 --
91 -- Post Failure:
92 -- None.
93 --
94 -- Access Status:
95 -- Internal Row Handler Use Only.
96 --
97 -- {End Of Comments}
98 -- ----------------------------------------------------------------------------
99 Function return_api_dml_status Return Boolean;
100 --
101 -- ----------------------------------------------------------------------------
102 -- |---------------------------< constraint_error >---------------------------|
103 -- ----------------------------------------------------------------------------
104 -- {Start Of Comments}
105 --
106 -- Description:
107 -- This procedure is called when a constraint has been violated (i.e.
108 -- The exception hr_api.check_integrity_violated,
109 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
110 -- hr_api.unique_integrity_violated has been raised).
111 -- The exceptions can only be raised as follows:
112 -- 1) A check constraint can only be violated during an INSERT or UPDATE
113 -- dml operation.
114 -- 2) A parent integrity constraint can only be violated during an
115 -- INSERT or UPDATE dml operation.
116 -- 3) A child integrity constraint can only be violated during an
117 -- DELETE dml operation.
118 -- 4) A unique integrity constraint can only be violated during INSERT or
119 -- UPDATE dml operation.
120 --
121 -- Prerequisites:
122 -- 1) Either hr_api.check_integrity_violated,
123 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
124 -- hr_api.unique_integrity_violated has been raised with the subsequent
125 -- stripping of the constraint name from the generated error message
126 -- text.
127 -- 2) Standalone validation test which corresponds with a constraint error.
128 --
129 -- In Parameter:
130 -- p_constraint_name is in upper format and is just the constraint name
131 -- (e.g. not prefixed by brackets, schema owner etc).
132 --
133 -- Post Success:
134 -- Development dependant.
135 --
136 -- Post Failure:
137 -- Developement dependant.
138 --
139 -- Developer Implementation Notes:
140 -- For each constraint being checked the hr system package failure message
141 -- has been generated as a template only. These system error messages should
142 -- be modified as required (i.e. change the system failure message to a user
143 -- friendly defined error message).
144 --
145 -- Access Status:
146 -- Internal Development Use Only.
147 --
148 -- {End Of Comments}
149 -- ----------------------------------------------------------------------------
150 Procedure constraint_error
151 (p_constraint_name in all_constraints.constraint_name%TYPE);
152 --
153 -- ----------------------------------------------------------------------------
154 -- |-----------------------------< api_updating >-----------------------------|
155 -- ----------------------------------------------------------------------------
156 -- {Start Of Comments}
157 --
158 -- Description:
159 -- This function is used to populate the g_old_rec record with the
160 -- current row from the database for the specified primary key
161 -- provided that the primary key exists and is valid and does not
162 -- already match the current g_old_rec. The function will always return
163 -- a TRUE value if the g_old_rec is populated with the current row.
164 -- A FALSE value will be returned if all of the primary key arguments
165 -- are null.
166 --
167 -- Prerequisites:
168 -- None.
169 --
170 -- In Parameters:
171 --
172 -- Post Success:
173 -- A value of TRUE will be returned indiciating that the g_old_rec
174 -- is current.
175 -- A value of FALSE will be returned if all of the primary key arguments
176 -- have a null value (this indicates that the row has not be inserted into
177 -- the Schema), and therefore could never have a corresponding row.
178 --
179 -- Post Failure:
180 -- A failure can only occur under two circumstances:
181 -- 1) The primary key is invalid (i.e. a row does not exist for the
182 -- specified primary key values).
183 -- 2) If an object_version_number exists but is NOT the same as the current
184 -- g_old_rec value.
185 --
186 -- Developer Implementation Notes:
187 -- None.
188 --
189 -- Access Status:
190 -- Internal Development Use Only.
191 --
192 -- {End Of Comments}
193 -- ----------------------------------------------------------------------------
194 Function api_updating
195 (
196 p_elctbl_chc_ctfn_id in number,
197 p_object_version_number in number
198 ) Return Boolean;
199 --
200 -- ----------------------------------------------------------------------------
201 -- |---------------------------------< lck >----------------------------------|
202 -- ----------------------------------------------------------------------------
203 -- {Start Of Comments}
204 --
205 -- Description:
206 -- The Lck process has two main functions to perform. Firstly, the row to be
207 -- updated or deleted must be locked. The locking of the row will only be
208 -- successful if the row is not currently locked by another user.
209 -- Secondly, during the locking of the row, the row is selected into
210 -- the g_old_rec data structure which enables the current row values from the
211 -- server to be available to the api.
212 --
213 -- Prerequisites:
214 -- When attempting to call the lock the object version number (if defined)
215 -- is mandatory.
216 --
217 -- In Parameters:
218 -- The arguments to the Lck process are the primary key(s) which uniquely
219 -- identify the row and the object version number of row.
220 --
221 -- Post Success:
222 -- On successful completion of the Lck process the row to be updated or
223 -- deleted will be locked and selected into the global data structure
224 -- g_old_rec.
225 --
226 -- Post Failure:
227 -- The Lck process can fail for three reasons:
228 -- 1) When attempting to lock the row the row could already be locked by
229 -- another user. This will raise the HR_Api.Object_Locked exception.
230 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
231 -- This error is trapped and reported using the message name
232 -- 'HR_7220_INVALID_PRIMARY_KEY'.
233 -- 3) The row although existing in the HR Schema has a different object
234 -- version number than the object version number specified.
235 -- This error is trapped and reported using the message name
236 -- 'HR_7155_OBJECT_INVALID'.
237 --
238 -- Developer Implementation Notes:
239 -- For each primary key and the object version number arguments add a
240 -- call to hr_api.mandatory_arg_error procedure to ensure that these
241 -- argument values are not null.
242 --
243 -- Access Status:
244 -- Internal Development Use Only.
245 --
246 -- {End Of Comments}
247 -- ----------------------------------------------------------------------------
248 Procedure lck
249 (
250 p_elctbl_chc_ctfn_id in number,
251 p_object_version_number in number
252 );
253 --
254 -- ----------------------------------------------------------------------------
255 -- |-----------------------------< convert_args >-----------------------------|
256 -- ----------------------------------------------------------------------------
257 -- {Start Of Comments}
258 --
259 -- Description:
260 -- This function is used to turn attribute parameters into the record
261 -- structure parameter g_rec_type.
262 --
263 -- Prerequisites:
264 -- This is a private function and can only be called from the ins or upd
265 -- attribute processes.
266 --
267 -- In Parameters:
268 --
269 -- Post Success:
270 -- A returning record structure will be returned.
271 --
272 -- Post Failure:
273 -- No direct error handling is required within this function. Any possible
274 -- errors within this function will be a PL/SQL value error due to conversion
275 -- of datatypes or data lengths.
276 --
277 -- Developer Implementation Notes:
278 -- None.
279 --
280 -- Access Status:
281 -- Internal Row Handler Use Only.
282 --
283 -- {End Of Comments}
284 -- ----------------------------------------------------------------------------
285 Function convert_args
286 (
287 p_elctbl_chc_ctfn_id in number,
288 p_enrt_ctfn_typ_cd in varchar2,
289 p_rqd_flag in varchar2,
290 p_elig_per_elctbl_chc_id in number,
291 p_enrt_bnft_id in number,
292 p_business_group_id in number,
293 p_ecc_attribute_category in varchar2,
294 p_ecc_attribute1 in varchar2,
295 p_ecc_attribute2 in varchar2,
296 p_ecc_attribute3 in varchar2,
297 p_ecc_attribute4 in varchar2,
298 p_ecc_attribute5 in varchar2,
299 p_ecc_attribute6 in varchar2,
300 p_ecc_attribute7 in varchar2,
301 p_ecc_attribute8 in varchar2,
302 p_ecc_attribute9 in varchar2,
303 p_ecc_attribute10 in varchar2,
304 p_ecc_attribute11 in varchar2,
305 p_ecc_attribute12 in varchar2,
306 p_ecc_attribute13 in varchar2,
307 p_ecc_attribute14 in varchar2,
308 p_ecc_attribute15 in varchar2,
309 p_ecc_attribute16 in varchar2,
310 p_ecc_attribute17 in varchar2,
311 p_ecc_attribute18 in varchar2,
312 p_ecc_attribute19 in varchar2,
313 p_ecc_attribute20 in varchar2,
314 p_ecc_attribute21 in varchar2,
315 p_ecc_attribute22 in varchar2,
316 p_ecc_attribute23 in varchar2,
317 p_ecc_attribute24 in varchar2,
318 p_ecc_attribute25 in varchar2,
319 p_ecc_attribute26 in varchar2,
320 p_ecc_attribute27 in varchar2,
321 p_ecc_attribute28 in varchar2,
322 p_ecc_attribute29 in varchar2,
323 p_ecc_attribute30 in varchar2,
324 p_susp_if_ctfn_not_prvd_flag in varchar2,
325 p_ctfn_determine_cd in varchar2,
326 p_request_id in number,
327 p_program_application_id in number,
328 p_program_id in number,
329 p_program_update_date in date,
330 p_object_version_number in number
331 )
332 Return g_rec_type;
333 --
334 end ben_ecc_shd;