1 Package ben_lsf_shd as
2 /* $Header: belsfrhi.pkh 120.0 2005/05/28 03:37:54 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (
10 los_fctr_id number(15),
11 name varchar2(240),
12 business_group_id number(15),
13 los_det_cd varchar2(30),
14 los_det_rl number(15),
15 mn_los_num number,
16 mx_los_num number,
17 no_mx_los_num_apls_flag varchar2(30),
18 no_mn_los_num_apls_flag varchar2(30),
19 rndg_cd varchar2(30),
20 rndg_rl number(15),
21 los_dt_to_use_cd varchar2(30),
22 los_dt_to_use_rl number(15),
23 los_uom varchar2(30),
24 los_calc_rl number(15),
25 los_alt_val_to_use_cd varchar2(30),
26 lsf_attribute_category varchar2(30),
27 lsf_attribute1 varchar2(150),
28 lsf_attribute2 varchar2(150),
29 lsf_attribute3 varchar2(150),
30 lsf_attribute4 varchar2(150),
31 lsf_attribute5 varchar2(150),
32 lsf_attribute6 varchar2(150),
33 lsf_attribute7 varchar2(150),
34 lsf_attribute8 varchar2(150),
35 lsf_attribute9 varchar2(150),
36 lsf_attribute10 varchar2(150),
37 lsf_attribute11 varchar2(150),
38 lsf_attribute12 varchar2(150),
39 lsf_attribute13 varchar2(150),
40 lsf_attribute14 varchar2(150),
41 lsf_attribute15 varchar2(150),
42 lsf_attribute16 varchar2(150),
43 lsf_attribute17 varchar2(150),
44 lsf_attribute18 varchar2(150),
45 lsf_attribute19 varchar2(150),
46 lsf_attribute20 varchar2(150),
47 lsf_attribute21 varchar2(150),
48 lsf_attribute22 varchar2(150),
49 lsf_attribute23 varchar2(150),
50 lsf_attribute24 varchar2(150),
51 lsf_attribute25 varchar2(150),
52 lsf_attribute26 varchar2(150),
53 lsf_attribute27 varchar2(150),
54 lsf_attribute28 varchar2(150),
55 lsf_attribute29 varchar2(150),
56 lsf_attribute30 varchar2(150),
57 object_version_number number(9),
58 use_overid_svc_dt_flag varchar2(30)
59 );
60 --
61 -- ----------------------------------------------------------------------------
62 -- | Global Definitions - Internal Development Use Only |
63 -- ----------------------------------------------------------------------------
64 --
65 g_old_rec g_rec_type; -- Global record definition
66 g_api_dml boolean; -- Global api dml status
67 --
68 -- ----------------------------------------------------------------------------
69 -- |------------------------< return_api_dml_status >-------------------------|
70 -- ----------------------------------------------------------------------------
71 -- {Start Of Comments}
72 --
73 -- Description:
74 -- This function will return the current g_api_dml private global
75 -- boolean status.
76 -- The g_api_dml status determines if at the time of the function
77 -- being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
78 -- is being issued from within an api.
79 -- If the status is TRUE then a dml statement is being issued from
80 -- within this entity api.
81 -- This function is primarily to support database triggers which
82 -- need to maintain the object_version_number for non-supported
83 -- dml statements (i.e. dml statement issued outside of the api layer).
84 --
85 -- Prerequisites:
86 -- None.
87 --
88 -- In Parameters:
89 -- None.
90 --
91 -- Post Success:
92 -- Processing continues.
93 -- If the function returns a TRUE value then, dml is being executed from
94 -- within this api.
95 --
96 -- Post Failure:
97 -- None.
98 --
99 -- Access Status:
100 -- Internal Row Handler Use Only.
101 --
102 -- {End Of Comments}
103 -- ----------------------------------------------------------------------------
104 Function return_api_dml_status Return Boolean;
105 --
106 -- ----------------------------------------------------------------------------
107 -- |---------------------------< constraint_error >---------------------------|
108 -- ----------------------------------------------------------------------------
109 -- {Start Of Comments}
110 --
111 -- Description:
112 -- This procedure is called when a constraint has been violated (i.e.
113 -- The exception hr_api.check_integrity_violated,
114 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
115 -- hr_api.unique_integrity_violated has been raised).
116 -- The exceptions can only be raised as follows:
117 -- 1) A check constraint can only be violated during an INSERT or UPDATE
118 -- dml operation.
119 -- 2) A parent integrity constraint can only be violated during an
120 -- INSERT or UPDATE dml operation.
121 -- 3) A child integrity constraint can only be violated during an
122 -- DELETE dml operation.
123 -- 4) A unique integrity constraint can only be violated during INSERT or
124 -- UPDATE dml operation.
125 --
126 -- Prerequisites:
127 -- 1) Either hr_api.check_integrity_violated,
128 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
129 -- hr_api.unique_integrity_violated has been raised with the subsequent
130 -- stripping of the constraint name from the generated error message
131 -- text.
132 -- 2) Standalone validation test which corresponds with a constraint error.
133 --
134 -- In Parameter:
135 -- p_constraint_name is in upper format and is just the constraint name
136 -- (e.g. not prefixed by brackets, schema owner etc).
137 --
138 -- Post Success:
139 -- Development dependant.
140 --
141 -- Post Failure:
142 -- Developement dependant.
143 --
144 -- Developer Implementation Notes:
145 -- For each constraint being checked the hr system package failure message
146 -- has been generated as a template only. These system error messages should
147 -- be modified as required (i.e. change the system failure message to a user
148 -- friendly defined error message).
149 --
150 -- Access Status:
151 -- Internal Development Use Only.
152 --
153 -- {End Of Comments}
154 -- ----------------------------------------------------------------------------
155 Procedure constraint_error
156 (p_constraint_name in all_constraints.constraint_name%TYPE);
157 --
158 -- ----------------------------------------------------------------------------
159 -- |-----------------------------< api_updating >-----------------------------|
160 -- ----------------------------------------------------------------------------
161 -- {Start Of Comments}
162 --
163 -- Description:
164 -- This function is used to populate the g_old_rec record with the
165 -- current row from the database for the specified primary key
166 -- provided that the primary key exists and is valid and does not
167 -- already match the current g_old_rec. The function will always return
168 -- a TRUE value if the g_old_rec is populated with the current row.
169 -- A FALSE value will be returned if all of the primary key arguments
170 -- are null.
171 --
172 -- Prerequisites:
173 -- None.
174 --
175 -- In Parameters:
176 --
177 -- Post Success:
178 -- A value of TRUE will be returned indiciating that the g_old_rec
179 -- is current.
180 -- A value of FALSE will be returned if all of the primary key arguments
181 -- have a null value (this indicates that the row has not be inserted into
182 -- the Schema), and therefore could never have a corresponding row.
183 --
184 -- Post Failure:
185 -- A failure can only occur under two circumstances:
186 -- 1) The primary key is invalid (i.e. a row does not exist for the
187 -- specified primary key values).
188 -- 2) If an object_version_number exists but is NOT the same as the current
189 -- g_old_rec value.
190 --
191 -- Developer Implementation Notes:
192 -- None.
193 --
194 -- Access Status:
195 -- Internal Development Use Only.
196 --
197 -- {End Of Comments}
198 -- ----------------------------------------------------------------------------
199 Function api_updating
200 (
201 p_los_fctr_id in number,
202 p_object_version_number in number
203 ) Return Boolean;
204 --
205 -- ----------------------------------------------------------------------------
206 -- |---------------------------------< lck >----------------------------------|
207 -- ----------------------------------------------------------------------------
208 -- {Start Of Comments}
209 --
210 -- Description:
211 -- The Lck process has two main functions to perform. Firstly, the row to be
212 -- updated or deleted must be locked. The locking of the row will only be
213 -- successful if the row is not currently locked by another user.
214 -- Secondly, during the locking of the row, the row is selected into
215 -- the g_old_rec data structure which enables the current row values from the
216 -- server to be available to the api.
217 --
218 -- Prerequisites:
219 -- When attempting to call the lock the object version number (if defined)
220 -- is mandatory.
221 --
222 -- In Parameters:
223 -- The arguments to the Lck process are the primary key(s) which uniquely
224 -- identify the row and the object version number of row.
225 --
226 -- Post Success:
227 -- On successful completion of the Lck process the row to be updated or
228 -- deleted will be locked and selected into the global data structure
229 -- g_old_rec.
230 --
231 -- Post Failure:
232 -- The Lck process can fail for three reasons:
233 -- 1) When attempting to lock the row the row could already be locked by
234 -- another user. This will raise the HR_Api.Object_Locked exception.
235 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
236 -- This error is trapped and reported using the message name
237 -- 'HR_7220_INVALID_PRIMARY_KEY'.
238 -- 3) The row although existing in the HR Schema has a different object
239 -- version number than the object version number specified.
240 -- This error is trapped and reported using the message name
241 -- 'HR_7155_OBJECT_INVALID'.
242 --
243 -- Developer Implementation Notes:
244 -- For each primary key and the object version number arguments add a
245 -- call to hr_api.mandatory_arg_error procedure to ensure that these
246 -- argument values are not null.
247 --
248 -- Access Status:
249 -- Internal Development Use Only.
250 --
251 -- {End Of Comments}
252 -- ----------------------------------------------------------------------------
253 Procedure lck
254 (
255 p_los_fctr_id in number,
256 p_object_version_number in number
257 );
258 --
259 -- ----------------------------------------------------------------------------
260 -- |-----------------------------< convert_args >-----------------------------|
261 -- ----------------------------------------------------------------------------
262 -- {Start Of Comments}
263 --
264 -- Description:
265 -- This function is used to turn attribute parameters into the record
266 -- structure parameter g_rec_type.
267 --
268 -- Prerequisites:
269 -- This is a private function and can only be called from the ins or upd
270 -- attribute processes.
271 --
272 -- In Parameters:
273 --
274 -- Post Success:
275 -- A returning record structure will be returned.
276 --
277 -- Post Failure:
278 -- No direct error handling is required within this function. Any possible
279 -- errors within this function will be a PL/SQL value error due to conversion
280 -- of datatypes or data lengths.
281 --
282 -- Developer Implementation Notes:
283 -- None.
284 --
285 -- Access Status:
286 -- Internal Row Handler Use Only.
287 --
288 -- {End Of Comments}
289 -- ----------------------------------------------------------------------------
290 Function convert_args
291 (
292 p_los_fctr_id in number,
293 p_name in varchar2,
294 p_business_group_id in number,
295 p_los_det_cd in varchar2,
296 p_los_det_rl in number,
297 p_mn_los_num in number,
298 p_mx_los_num in number,
299 p_no_mx_los_num_apls_flag in varchar2,
300 p_no_mn_los_num_apls_flag in varchar2,
301 p_rndg_cd in varchar2,
302 p_rndg_rl in number,
303 p_los_dt_to_use_cd in varchar2,
304 p_los_dt_to_use_rl in number,
305 p_los_uom in varchar2,
306 p_los_calc_rl in number,
307 p_los_alt_val_to_use_cd in varchar2,
308 p_lsf_attribute_category in varchar2,
309 p_lsf_attribute1 in varchar2,
310 p_lsf_attribute2 in varchar2,
311 p_lsf_attribute3 in varchar2,
312 p_lsf_attribute4 in varchar2,
313 p_lsf_attribute5 in varchar2,
314 p_lsf_attribute6 in varchar2,
315 p_lsf_attribute7 in varchar2,
316 p_lsf_attribute8 in varchar2,
317 p_lsf_attribute9 in varchar2,
318 p_lsf_attribute10 in varchar2,
319 p_lsf_attribute11 in varchar2,
320 p_lsf_attribute12 in varchar2,
321 p_lsf_attribute13 in varchar2,
322 p_lsf_attribute14 in varchar2,
323 p_lsf_attribute15 in varchar2,
324 p_lsf_attribute16 in varchar2,
325 p_lsf_attribute17 in varchar2,
326 p_lsf_attribute18 in varchar2,
327 p_lsf_attribute19 in varchar2,
328 p_lsf_attribute20 in varchar2,
329 p_lsf_attribute21 in varchar2,
330 p_lsf_attribute22 in varchar2,
331 p_lsf_attribute23 in varchar2,
332 p_lsf_attribute24 in varchar2,
333 p_lsf_attribute25 in varchar2,
334 p_lsf_attribute26 in varchar2,
335 p_lsf_attribute27 in varchar2,
336 p_lsf_attribute28 in varchar2,
337 p_lsf_attribute29 in varchar2,
338 p_lsf_attribute30 in varchar2,
339 p_object_version_number in number,
340 p_use_overid_svc_dt_flag in varchar2
341 )
342 Return g_rec_type;
343 --
344 end ben_lsf_shd;