1 Package ben_crt_shd AUTHID CURRENT_USER as
2 /* $Header: becrtrhi.pkh 120.0 2005/05/28 01:23:00 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (
10 crt_ordr_id number(15),
11 crt_ordr_typ_cd varchar2(30),
12 apls_perd_endg_dt date,
13 apls_perd_strtg_dt date,
14 crt_ident varchar2(90),-- UTF8 Change Bug 2254683
15 description varchar2(600), -- UTF8 Change Bug 2254683
16 detd_qlfd_ordr_dt date,
17 issue_dt date,
18 qdro_amt number,
19 qdro_dstr_mthd_cd varchar2(30),
20 qdro_pct number(15),
21 rcvd_dt date,
22 uom varchar2(30),
23 crt_issng varchar2(180),-- UTF8 Change Bug 2254683
24 pl_id number(15),
25 person_id number(15),
26 business_group_id number(15),
27 crt_attribute_category varchar2(30),
28 crt_attribute1 varchar2(150),
29 crt_attribute2 varchar2(150),
30 crt_attribute3 varchar2(150),
31 crt_attribute4 varchar2(150),
32 crt_attribute5 varchar2(150),
33 crt_attribute6 varchar2(150),
34 crt_attribute7 varchar2(150),
35 crt_attribute8 varchar2(150),
36 crt_attribute9 varchar2(150),
37 crt_attribute10 varchar2(150),
38 crt_attribute11 varchar2(150),
39 crt_attribute12 varchar2(150),
40 crt_attribute13 varchar2(150),
41 crt_attribute14 varchar2(150),
42 crt_attribute15 varchar2(150),
43 crt_attribute16 varchar2(150),
44 crt_attribute17 varchar2(150),
45 crt_attribute18 varchar2(150),
46 crt_attribute19 varchar2(150),
47 crt_attribute20 varchar2(150),
48 crt_attribute21 varchar2(150),
49 crt_attribute22 varchar2(150),
50 crt_attribute23 varchar2(150),
51 crt_attribute24 varchar2(150),
52 crt_attribute25 varchar2(150),
53 crt_attribute26 varchar2(150),
54 crt_attribute27 varchar2(150),
55 crt_attribute28 varchar2(150),
56 crt_attribute29 varchar2(150),
57 crt_attribute30 varchar2(150),
58 object_version_number number(9),
59 qdro_num_pymt_val number(15),
60 qdro_per_perd_cd varchar2(30),
61 pl_typ_id number(15)
62 );
63 --
64 -- ----------------------------------------------------------------------------
65 -- | Global Definitions - Internal Development Use Only |
66 -- ----------------------------------------------------------------------------
67 --
68 g_old_rec g_rec_type; -- Global record definition
69 g_api_dml boolean; -- Global api dml status
70 --
71 -- ----------------------------------------------------------------------------
72 -- |------------------------< return_api_dml_status >-------------------------|
73 -- ----------------------------------------------------------------------------
74 -- {Start Of Comments}
75 --
76 -- Description:
77 -- This function will return the current g_api_dml private global
78 -- boolean status.
79 -- The g_api_dml status determines if at the time of the function
80 -- being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
81 -- is being issued from within an api.
82 -- If the status is TRUE then a dml statement is being issued from
83 -- within this entity api.
84 -- This function is primarily to support database triggers which
85 -- need to maintain the object_version_number for non-supported
86 -- dml statements (i.e. dml statement issued outside of the api layer).
87 --
88 -- Prerequisites:
89 -- None.
90 --
91 -- In Parameters:
92 -- None.
93 --
94 -- Post Success:
95 -- Processing continues.
96 -- If the function returns a TRUE value then, dml is being executed from
97 -- within this api.
98 --
99 -- Post Failure:
100 -- None.
101 --
102 -- Access Status:
103 -- Internal Row Handler Use Only.
104 --
105 -- {End Of Comments}
106 -- ----------------------------------------------------------------------------
107 Function return_api_dml_status Return Boolean;
108 --
109 -- ----------------------------------------------------------------------------
110 -- |---------------------------< constraint_error >---------------------------|
111 -- ----------------------------------------------------------------------------
112 -- {Start Of Comments}
113 --
114 -- Description:
115 -- This procedure is called when a constraint has been violated (i.e.
116 -- The exception hr_api.check_integrity_violated,
117 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
118 -- hr_api.unique_integrity_violated has been raised).
119 -- The exceptions can only be raised as follows:
120 -- 1) A check constraint can only be violated during an INSERT or UPDATE
121 -- dml operation.
122 -- 2) A parent integrity constraint can only be violated during an
123 -- INSERT or UPDATE dml operation.
124 -- 3) A child integrity constraint can only be violated during an
125 -- DELETE dml operation.
126 -- 4) A unique integrity constraint can only be violated during INSERT or
127 -- UPDATE dml operation.
128 --
129 -- Prerequisites:
130 -- 1) Either hr_api.check_integrity_violated,
131 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
132 -- hr_api.unique_integrity_violated has been raised with the subsequent
133 -- stripping of the constraint name from the generated error message
134 -- text.
135 -- 2) Standalone validation test which corresponds with a constraint error.
136 --
137 -- In Parameter:
138 -- p_constraint_name is in upper format and is just the constraint name
139 -- (e.g. not prefixed by brackets, schema owner etc).
140 --
141 -- Post Success:
142 -- Development dependant.
143 --
144 -- Post Failure:
145 -- Developement dependant.
146 --
147 -- Developer Implementation Notes:
148 -- For each constraint being checked the hr system package failure message
149 -- has been generated as a template only. These system error messages should
150 -- be modified as required (i.e. change the system failure message to a user
151 -- friendly defined error message).
152 --
153 -- Access Status:
154 -- Internal Development Use Only.
155 --
156 -- {End Of Comments}
157 -- ----------------------------------------------------------------------------
158 Procedure constraint_error
159 (p_constraint_name in all_constraints.constraint_name%TYPE);
160 --
161 -- ----------------------------------------------------------------------------
162 -- |-----------------------------< api_updating >-----------------------------|
163 -- ----------------------------------------------------------------------------
164 -- {Start Of Comments}
165 --
166 -- Description:
167 -- This function is used to populate the g_old_rec record with the
168 -- current row from the database for the specified primary key
169 -- provided that the primary key exists and is valid and does not
170 -- already match the current g_old_rec. The function will always return
171 -- a TRUE value if the g_old_rec is populated with the current row.
172 -- A FALSE value will be returned if all of the primary key arguments
173 -- are null.
174 --
175 -- Prerequisites:
176 -- None.
177 --
178 -- In Parameters:
179 --
180 -- Post Success:
181 -- A value of TRUE will be returned indiciating that the g_old_rec
182 -- is current.
183 -- A value of FALSE will be returned if all of the primary key arguments
184 -- have a null value (this indicates that the row has not be inserted into
185 -- the Schema), and therefore could never have a corresponding row.
186 --
187 -- Post Failure:
188 -- A failure can only occur under two circumstances:
189 -- 1) The primary key is invalid (i.e. a row does not exist for the
190 -- specified primary key values).
191 -- 2) If an object_version_number exists but is NOT the same as the current
192 -- g_old_rec value.
193 --
194 -- Developer Implementation Notes:
195 -- None.
196 --
197 -- Access Status:
198 -- Internal Development Use Only.
199 --
200 -- {End Of Comments}
201 -- ----------------------------------------------------------------------------
202 Function api_updating
203 (
204 p_crt_ordr_id in number,
205 p_object_version_number in number
206 ) Return Boolean;
207 --
208 -- ----------------------------------------------------------------------------
209 -- |---------------------------------< lck >----------------------------------|
210 -- ----------------------------------------------------------------------------
211 -- {Start Of Comments}
212 --
213 -- Description:
214 -- The Lck process has two main functions to perform. Firstly, the row to be
215 -- updated or deleted must be locked. The locking of the row will only be
216 -- successful if the row is not currently locked by another user.
217 -- Secondly, during the locking of the row, the row is selected into
218 -- the g_old_rec data structure which enables the current row values from the
219 -- server to be available to the api.
220 --
221 -- Prerequisites:
222 -- When attempting to call the lock the object version number (if defined)
223 -- is mandatory.
224 --
225 -- In Parameters:
226 -- The arguments to the Lck process are the primary key(s) which uniquely
227 -- identify the row and the object version number of row.
228 --
229 -- Post Success:
230 -- On successful completion of the Lck process the row to be updated or
231 -- deleted will be locked and selected into the global data structure
232 -- g_old_rec.
233 --
234 -- Post Failure:
235 -- The Lck process can fail for three reasons:
236 -- 1) When attempting to lock the row the row could already be locked by
237 -- another user. This will raise the HR_Api.Object_Locked exception.
238 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
239 -- This error is trapped and reported using the message name
240 -- 'HR_7220_INVALID_PRIMARY_KEY'.
241 -- 3) The row although existing in the HR Schema has a different object
242 -- version number than the object version number specified.
243 -- This error is trapped and reported using the message name
244 -- 'HR_7155_OBJECT_INVALID'.
245 --
246 -- Developer Implementation Notes:
247 -- For each primary key and the object version number arguments add a
248 -- call to hr_api.mandatory_arg_error procedure to ensure that these
249 -- argument values are not null.
250 --
251 -- Access Status:
252 -- Internal Development Use Only.
253 --
254 -- {End Of Comments}
255 -- ----------------------------------------------------------------------------
256 Procedure lck
257 (
258 p_crt_ordr_id in number,
259 p_object_version_number in number
260 );
261 --
262 -- ----------------------------------------------------------------------------
263 -- |-----------------------------< convert_args >-----------------------------|
264 -- ----------------------------------------------------------------------------
265 -- {Start Of Comments}
266 --
267 -- Description:
268 -- This function is used to turn attribute parameters into the record
269 -- structure parameter g_rec_type.
270 --
271 -- Prerequisites:
272 -- This is a private function and can only be called from the ins or upd
273 -- attribute processes.
274 --
275 -- In Parameters:
276 --
277 -- Post Success:
278 -- A returning record structure will be returned.
279 --
280 -- Post Failure:
281 -- No direct error handling is required within this function. Any possible
282 -- errors within this function will be a PL/SQL value error due to conversion
283 -- of datatypes or data lengths.
284 --
285 -- Developer Implementation Notes:
286 -- None.
287 --
288 -- Access Status:
289 -- Internal Row Handler Use Only.
290 --
291 -- {End Of Comments}
292 -- ----------------------------------------------------------------------------
293 Function convert_args
294 (
295 p_crt_ordr_id in number,
296 p_crt_ordr_typ_cd in varchar2,
297 p_apls_perd_endg_dt in date,
298 p_apls_perd_strtg_dt in date,
299 p_crt_ident in varchar2,
300 p_description in varchar2,
301 p_detd_qlfd_ordr_dt in date,
302 p_issue_dt in date,
303 p_qdro_amt in number,
304 p_qdro_dstr_mthd_cd in varchar2,
305 p_qdro_pct in number,
306 p_rcvd_dt in date,
307 p_uom in varchar2,
308 p_crt_issng in varchar2,
309 p_pl_id in number,
310 p_person_id in number,
311 p_business_group_id in number,
312 p_crt_attribute_category in varchar2,
313 p_crt_attribute1 in varchar2,
314 p_crt_attribute2 in varchar2,
315 p_crt_attribute3 in varchar2,
316 p_crt_attribute4 in varchar2,
317 p_crt_attribute5 in varchar2,
318 p_crt_attribute6 in varchar2,
319 p_crt_attribute7 in varchar2,
320 p_crt_attribute8 in varchar2,
321 p_crt_attribute9 in varchar2,
322 p_crt_attribute10 in varchar2,
323 p_crt_attribute11 in varchar2,
324 p_crt_attribute12 in varchar2,
325 p_crt_attribute13 in varchar2,
326 p_crt_attribute14 in varchar2,
327 p_crt_attribute15 in varchar2,
328 p_crt_attribute16 in varchar2,
329 p_crt_attribute17 in varchar2,
330 p_crt_attribute18 in varchar2,
331 p_crt_attribute19 in varchar2,
332 p_crt_attribute20 in varchar2,
333 p_crt_attribute21 in varchar2,
334 p_crt_attribute22 in varchar2,
335 p_crt_attribute23 in varchar2,
336 p_crt_attribute24 in varchar2,
337 p_crt_attribute25 in varchar2,
338 p_crt_attribute26 in varchar2,
339 p_crt_attribute27 in varchar2,
340 p_crt_attribute28 in varchar2,
341 p_crt_attribute29 in varchar2,
342 p_crt_attribute30 in varchar2,
343 p_object_version_number in number,
344 p_qdro_num_pymt_val in number,
345 p_qdro_per_perd_cd in varchar2,
346 p_pl_typ_id in number
347 )
348 Return g_rec_type;
349 --
350 end ben_crt_shd;