1 Package pqh_cpd_shd AUTHID CURRENT_USER as
2 /* $Header: pqcpdrhi.pkh 120.0 2005/05/29 01:44:45 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (corps_definition_id number(15)
10 ,business_group_id number(15)
11 ,name varchar2(240)
12 ,status_cd varchar2(30)
13 ,retirement_age number(10)
14 ,category_cd varchar2(30)
15 ,recruitment_end_date date
16 ,corps_type_cd varchar2(30)
17 ,starting_grade_step_id number(15)
18 ,task_desc varchar2(2000)
19 ,secondment_threshold number(9) -- Increased length
20 ,normal_hours number(15,3)
21 ,normal_hours_frequency varchar2(30)
22 ,minimum_hours number(15,3)
23 ,minimum_hours_frequency varchar2(30)
24 ,attribute1 varchar2(150)
25 ,attribute2 varchar2(150)
26 ,attribute3 varchar2(150)
27 ,attribute4 varchar2(150)
28 ,attribute5 varchar2(150)
29 ,attribute6 varchar2(150)
30 ,attribute7 varchar2(150)
31 ,attribute8 varchar2(150)
32 ,attribute9 varchar2(150)
33 ,attribute10 varchar2(150)
34 ,attribute11 varchar2(150)
35 ,attribute12 varchar2(150)
36 ,attribute13 varchar2(150)
37 ,attribute14 varchar2(150)
38 ,attribute15 varchar2(150)
39 ,attribute16 varchar2(150)
40 ,attribute17 varchar2(150)
41 ,attribute18 varchar2(150)
42 ,attribute19 varchar2(150)
43 ,attribute20 varchar2(150)
44 ,attribute21 varchar2(150)
45 ,attribute22 varchar2(150)
46 ,attribute23 varchar2(150)
47 ,attribute24 varchar2(150)
48 ,attribute25 varchar2(150)
49 ,attribute26 varchar2(150)
50 ,attribute27 varchar2(150)
51 ,attribute28 varchar2(150)
52 ,attribute29 varchar2(150)
53 ,attribute30 varchar2(150)
54 ,attribute_category varchar2(30)
55 ,object_version_number number(9)
56 ,type_of_ps varchar2(30)
57 ,date_from date
58 ,date_to date
59 ,primary_prof_field_id number(15)
60 ,starting_grade_id number(15)
61 ,ben_pgm_id number(15)
62 ,probation_period number(15,3)
63 ,probation_units varchar2(30)
64 );
65 --
66 -- ----------------------------------------------------------------------------
67 -- | Global Definitions - Internal Development Use Only |
68 -- ----------------------------------------------------------------------------
69 --
70 g_old_rec g_rec_type; -- Global record definition
71 -- Global table name
72 g_tab_nam constant varchar2(30) := 'PQH_CORPS_DEFINITIONS';
73 g_api_dml boolean; -- Global api dml status
74 --
75 -- ----------------------------------------------------------------------------
76 -- |------------------------< return_api_dml_status >-------------------------|
77 -- ----------------------------------------------------------------------------
78 -- {Start Of Comments}
79 --
80 -- Description:
81 -- This function will return the current g_api_dml private global
82 -- boolean status.
83 -- The g_api_dml status determines if at the time of the function
84 -- being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
85 -- is being issued from within an api.
86 -- If the status is TRUE then a dml statement is being issued from
87 -- within this entity api.
88 -- This function is primarily to support database triggers which
89 -- need to maintain the object_version_number for non-supported
90 -- dml statements (i.e. dml statement issued outside of the api layer).
91 --
92 -- Prerequisites:
93 -- None.
94 --
95 -- In Parameters:
96 -- None.
97 --
98 -- Post Success:
99 -- Processing continues.
100 -- If the function returns a TRUE value then, dml is being executed from
101 -- within this api.
102 --
103 -- Post Failure:
104 -- None.
105 --
106 -- Access Status:
107 -- Internal Row Handler Use Only.
108 --
109 -- {End Of Comments}
110 -- ----------------------------------------------------------------------------
111 Function return_api_dml_status Return Boolean;
112 --
113 -- ----------------------------------------------------------------------------
114 -- |---------------------------< constraint_error >---------------------------|
115 -- ----------------------------------------------------------------------------
116 -- {Start Of Comments}
117 --
118 -- Description:
119 -- This procedure is called when a constraint has been violated (i.e.
120 -- The exception hr_api.check_integrity_violated,
121 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
122 -- hr_api.unique_integrity_violated has been raised).
123 -- The exceptions can only be raised as follows:
124 -- 1) A check constraint can only be violated during an INSERT or UPDATE
125 -- dml operation.
126 -- 2) A parent integrity constraint can only be violated during an
127 -- INSERT or UPDATE dml operation.
128 -- 3) A child integrity constraint can only be violated during an
129 -- DELETE dml operation.
130 -- 4) A unique integrity constraint can only be violated during INSERT or
131 -- UPDATE dml operation.
132 --
133 -- Prerequisites:
134 -- 1) Either hr_api.check_integrity_violated,
135 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
136 -- hr_api.unique_integrity_violated has been raised with the subsequent
137 -- stripping of the constraint name from the generated error message
138 -- text.
139 -- 2) Standalone validation test which corresponds with a constraint error.
140 --
141 -- In Parameter:
142 -- p_constraint_name is in upper format and is just the constraint name
143 -- (e.g. not prefixed by brackets, schema owner etc).
144 --
145 -- Post Success:
146 -- Development dependant.
147 --
148 -- Post Failure:
149 -- Developement dependant.
150 --
151 -- Developer Implementation Notes:
152 -- For each constraint being checked the hr system package failure message
153 -- has been generated as a template only. These system error messages should
154 -- be modified as required (i.e. change the system failure message to a user
155 -- friendly defined error message).
156 --
157 -- Access Status:
158 -- Internal Development Use Only.
159 --
160 -- {End Of Comments}
161 -- ----------------------------------------------------------------------------
162 Procedure constraint_error
163 (p_constraint_name in all_constraints.constraint_name%TYPE);
164 --
165 -- ----------------------------------------------------------------------------
166 -- |-----------------------------< api_updating >-----------------------------|
167 -- ----------------------------------------------------------------------------
168 -- {Start Of Comments}
169 --
170 -- Description:
171 -- This function is used to populate the g_old_rec record with the
172 -- current row from the database for the specified primary key
173 -- provided that the primary key exists and is valid and does not
174 -- already match the current g_old_rec. The function will always return
175 -- a TRUE value if the g_old_rec is populated with the current row.
176 -- A FALSE value will be returned if all of the primary key arguments
177 -- are null.
178 --
179 -- Prerequisites:
180 -- None.
181 --
182 -- In Parameters:
183 --
184 -- Post Success:
185 -- A value of TRUE will be returned indiciating that the g_old_rec
186 -- is current.
187 -- A value of FALSE will be returned if all of the primary key arguments
188 -- have a null value (this indicates that the row has not be inserted into
189 -- the Schema), and therefore could never have a corresponding row.
190 --
191 -- Post Failure:
192 -- A failure can only occur under two circumstances:
193 -- 1) The primary key is invalid (i.e. a row does not exist for the
194 -- specified primary key values).
195 -- 2) If an object_version_number exists but is NOT the same as the current
196 -- g_old_rec value.
197 --
198 -- Developer Implementation Notes:
199 -- None.
200 --
201 -- Access Status:
202 -- Internal Development Use Only.
203 --
204 -- {End Of Comments}
205 -- ----------------------------------------------------------------------------
206 Function api_updating
207 (p_corps_definition_id in number
208 ,p_object_version_number in number
209 ) Return Boolean;
210 --
211 -- ----------------------------------------------------------------------------
212 -- |---------------------------------< lck >----------------------------------|
213 -- ----------------------------------------------------------------------------
214 -- {Start of comments}
215 --
216 -- Description:
217 -- The Lck process has two main functions to perform. Firstly, the row to be
218 -- updated or deleted must be locked. The locking of the row will only be
219 -- successful if the row is not currently locked by another user.
220 -- Secondly, during the locking of the row, the row is selected into
221 -- the g_old_rec data structure which enables the current row values from
222 -- the server to be available to the api.
223 --
224 -- Prerequisites:
225 -- When attempting to call the lock the object version number (if defined)
226 -- is mandatory.
227 --
228 -- In Parameters:
229 -- The arguments to the Lck process are the primary key(s) which uniquely
230 -- identify the row and the object version number of row.
231 --
232 -- Post Success:
233 -- On successful completion of the Lck process the row to be updated or
234 -- deleted will be locked and selected into the global data structure
235 -- g_old_rec.
236 --
237 -- Post Failure:
238 -- The Lck process can fail for three reasons:
239 -- 1) When attempting to lock the row the row could already be locked by
240 -- another user. This will raise the HR_Api.Object_Locked exception.
241 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
242 -- This error is trapped and reported using the message name
243 -- 'HR_7220_INVALID_PRIMARY_KEY'.
244 -- 3) The row although existing in the HR Schema has a different object
245 -- version number than the object version number specified.
246 -- This error is trapped and reported using the message name
247 -- 'HR_7155_OBJECT_INVALID'.
248 --
249 -- Developer Implementation Notes:
250 -- For each primary key and the object version number arguments add a
251 -- call to hr_api.mandatory_arg_error procedure to ensure that these
252 -- argument values are not null.
253 --
254 -- Access Status:
255 -- Internal Development Use Only.
256 --
257 -- {End of comments}
258 -- ----------------------------------------------------------------------------
259 Procedure lck
260 (p_corps_definition_id in number
261 ,p_object_version_number in number
262 );
263 --
264 -- ----------------------------------------------------------------------------
265 -- |-----------------------------< convert_args >-----------------------------|
266 -- ----------------------------------------------------------------------------
267 -- {Start Of Comments}
268 --
269 -- Description:
270 -- This function is used to turn attribute parameters into the record
271 -- structure parameter g_rec_type.
272 --
273 -- Prerequisites:
274 -- This is a private function and can only be called from the ins or upd
275 -- attribute processes.
276 --
277 -- In Parameters:
278 --
279 -- Post Success:
280 -- A returning record structure will be returned.
281 --
282 -- Post Failure:
283 -- No direct error handling is required within this function. Any possible
284 -- errors within this function will be a PL/SQL value error due to
285 -- conversion of datatypes or data lengths.
286 --
287 -- Developer Implementation Notes:
288 -- None.
289 --
290 -- Access Status:
291 -- Internal Row Handler Use Only.
292 --
293 -- {End Of Comments}
294 -- ----------------------------------------------------------------------------
295 Function convert_args
296 (p_corps_definition_id in number
297 ,p_business_group_id in number
298 ,p_name in varchar2
299 ,p_status_cd in varchar2
300 ,p_retirement_age in number
301 ,p_category_cd in varchar2
302 ,p_recruitment_end_date in date
303 ,p_corps_type_cd in varchar2
304 ,p_starting_grade_step_id in number
305 ,p_task_desc in varchar2
306 ,p_secondment_threshold in number
307 ,p_normal_hours in number
308 ,p_normal_hours_frequency in varchar2
309 ,p_minimum_hours in number
310 ,p_minimum_hours_frequency in varchar2
311 ,p_attribute1 in varchar2
312 ,p_attribute2 in varchar2
313 ,p_attribute3 in varchar2
314 ,p_attribute4 in varchar2
315 ,p_attribute5 in varchar2
316 ,p_attribute6 in varchar2
317 ,p_attribute7 in varchar2
318 ,p_attribute8 in varchar2
319 ,p_attribute9 in varchar2
320 ,p_attribute10 in varchar2
321 ,p_attribute11 in varchar2
322 ,p_attribute12 in varchar2
323 ,p_attribute13 in varchar2
324 ,p_attribute14 in varchar2
325 ,p_attribute15 in varchar2
326 ,p_attribute16 in varchar2
327 ,p_attribute17 in varchar2
328 ,p_attribute18 in varchar2
329 ,p_attribute19 in varchar2
330 ,p_attribute20 in varchar2
331 ,p_attribute21 in varchar2
332 ,p_attribute22 in varchar2
333 ,p_attribute23 in varchar2
334 ,p_attribute24 in varchar2
335 ,p_attribute25 in varchar2
336 ,p_attribute26 in varchar2
337 ,p_attribute27 in varchar2
338 ,p_attribute28 in varchar2
339 ,p_attribute29 in varchar2
340 ,p_attribute30 in varchar2
341 ,p_attribute_category in varchar2
342 ,p_object_version_number in number
343 ,p_type_of_ps in varchar2
344 ,p_date_from in date
345 ,p_date_to in date
346 ,p_primary_prof_field_id in number
347 ,p_starting_grade_id in number
348 ,p_ben_pgm_id in number
349 ,p_probation_period in number
350 ,p_probation_units in varchar2
351 )
352 Return g_rec_type;
353 --
354 end pqh_cpd_shd;