1 Package per_vac_shd AUTHID CURRENT_USER as
2 /* $Header: pevacrhi.pkh 120.1 2010/12/24 11:50:34 avarri ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (vacancy_id number(15)
10 ,business_group_id number(15)
11 ,position_id number(15)
12 ,job_id number(15)
13 ,grade_id number(15)
14 ,organization_id number(15)
15 ,requisition_id number(15)
16 ,people_group_id number(15)
17 ,location_id number(15)
18 ,recruiter_id number(10)
19 ,date_from date
20 ,name varchar2(30)
21 ,comments varchar2(2000)
22 ,date_to date
23 ,description varchar2(80)
24 ,number_of_openings number(9)
25 ,status varchar2(30)
26 ,request_id number(15)
27 ,program_application_id number(15)
28 ,program_id number(15)
29 ,program_update_date date
30 ,attribute_category varchar2(30)
31 ,attribute1 varchar2(150)
32 ,attribute2 varchar2(150)
33 ,attribute3 varchar2(150)
34 ,attribute4 varchar2(150)
35 ,attribute5 varchar2(150)
36 ,attribute6 varchar2(150)
37 ,attribute7 varchar2(150)
38 ,attribute8 varchar2(150)
39 ,attribute9 varchar2(150)
40 ,attribute10 varchar2(150)
41 ,attribute11 varchar2(150)
42 ,attribute12 varchar2(150)
43 ,attribute13 varchar2(150)
44 ,attribute14 varchar2(150)
45 ,attribute15 varchar2(150)
46 ,attribute16 varchar2(150)
47 ,attribute17 varchar2(150)
48 ,attribute18 varchar2(150)
49 ,attribute19 varchar2(150)
50 ,attribute20 varchar2(150)
51 ,vacancy_category varchar2(80)
52 ,vacancy_region_type varchar2(30)
53 ,budget_measurement_type varchar2(30)
54 ,budget_measurement_value number(22,2)
55 ,manager_id number(15)
56 ,security_method varchar2(30)
57 ,primary_posting_id number(15)
58 ,assessment_id number(15)
59 ,object_version_number number(9)
60 );
61 --
62 -- ----------------------------------------------------------------------------
63 -- | Global Definitions - Internal Development Use Only |
64 -- ----------------------------------------------------------------------------
65 --
66 g_old_rec g_rec_type; -- Global record definition
67 g_tab_name constant varchar2(30) :='PER_ALL_VACANCIES';
68 g_api_dml boolean; -- Global api dml status
69 --
70 -- ----------------------------------------------------------------------------
71 -- |------------------------< return_api_dml_status >-------------------------|
72 -- ----------------------------------------------------------------------------
73 -- {Start Of Comments}
74 --
75 -- Description:
76 -- This function will return the current g_api_dml private global
77 -- boolean status.
78 -- The g_api_dml status determines if at the time of the function
79 -- being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
80 -- is being issued from within an api.
81 -- If the status is TRUE then a dml statement is being issued from
82 -- within this entity api.
83 -- This function is primarily to support database triggers which
84 -- need to maintain the object_version_number for non-supported
85 -- dml statements (i.e. dml statement issued outside of the api layer).
86 --
87 -- Prerequisites:
88 -- none
89 --
90 -- In Parameters:
91 -- None.
92 --
93 -- Post Success:
94 -- Processing continues.
95 -- If the function returns a TRUE value then, dml is being executed from
96 -- within this api.
97 --
98 -- Post Failure:
99 -- None.
100 --
101 -- Access Status:
102 -- Internal Row Handler Use Only.
103 --
104 -- {End Of Comments}
105 --
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 (p_vacancy_id in number
204 ,p_object_version_number in number
205 ) Return Boolean;
206 --
207 -- ----------------------------------------------------------------------------
208 -- |---------------------------------< lck >----------------------------------|
209 -- ----------------------------------------------------------------------------
210 -- {Start of comments}
211 --
212 -- Description:
213 -- The Lck process has two main functions to perform. Firstly, the row to be
214 -- updated or deleted must be locked. The locking of the row will only be
215 -- successful if the row is not currently locked by another user.
216 -- Secondly, during the locking of the row, the row is selected into
217 -- the g_old_rec data structure which enables the current row values from
218 -- the server to be available to the api.
219 --
220 -- Prerequisites:
221 -- When attempting to call the lock the object version number (if defined)
222 -- is mandatory.
223 --
224 -- In Parameters:
225 -- The arguments to the Lck process are the primary key(s) which uniquely
226 -- identify the row and the object version number of row.
227 --
228 -- Post Success:
229 -- On successful completion of the Lck process the row to be updated or
230 -- deleted will be locked and selected into the global data structure
231 -- g_old_rec.
232 --
233 -- Post Failure:
234 -- The Lck process can fail for three reasons:
235 -- 1) When attempting to lock the row the row could already be locked by
236 -- another user. This will raise the HR_Api.Object_Locked exception.
237 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
238 -- This error is trapped and reported using the message name
239 -- 'HR_7220_INVALID_PRIMARY_KEY'.
240 -- 3) The row although existing in the HR Schema has a different object
241 -- version number than the object version number specified.
242 -- This error is trapped and reported using the message name
243 -- 'HR_7155_OBJECT_INVALID'.
244 --
245 -- Developer Implementation Notes:
246 -- For each primary key and the object version number arguments add a
247 -- call to hr_api.mandatory_arg_error procedure to ensure that these
248 -- argument values are not null.
249 --
250 -- Access Status:
251 -- Internal Development Use Only.
252 --
253 -- {End of comments}
254 -- ----------------------------------------------------------------------------
255 Procedure lck
256 (p_vacancy_id in number
257 ,p_object_version_number in number
258 );
259 --
260 -- ----------------------------------------------------------------------------
261 -- |-----------------------------< convert_args >-----------------------------|
262 -- ----------------------------------------------------------------------------
263 -- {Start Of Comments}
264 --
265 -- Description:
266 -- This function is used to turn attribute parameters into the record
267 -- structure parameter g_rec_type.
268 --
269 -- Prerequisites:
270 -- This is a private function and can only be called from the ins or upd
271 -- attribute processes.
272 --
273 -- In Parameters:
274 --
275 -- Post Success:
276 -- A returning record structure will be returned.
277 --
278 -- Post Failure:
279 -- No direct error handling is required within this function. Any possible
280 -- errors within this function will be a PL/SQL value error due to
281 -- conversion of datatypes or data lengths.
282 --
283 -- Developer Implementation Notes:
284 -- None.
285 --
286 -- Access Status:
287 -- Internal Row Handler Use Only.
288 --
289 -- {End Of Comments}
290 -- ----------------------------------------------------------------------------
291 Function convert_args
292 (p_vacancy_id in number
293 ,p_business_group_id in number
294 ,p_position_id in number
295 ,p_job_id in number
296 ,p_grade_id in number
297 ,p_organization_id in number
298 ,p_requisition_id in number
299 ,p_people_group_id in number
300 ,p_location_id in number
301 ,p_recruiter_id in number
302 ,p_date_from in date
303 ,p_name in varchar2
304 ,p_comments in varchar2
305 ,p_date_to in date
306 ,p_description in varchar2
307 ,p_number_of_openings in number
308 ,p_status in varchar2
309 ,p_request_id in number
310 ,p_program_application_id in number
311 ,p_program_id in number
312 ,p_program_update_date in date
313 ,p_attribute_category in varchar2
314 ,p_attribute1 in varchar2
315 ,p_attribute2 in varchar2
316 ,p_attribute3 in varchar2
317 ,p_attribute4 in varchar2
318 ,p_attribute5 in varchar2
319 ,p_attribute6 in varchar2
320 ,p_attribute7 in varchar2
321 ,p_attribute8 in varchar2
322 ,p_attribute9 in varchar2
323 ,p_attribute10 in varchar2
324 ,p_attribute11 in varchar2
325 ,p_attribute12 in varchar2
326 ,p_attribute13 in varchar2
327 ,p_attribute14 in varchar2
328 ,p_attribute15 in varchar2
329 ,p_attribute16 in varchar2
330 ,p_attribute17 in varchar2
331 ,p_attribute18 in varchar2
332 ,p_attribute19 in varchar2
333 ,p_attribute20 in varchar2
334 ,p_vacancy_category in varchar2
335 ,p_vacancy_region_type in varchar2
336 ,p_budget_measurement_type in varchar2
337 ,p_budget_measurement_value in number
338 ,p_manager_id in number
339 ,p_security_method in varchar2
340 ,p_primary_posting_id in number
341 ,p_assessment_id in number
342 ,p_object_version_number in number
343 )
344 Return g_rec_type;
345 --
346 end per_vac_shd;