1 Package per_cag_shd AUTHID CURRENT_USER as
2 /* $Header: pecagrhi.pkh 120.0 2005/05/31 06:22:21 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (
10 collective_agreement_id number(9),
11 business_group_id number(9),
12 object_version_number number(9),
13 name varchar2(80),
14 status varchar2(30),
15 pl_id number(15),
16 cag_number number(15),
17 description varchar2(2000),
18 start_date date,
19 end_date date,
20 employer_organization_id number(15),
21 employer_signatory varchar2(80),
22 bargaining_organization_id number(15),
23 bargaining_unit_signatory varchar2(80),
24 jurisdiction varchar2(80),
25 authorizing_body varchar2(80),
26 authorized_date date,
27 cag_information_category varchar2(30),
28 cag_information1 varchar2(150),
29 cag_information2 varchar2(150),
30 cag_information3 varchar2(150),
31 cag_information4 varchar2(150),
32 cag_information5 varchar2(150),
33 cag_information6 varchar2(150),
34 cag_information7 varchar2(150),
35 cag_information8 varchar2(150),
36 cag_information9 varchar2(150),
37 cag_information10 varchar2(150),
38 cag_information11 varchar2(150),
39 cag_information12 varchar2(150),
40 cag_information13 varchar2(150),
41 cag_information14 varchar2(150),
42 cag_information15 varchar2(150),
43 cag_information16 varchar2(150),
44 cag_information17 varchar2(150),
45 cag_information18 varchar2(150),
46 cag_information19 varchar2(150),
47 cag_information20 varchar2(150),
48 attribute_category varchar2(30),
49 attribute1 varchar2(150),
50 attribute2 varchar2(150),
51 attribute3 varchar2(150),
52 attribute4 varchar2(150),
53 attribute5 varchar2(150),
54 attribute6 varchar2(150),
55 attribute7 varchar2(150),
56 attribute8 varchar2(150),
57 attribute9 varchar2(150),
58 attribute10 varchar2(150),
59 attribute11 varchar2(150),
60 attribute12 varchar2(150),
61 attribute13 varchar2(150),
62 attribute14 varchar2(150),
63 attribute15 varchar2(150),
64 attribute16 varchar2(150),
65 attribute17 varchar2(150),
66 attribute18 varchar2(150),
67 attribute19 varchar2(150),
68 attribute20 varchar2(150)
69 );
70 --
71 -- ----------------------------------------------------------------------------
72 -- | Global Definitions - Internal Development Use Only |
73 -- ----------------------------------------------------------------------------
74 --
75 g_old_rec g_rec_type; -- Global record definition
76 -- g_api_dml boolean; -- Global api dml status
77 --
78 -- ----------------------------------------------------------------------------
79 -- |---------------------------< constraint_error >---------------------------|
80 -- ----------------------------------------------------------------------------
81 -- {Start Of Comments}
82 --
83 -- Description:
84 -- This procedure is called when a constraint has been violated (i.e.
85 -- The exception hr_api.check_integrity_violated,
86 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
87 -- hr_api.unique_integrity_violated has been raised).
88 -- The exceptions can only be raised as follows:
89 -- 1) A check constraint can only be violated during an INSERT or UPDATE
90 -- dml operation.
91 -- 2) A parent integrity constraint can only be violated during an
92 -- INSERT or UPDATE dml operation.
93 -- 3) A child integrity constraint can only be violated during an
94 -- DELETE dml operation.
95 -- 4) A unique integrity constraint can only be violated during INSERT or
96 -- UPDATE dml operation.
97 --
98 -- Prerequisites:
99 -- 1) Either hr_api.check_integrity_violated,
100 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
101 -- hr_api.unique_integrity_violated has been raised with the subsequent
102 -- stripping of the constraint name from the generated error message
103 -- text.
104 -- 2) Standalone validation test which corresponds with a constraint error.
105 --
106 -- In Parameter:
107 -- p_constraint_name is in upper format and is just the constraint name
108 -- (e.g. not prefixed by brackets, schema owner etc).
109 --
110 -- Post Success:
111 -- Development dependant.
112 --
113 -- Post Failure:
114 -- Developement dependant.
115 --
116 -- Developer Implementation Notes:
117 -- For each constraint being checked the hr system package failure message
118 -- has been generated as a template only. These system error messages should
119 -- be modified as required (i.e. change the system failure message to a user
120 -- friendly defined error message).
121 --
122 -- Access Status:
123 -- Internal Development Use Only.
124 --
125 -- {End Of Comments}
126 -- ----------------------------------------------------------------------------
127 Procedure constraint_error
128 (p_constraint_name in all_constraints.constraint_name%TYPE);
129 --
130 -- ----------------------------------------------------------------------------
131 -- |-----------------------------< api_updating >-----------------------------|
132 -- ----------------------------------------------------------------------------
133 -- {Start Of Comments}
134 --
135 -- Description:
136 -- This function is used to populate the g_old_rec record with the
137 -- current row from the database for the specified primary key
138 -- provided that the primary key exists and is valid and does not
139 -- already match the current g_old_rec. The function will always return
140 -- a TRUE value if the g_old_rec is populated with the current row.
141 -- A FALSE value will be returned if all of the primary key arguments
142 -- are null.
143 --
144 -- Prerequisites:
145 -- None.
146 --
147 -- In Parameters:
148 --
149 -- Post Success:
150 -- A value of TRUE will be returned indiciating that the g_old_rec
151 -- is current.
152 -- A value of FALSE will be returned if all of the primary key arguments
153 -- have a null value (this indicates that the row has not be inserted into
154 -- the Schema), and therefore could never have a corresponding row.
155 --
156 -- Post Failure:
157 -- A failure can only occur under two circumstances:
158 -- 1) The primary key is invalid (i.e. a row does not exist for the
159 -- specified primary key values).
160 -- 2) If an object_version_number exists but is NOT the same as the current
161 -- g_old_rec value.
162 --
163 -- Developer Implementation Notes:
164 -- None.
165 --
166 -- Access Status:
167 -- Internal Development Use Only.
168 --
169 -- {End Of Comments}
170 -- ----------------------------------------------------------------------------
171 Function api_updating
172 (
173 p_collective_agreement_id in number,
174 p_object_version_number in number
175 ) Return Boolean;
176 --
177 -- ----------------------------------------------------------------------------
178 -- |---------------------------------< lck >----------------------------------|
179 -- ----------------------------------------------------------------------------
180 -- {Start Of Comments}
181 --
182 -- Description:
183 -- The Lck process has two main functions to perform. Firstly, the row to be
184 -- updated or deleted must be locked. The locking of the row will only be
185 -- successful if the row is not currently locked by another user.
186 -- Secondly, during the locking of the row, the row is selected into
187 -- the g_old_rec data structure which enables the current row values from the
188 -- server to be available to the api.
189 --
190 -- Prerequisites:
191 -- When attempting to call the lock the object version number (if defined)
192 -- is mandatory.
193 --
194 -- In Parameters:
195 -- The arguments to the Lck process are the primary key(s) which uniquely
196 -- identify the row and the object version number of row.
197 --
198 -- Post Success:
199 -- On successful completion of the Lck process the row to be updated or
200 -- deleted will be locked and selected into the global data structure
201 -- g_old_rec.
202 --
203 -- Post Failure:
204 -- The Lck process can fail for three reasons:
205 -- 1) When attempting to lock the row the row could already be locked by
206 -- another user. This will raise the HR_Api.Object_Locked exception.
207 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
208 -- This error is trapped and reported using the message name
209 -- 'HR_7220_INVALID_PRIMARY_KEY'.
210 -- 3) The row although existing in the HR Schema has a different object
211 -- version number than the object version number specified.
212 -- This error is trapped and reported using the message name
213 -- 'HR_7155_OBJECT_INVALID'.
214 --
215 -- Developer Implementation Notes:
216 -- For each primary key and the object version number arguments add a
217 -- call to hr_api.mandatory_arg_error procedure to ensure that these
218 -- argument values are not null.
219 --
220 -- Access Status:
221 -- Internal Development Use Only.
222 --
223 -- {End Of Comments}
224 -- ----------------------------------------------------------------------------
225 Procedure lck
226 (
227 p_collective_agreement_id in number,
228 p_object_version_number in number
229 );
230 --
231 -- ----------------------------------------------------------------------------
232 -- |-----------------------------< convert_args >-----------------------------|
233 -- ----------------------------------------------------------------------------
234 -- {Start Of Comments}
235 --
236 -- Description:
237 -- This function is used to turn attribute parameters into the record
238 -- structure parameter g_rec_type.
239 --
240 -- Prerequisites:
241 -- This is a private function and can only be called from the ins or upd
242 -- attribute processes.
243 --
244 -- In Parameters:
245 --
246 -- Post Success:
247 -- A returning record structure will be returned.
248 --
249 -- Post Failure:
250 -- No direct error handling is required within this function. Any possible
251 -- errors within this function will be a PL/SQL value error due to conversion
252 -- of datatypes or data lengths.
253 --
254 -- Developer Implementation Notes:
255 -- None.
256 --
257 -- Access Status:
258 -- Internal Row Handler Use Only.
259 --
260 -- {End Of Comments}
261 -- ----------------------------------------------------------------------------
262 Function convert_args
263 (
264 p_collective_agreement_id in number,
265 p_business_group_id in number,
266 p_object_version_number in number,
267 p_name in varchar2,
268 p_pl_id in number,
269 p_status in varchar2,
270 p_cag_number in number,
271 p_description in varchar2,
272 p_start_date in date,
273 p_end_date in date,
274 p_employer_organization_id in number,
275 p_employer_signatory in varchar2,
276 p_bargaining_organization_id in number,
277 p_bargaining_unit_signatory in varchar2,
278 p_jurisdiction in varchar2,
279 p_authorizing_body in varchar2,
280 p_authorized_date in date,
281 p_cag_information_category in varchar2,
282 p_cag_information1 in varchar2,
283 p_cag_information2 in varchar2,
284 p_cag_information3 in varchar2,
285 p_cag_information4 in varchar2,
286 p_cag_information5 in varchar2,
287 p_cag_information6 in varchar2,
288 p_cag_information7 in varchar2,
289 p_cag_information8 in varchar2,
290 p_cag_information9 in varchar2,
291 p_cag_information10 in varchar2,
292 p_cag_information11 in varchar2,
293 p_cag_information12 in varchar2,
294 p_cag_information13 in varchar2,
295 p_cag_information14 in varchar2,
296 p_cag_information15 in varchar2,
297 p_cag_information16 in varchar2,
298 p_cag_information17 in varchar2,
299 p_cag_information18 in varchar2,
300 p_cag_information19 in varchar2,
301 p_cag_information20 in varchar2,
302 p_attribute_category in varchar2,
303 p_attribute1 in varchar2,
304 p_attribute2 in varchar2,
305 p_attribute3 in varchar2,
306 p_attribute4 in varchar2,
307 p_attribute5 in varchar2,
308 p_attribute6 in varchar2,
309 p_attribute7 in varchar2,
310 p_attribute8 in varchar2,
311 p_attribute9 in varchar2,
312 p_attribute10 in varchar2,
313 p_attribute11 in varchar2,
314 p_attribute12 in varchar2,
315 p_attribute13 in varchar2,
316 p_attribute14 in varchar2,
317 p_attribute15 in varchar2,
318 p_attribute16 in varchar2,
319 p_attribute17 in varchar2,
320 p_attribute18 in varchar2,
321 p_attribute19 in varchar2,
322 p_attribute20 in varchar2
323 )
324 Return g_rec_type;
325 --
326 end per_cag_shd;