1 Package ben_dsq_shd as
2 /* $Header: bedsqrhi.pkh 120.0 2005/05/28 01:41:14 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (
10 ded_sched_py_freq_id number(15),
11 py_freq_cd varchar2(30),
12 dflt_flag varchar2(30),
13 acty_rt_ded_sched_id number(15),
14 business_group_id number(15),
15 dsq_attribute_category varchar2(30),
16 dsq_attribute1 varchar2(150),
17 dsq_attribute2 varchar2(150),
18 dsq_attribute3 varchar2(150),
19 dsq_attribute4 varchar2(150),
20 dsq_attribute5 varchar2(150),
21 dsq_attribute6 varchar2(150),
22 dsq_attribute7 varchar2(150),
23 dsq_attribute8 varchar2(150),
24 dsq_attribute9 varchar2(150),
25 dsq_attribute10 varchar2(150),
26 dsq_attribute11 varchar2(150),
27 dsq_attribute12 varchar2(150),
28 dsq_attribute13 varchar2(150),
29 dsq_attribute14 varchar2(150),
30 dsq_attribute15 varchar2(150),
31 dsq_attribute16 varchar2(150),
32 dsq_attribute17 varchar2(150),
33 dsq_attribute18 varchar2(150),
34 dsq_attribute19 varchar2(150),
35 dsq_attribute20 varchar2(150),
36 dsq_attribute21 varchar2(150),
37 dsq_attribute22 varchar2(150),
38 dsq_attribute23 varchar2(150),
39 dsq_attribute24 varchar2(150),
40 dsq_attribute25 varchar2(150),
41 dsq_attribute26 varchar2(150),
42 dsq_attribute27 varchar2(150),
43 dsq_attribute28 varchar2(150),
44 dsq_attribute29 varchar2(150),
45 dsq_attribute30 varchar2(150),
46 object_version_number number(9)
47 );
48 --
49 -- ----------------------------------------------------------------------------
50 -- | Global Definitions - Internal Development Use Only |
51 -- ----------------------------------------------------------------------------
52 --
53 g_old_rec g_rec_type; -- Global record definition
54 g_api_dml boolean; -- Global api dml status
55 --
56 -- ----------------------------------------------------------------------------
57 -- |------------------------< return_api_dml_status >-------------------------|
58 -- ----------------------------------------------------------------------------
59 -- {Start Of Comments}
60 --
61 -- Description:
62 -- This function will return the current g_api_dml private global
63 -- boolean status.
64 -- The g_api_dml status determines if at the time of the function
65 -- being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
66 -- is being issued from within an api.
67 -- If the status is TRUE then a dml statement is being issued from
68 -- within this entity api.
69 -- This function is primarily to support database triggers which
70 -- need to maintain the object_version_number for non-supported
71 -- dml statements (i.e. dml statement issued outside of the api layer).
72 --
73 -- Prerequisites:
74 -- None.
75 --
76 -- In Parameters:
77 -- None.
78 --
79 -- Post Success:
80 -- Processing continues.
81 -- If the function returns a TRUE value then, dml is being executed from
82 -- within this api.
83 --
84 -- Post Failure:
85 -- None.
86 --
87 -- Access Status:
88 -- Internal Row Handler Use Only.
89 --
90 -- {End Of Comments}
91 -- ----------------------------------------------------------------------------
92 Function return_api_dml_status Return Boolean;
93 --
94 -- ----------------------------------------------------------------------------
95 -- |---------------------------< constraint_error >---------------------------|
96 -- ----------------------------------------------------------------------------
97 -- {Start Of Comments}
98 --
99 -- Description:
100 -- This procedure is called when a constraint has been violated (i.e.
101 -- The exception hr_api.check_integrity_violated,
102 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
103 -- hr_api.unique_integrity_violated has been raised).
104 -- The exceptions can only be raised as follows:
105 -- 1) A check constraint can only be violated during an INSERT or UPDATE
106 -- dml operation.
107 -- 2) A parent integrity constraint can only be violated during an
108 -- INSERT or UPDATE dml operation.
109 -- 3) A child integrity constraint can only be violated during an
110 -- DELETE dml operation.
111 -- 4) A unique integrity constraint can only be violated during INSERT or
112 -- UPDATE dml operation.
113 --
114 -- Prerequisites:
115 -- 1) Either hr_api.check_integrity_violated,
116 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
117 -- hr_api.unique_integrity_violated has been raised with the subsequent
118 -- stripping of the constraint name from the generated error message
119 -- text.
120 -- 2) Standalone validation test which corresponds with a constraint error.
121 --
122 -- In Parameter:
123 -- p_constraint_name is in upper format and is just the constraint name
124 -- (e.g. not prefixed by brackets, schema owner etc).
125 --
126 -- Post Success:
127 -- Development dependant.
128 --
129 -- Post Failure:
130 -- Developement dependant.
131 --
132 -- Developer Implementation Notes:
133 -- For each constraint being checked the hr system package failure message
134 -- has been generated as a template only. These system error messages should
135 -- be modified as required (i.e. change the system failure message to a user
136 -- friendly defined error message).
137 --
138 -- Access Status:
139 -- Internal Development Use Only.
140 --
141 -- {End Of Comments}
142 -- ----------------------------------------------------------------------------
143 Procedure constraint_error
144 (p_constraint_name in all_constraints.constraint_name%TYPE);
145 --
146 -- ----------------------------------------------------------------------------
147 -- |-----------------------------< api_updating >-----------------------------|
148 -- ----------------------------------------------------------------------------
149 -- {Start Of Comments}
150 --
151 -- Description:
152 -- This function is used to populate the g_old_rec record with the
153 -- current row from the database for the specified primary key
154 -- provided that the primary key exists and is valid and does not
155 -- already match the current g_old_rec. The function will always return
156 -- a TRUE value if the g_old_rec is populated with the current row.
157 -- A FALSE value will be returned if all of the primary key arguments
158 -- are null.
159 --
160 -- Prerequisites:
161 -- None.
162 --
163 -- In Parameters:
164 --
165 -- Post Success:
166 -- A value of TRUE will be returned indiciating that the g_old_rec
167 -- is current.
168 -- A value of FALSE will be returned if all of the primary key arguments
169 -- have a null value (this indicates that the row has not be inserted into
170 -- the Schema), and therefore could never have a corresponding row.
171 --
172 -- Post Failure:
173 -- A failure can only occur under two circumstances:
174 -- 1) The primary key is invalid (i.e. a row does not exist for the
175 -- specified primary key values).
176 -- 2) If an object_version_number exists but is NOT the same as the current
177 -- g_old_rec value.
178 --
179 -- Developer Implementation Notes:
180 -- None.
181 --
182 -- Access Status:
183 -- Internal Development Use Only.
184 --
185 -- {End Of Comments}
186 -- ----------------------------------------------------------------------------
187 Function api_updating
188 (
189 p_ded_sched_py_freq_id in number,
190 p_object_version_number in number
191 ) Return Boolean;
192 --
193 -- ----------------------------------------------------------------------------
194 -- |---------------------------------< lck >----------------------------------|
195 -- ----------------------------------------------------------------------------
196 -- {Start Of Comments}
197 --
198 -- Description:
199 -- The Lck process has two main functions to perform. Firstly, the row to be
200 -- updated or deleted must be locked. The locking of the row will only be
201 -- successful if the row is not currently locked by another user.
202 -- Secondly, during the locking of the row, the row is selected into
203 -- the g_old_rec data structure which enables the current row values from the
204 -- server to be available to the api.
205 --
206 -- Prerequisites:
207 -- When attempting to call the lock the object version number (if defined)
208 -- is mandatory.
209 --
210 -- In Parameters:
211 -- The arguments to the Lck process are the primary key(s) which uniquely
212 -- identify the row and the object version number of row.
213 --
214 -- Post Success:
215 -- On successful completion of the Lck process the row to be updated or
216 -- deleted will be locked and selected into the global data structure
217 -- g_old_rec.
218 --
219 -- Post Failure:
220 -- The Lck process can fail for three reasons:
221 -- 1) When attempting to lock the row the row could already be locked by
222 -- another user. This will raise the HR_Api.Object_Locked exception.
223 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
224 -- This error is trapped and reported using the message name
225 -- 'HR_7220_INVALID_PRIMARY_KEY'.
226 -- 3) The row although existing in the HR Schema has a different object
227 -- version number than the object version number specified.
228 -- This error is trapped and reported using the message name
229 -- 'HR_7155_OBJECT_INVALID'.
230 --
231 -- Developer Implementation Notes:
232 -- For each primary key and the object version number arguments add a
233 -- call to hr_api.mandatory_arg_error procedure to ensure that these
234 -- argument values are not null.
235 --
236 -- Access Status:
237 -- Internal Development Use Only.
238 --
239 -- {End Of Comments}
240 -- ----------------------------------------------------------------------------
241 Procedure lck
242 (
243 p_ded_sched_py_freq_id in number,
244 p_object_version_number in number
245 );
246 --
247 -- ----------------------------------------------------------------------------
248 -- |-----------------------------< convert_args >-----------------------------|
249 -- ----------------------------------------------------------------------------
250 -- {Start Of Comments}
251 --
252 -- Description:
253 -- This function is used to turn attribute parameters into the record
254 -- structure parameter g_rec_type.
255 --
256 -- Prerequisites:
257 -- This is a private function and can only be called from the ins or upd
258 -- attribute processes.
259 --
260 -- In Parameters:
261 --
262 -- Post Success:
263 -- A returning record structure will be returned.
264 --
265 -- Post Failure:
266 -- No direct error handling is required within this function. Any possible
267 -- errors within this function will be a PL/SQL value error due to conversion
268 -- of datatypes or data lengths.
269 --
270 -- Developer Implementation Notes:
271 -- None.
272 --
273 -- Access Status:
274 -- Internal Row Handler Use Only.
275 --
276 -- {End Of Comments}
277 -- ----------------------------------------------------------------------------
278 Function convert_args
279 (
280 p_ded_sched_py_freq_id in number,
281 p_py_freq_cd in varchar2,
282 p_dflt_flag in varchar2,
283 p_acty_rt_ded_sched_id in number,
284 p_business_group_id in number,
285 p_dsq_attribute_category in varchar2,
286 p_dsq_attribute1 in varchar2,
287 p_dsq_attribute2 in varchar2,
288 p_dsq_attribute3 in varchar2,
289 p_dsq_attribute4 in varchar2,
290 p_dsq_attribute5 in varchar2,
291 p_dsq_attribute6 in varchar2,
292 p_dsq_attribute7 in varchar2,
293 p_dsq_attribute8 in varchar2,
294 p_dsq_attribute9 in varchar2,
295 p_dsq_attribute10 in varchar2,
296 p_dsq_attribute11 in varchar2,
297 p_dsq_attribute12 in varchar2,
298 p_dsq_attribute13 in varchar2,
299 p_dsq_attribute14 in varchar2,
300 p_dsq_attribute15 in varchar2,
301 p_dsq_attribute16 in varchar2,
302 p_dsq_attribute17 in varchar2,
303 p_dsq_attribute18 in varchar2,
304 p_dsq_attribute19 in varchar2,
305 p_dsq_attribute20 in varchar2,
306 p_dsq_attribute21 in varchar2,
307 p_dsq_attribute22 in varchar2,
308 p_dsq_attribute23 in varchar2,
309 p_dsq_attribute24 in varchar2,
310 p_dsq_attribute25 in varchar2,
311 p_dsq_attribute26 in varchar2,
312 p_dsq_attribute27 in varchar2,
313 p_dsq_attribute28 in varchar2,
314 p_dsq_attribute29 in varchar2,
315 p_dsq_attribute30 in varchar2,
316 p_object_version_number in number
317 )
318 Return g_rec_type;
319 --
320 end ben_dsq_shd;