1 Package per_bba_shd as
2 /* $Header: pebbarhi.pkh 120.0 2005/05/31 06:02:01 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (
10 balance_amount_id number(9),
11 balance_type_id number(9),
12 processed_assignment_id number(9),
13 business_group_id number(15),
14 ytd_amount number,
15 fytd_amount number,
16 ptd_amount number,
17 mtd_amount number,
18 qtd_amount number,
19 run_amount number,
20 object_version_number number(9),
21 bba_attribute_category varchar2(30),
22 bba_attribute1 varchar2(150),
23 bba_attribute2 varchar2(150),
24 bba_attribute3 varchar2(150),
25 bba_attribute4 varchar2(150),
26 bba_attribute5 varchar2(150),
27 bba_attribute6 varchar2(150),
28 bba_attribute7 varchar2(150),
29 bba_attribute8 varchar2(150),
30 bba_attribute9 varchar2(150),
31 bba_attribute10 varchar2(150),
32 bba_attribute11 varchar2(150),
33 bba_attribute12 varchar2(150),
34 bba_attribute13 varchar2(150),
35 bba_attribute14 varchar2(150),
36 bba_attribute15 varchar2(150),
37 bba_attribute16 varchar2(150),
38 bba_attribute17 varchar2(150),
39 bba_attribute18 varchar2(150),
40 bba_attribute19 varchar2(150),
41 bba_attribute20 varchar2(150),
42 bba_attribute21 varchar2(150),
43 bba_attribute22 varchar2(150),
44 bba_attribute23 varchar2(150),
45 bba_attribute24 varchar2(150),
46 bba_attribute25 varchar2(150),
47 bba_attribute26 varchar2(150),
48 bba_attribute27 varchar2(150),
49 bba_attribute28 varchar2(150),
50 bba_attribute29 varchar2(150),
51 bba_attribute30 varchar2(150)
52 );
53 --
54 -- ----------------------------------------------------------------------------
55 -- | Global Definitions - Internal Development Use Only |
56 -- ----------------------------------------------------------------------------
57 --
58 g_old_rec g_rec_type; -- Global record definition
59 --
60 -- ----------------------------------------------------------------------------
61 -- |---------------------------< constraint_error >---------------------------|
62 -- ----------------------------------------------------------------------------
63 -- {Start Of Comments}
64 --
65 -- Description:
66 -- This procedure is called when a constraint has been violated (i.e.
67 -- The exception hr_api.check_integrity_violated,
68 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
69 -- hr_api.unique_integrity_violated has been raised).
70 -- The exceptions can only be raised as follows:
71 -- 1) A check constraint can only be violated during an INSERT or UPDATE
72 -- dml operation.
73 -- 2) A parent integrity constraint can only be violated during an
74 -- INSERT or UPDATE dml operation.
75 -- 3) A child integrity constraint can only be violated during an
76 -- DELETE dml operation.
77 -- 4) A unique integrity constraint can only be violated during INSERT or
78 -- UPDATE dml operation.
79 --
80 -- Prerequisites:
81 -- 1) Either hr_api.check_integrity_violated,
82 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
83 -- hr_api.unique_integrity_violated has been raised with the subsequent
84 -- stripping of the constraint name from the generated error message
85 -- text.
86 -- 2) Standalone validation test which corresponds with a constraint error.
87 --
88 -- In Parameter:
89 -- p_constraint_name is in upper format and is just the constraint name
90 -- (e.g. not prefixed by brackets, schema owner etc).
91 --
92 -- Post Success:
93 -- Development dependant.
94 --
95 -- Post Failure:
96 -- Developement dependant.
97 --
98 -- Developer Implementation Notes:
99 -- For each constraint being checked the hr system package failure message
100 -- has been generated as a template only. These system error messages should
101 -- be modified as required (i.e. change the system failure message to a user
102 -- friendly defined error message).
103 --
104 -- Access Status:
105 -- Internal Development Use Only.
106 --
107 -- {End Of Comments}
108 -- ----------------------------------------------------------------------------
109 Procedure constraint_error
110 (p_constraint_name in all_constraints.constraint_name%TYPE);
111 --
112 -- ----------------------------------------------------------------------------
113 -- |-----------------------------< api_updating >-----------------------------|
114 -- ----------------------------------------------------------------------------
115 -- {Start Of Comments}
116 --
117 -- Description:
118 -- This function is used to populate the g_old_rec record with the
119 -- current row from the database for the specified primary key
120 -- provided that the primary key exists and is valid and does not
121 -- already match the current g_old_rec. The function will always return
122 -- a TRUE value if the g_old_rec is populated with the current row.
123 -- A FALSE value will be returned if all of the primary key arguments
124 -- are null.
125 --
126 -- Prerequisites:
127 -- None.
128 --
129 -- In Parameters:
130 --
131 -- Post Success:
132 -- A value of TRUE will be returned indiciating that the g_old_rec
133 -- is current.
134 -- A value of FALSE will be returned if all of the primary key arguments
135 -- have a null value (this indicates that the row has not be inserted into
136 -- the Schema), and therefore could never have a corresponding row.
137 --
138 -- Post Failure:
139 -- A failure can only occur under two circumstances:
140 -- 1) The primary key is invalid (i.e. a row does not exist for the
141 -- specified primary key values).
142 -- 2) If an object_version_number exists but is NOT the same as the current
143 -- g_old_rec value.
144 --
145 -- Developer Implementation Notes:
146 -- None.
147 --
148 -- Access Status:
149 -- Internal Development Use Only.
150 --
151 -- {End Of Comments}
152 -- ----------------------------------------------------------------------------
153 Function api_updating
154 (
155 p_balance_amount_id in number,
156 p_object_version_number in number
157 ) Return Boolean;
158 --
159 -- ----------------------------------------------------------------------------
160 -- |---------------------------------< lck >----------------------------------|
161 -- ----------------------------------------------------------------------------
162 -- {Start of comments}
163 --
164 -- Description:
165 -- The Lck process has two main functions to perform. Firstly, the row to be
166 -- updated or deleted must be locked. The locking of the row will only be
167 -- successful if the row is not currently locked by another user.
168 -- Secondly, during the locking of the row, the row is selected into
169 -- the g_old_rec data structure which enables the current row values from the
170 -- server to be available to the api.
171 --
172 -- Prerequisites:
173 -- When attempting to call the lock the object version number (if defined)
174 -- is mandatory.
175 --
176 -- In Parameters:
177 -- The arguments to the Lck process are the primary key(s) which uniquely
178 -- identify the row and the object version number of row.
179 --
180 -- Post Success:
181 -- On successful completion of the Lck process the row to be updated or
182 -- deleted will be locked and selected into the global data structure
183 -- g_old_rec.
184 --
185 -- Post Failure:
186 -- The Lck process can fail for three reasons:
187 -- 1) When attempting to lock the row the row could already be locked by
188 -- another user. This will raise the HR_Api.Object_Locked exception.
189 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
190 -- This error is trapped and reported using the message name
191 -- 'HR_7220_INVALID_PRIMARY_KEY'.
192 -- 3) The row although existing in the HR Schema has a different object
193 -- version number than the object version number specified.
194 -- This error is trapped and reported using the message name
195 -- 'HR_7155_OBJECT_INVALID'.
196 --
197 -- Developer Implementation Notes:
198 -- For each primary key and the object version number arguments add a
199 -- call to hr_api.mandatory_arg_error procedure to ensure that these
200 -- argument values are not null.
201 --
202 -- Access Status:
203 -- Internal Development Use Only.
204 --
205 -- {End of comments}
206 -- ----------------------------------------------------------------------------
207 Procedure lck
208 (
209 p_balance_amount_id in number,
210 p_object_version_number in number
211 );
212 --
213 -- ----------------------------------------------------------------------------
214 -- |-----------------------------< convert_args >-----------------------------|
215 -- ----------------------------------------------------------------------------
216 -- {Start Of Comments}
217 --
218 -- Description:
219 -- This function is used to turn attribute parameters into the record
220 -- structure parameter g_rec_type.
221 --
222 -- Prerequisites:
223 -- This is a private function and can only be called from the ins or upd
224 -- attribute processes.
225 --
226 -- In Parameters:
227 --
228 -- Post Success:
229 -- A returning record structure will be returned.
230 --
231 -- Post Failure:
232 -- No direct error handling is required within this function. Any possible
233 -- errors within this function will be a PL/SQL value error due to conversion
234 -- of datatypes or data lengths.
235 --
236 -- Developer Implementation Notes:
237 -- None.
238 --
239 -- Access Status:
240 -- Internal Row Handler Use Only.
241 --
242 -- {End Of Comments}
243 -- -----------------------------------------------------------------------------
244 Function convert_args
245 (
246 p_balance_amount_id in number,
247 p_balance_type_id in number,
248 p_processed_assignment_id in number,
249 p_business_group_id in number,
250 p_ytd_amount in number,
251 p_fytd_amount in number,
252 p_ptd_amount in number,
253 p_mtd_amount in number,
254 p_qtd_amount in number,
255 p_run_amount in number,
256 p_object_version_number in number,
257 p_bba_attribute_category in varchar2,
258 p_bba_attribute1 in varchar2,
259 p_bba_attribute2 in varchar2,
260 p_bba_attribute3 in varchar2,
261 p_bba_attribute4 in varchar2,
262 p_bba_attribute5 in varchar2,
263 p_bba_attribute6 in varchar2,
264 p_bba_attribute7 in varchar2,
265 p_bba_attribute8 in varchar2,
266 p_bba_attribute9 in varchar2,
267 p_bba_attribute10 in varchar2,
268 p_bba_attribute11 in varchar2,
269 p_bba_attribute12 in varchar2,
270 p_bba_attribute13 in varchar2,
271 p_bba_attribute14 in varchar2,
272 p_bba_attribute15 in varchar2,
273 p_bba_attribute16 in varchar2,
274 p_bba_attribute17 in varchar2,
275 p_bba_attribute18 in varchar2,
276 p_bba_attribute19 in varchar2,
277 p_bba_attribute20 in varchar2,
278 p_bba_attribute21 in varchar2,
279 p_bba_attribute22 in varchar2,
280 p_bba_attribute23 in varchar2,
281 p_bba_attribute24 in varchar2,
282 p_bba_attribute25 in varchar2,
283 p_bba_attribute26 in varchar2,
284 p_bba_attribute27 in varchar2,
285 p_bba_attribute28 in varchar2,
286 p_bba_attribute29 in varchar2,
287 p_bba_attribute30 in varchar2
288 )
289 Return g_rec_type;
290 --
291 end per_bba_shd;