1 Package pqp_shp_shd AUTHID CURRENT_USER as
2 /* $Header: pqshprhi.pkh 120.0 2005/05/29 02:11:54 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (service_history_period_id number(15)
10 ,business_group_id number(15)
11 ,assignment_id number(15)
12 ,start_date date
13 ,end_date date
14 ,employer_name varchar2(80)
15 ,employer_address varchar2(240)
16 ,employer_type varchar2(80)
17 ,employer_subtype varchar2(80)
18 ,period_years number(15)
19 ,period_days number(15)
20 ,description varchar2(240)
21 ,continuous_service varchar2(240)
22 ,all_assignments varchar2(30)
23 ,object_version_number number(15)
24 ,shp_attribute_category varchar2(30)
25 ,shp_attribute1 varchar2(150)
26 ,shp_attribute2 varchar2(150)
27 ,shp_attribute3 varchar2(150)
28 ,shp_attribute4 varchar2(150)
29 ,shp_attribute5 varchar2(150)
30 ,shp_attribute6 varchar2(150)
31 ,shp_attribute7 varchar2(150)
32 ,shp_attribute8 varchar2(150)
33 ,shp_attribute9 varchar2(150)
34 ,shp_attribute10 varchar2(150)
35 ,shp_attribute11 varchar2(150)
36 ,shp_attribute12 varchar2(150)
37 ,shp_attribute13 varchar2(150)
38 ,shp_attribute14 varchar2(150)
39 ,shp_attribute15 varchar2(150)
40 ,shp_attribute16 varchar2(150)
41 ,shp_attribute17 varchar2(150)
42 ,shp_attribute18 varchar2(150)
43 ,shp_attribute19 varchar2(150)
44 ,shp_attribute20 varchar2(150)
45 ,shp_information_category varchar2(30)
46 ,shp_information1 varchar2(150)
47 ,shp_information2 varchar2(150)
48 ,shp_information3 varchar2(150)
49 ,shp_information4 varchar2(150)
50 ,shp_information5 varchar2(150)
51 ,shp_information6 varchar2(150)
52 ,shp_information7 varchar2(150)
53 ,shp_information8 varchar2(150)
54 ,shp_information9 varchar2(150)
55 ,shp_information10 varchar2(150)
56 ,shp_information11 varchar2(150)
57 ,shp_information12 varchar2(150)
58 ,shp_information13 varchar2(150)
59 ,shp_information14 varchar2(150)
60 ,shp_information15 varchar2(150)
61 ,shp_information16 varchar2(150)
62 ,shp_information17 varchar2(150)
63 ,shp_information18 varchar2(150)
64 ,shp_information19 varchar2(150)
65 ,shp_information20 varchar2(150)
66 );
67 --
68 -- ----------------------------------------------------------------------------
69 -- | Global Definitions - Internal Development Use Only |
70 -- ----------------------------------------------------------------------------
71 --
72 g_old_rec g_rec_type; -- Global record definition
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_service_history_period_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 the
222 -- 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_service_history_period_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 conversion
285 -- 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_service_history_period_id in number
297 ,p_business_group_id in number
298 ,p_assignment_id in number
299 ,p_start_date in date
300 ,p_end_date in date
301 ,p_employer_name in varchar2
302 ,p_employer_address in varchar2
303 ,p_employer_type in varchar2
304 ,p_employer_subtype in varchar2
305 ,p_period_years in number
306 ,p_period_days in number
307 ,p_description in varchar2
308 ,p_continuous_service in varchar2
309 ,p_all_assignments in varchar2
310 ,p_object_version_number in number
311 ,p_shp_attribute_category in varchar2
312 ,p_shp_attribute1 in varchar2
313 ,p_shp_attribute2 in varchar2
314 ,p_shp_attribute3 in varchar2
315 ,p_shp_attribute4 in varchar2
316 ,p_shp_attribute5 in varchar2
317 ,p_shp_attribute6 in varchar2
318 ,p_shp_attribute7 in varchar2
319 ,p_shp_attribute8 in varchar2
320 ,p_shp_attribute9 in varchar2
321 ,p_shp_attribute10 in varchar2
322 ,p_shp_attribute11 in varchar2
323 ,p_shp_attribute12 in varchar2
324 ,p_shp_attribute13 in varchar2
325 ,p_shp_attribute14 in varchar2
326 ,p_shp_attribute15 in varchar2
327 ,p_shp_attribute16 in varchar2
328 ,p_shp_attribute17 in varchar2
329 ,p_shp_attribute18 in varchar2
330 ,p_shp_attribute19 in varchar2
331 ,p_shp_attribute20 in varchar2
332 ,p_shp_information_category in varchar2
333 ,p_shp_information1 in varchar2
334 ,p_shp_information2 in varchar2
335 ,p_shp_information3 in varchar2
336 ,p_shp_information4 in varchar2
337 ,p_shp_information5 in varchar2
338 ,p_shp_information6 in varchar2
339 ,p_shp_information7 in varchar2
340 ,p_shp_information8 in varchar2
341 ,p_shp_information9 in varchar2
342 ,p_shp_information10 in varchar2
343 ,p_shp_information11 in varchar2
344 ,p_shp_information12 in varchar2
345 ,p_shp_information13 in varchar2
346 ,p_shp_information14 in varchar2
347 ,p_shp_information15 in varchar2
348 ,p_shp_information16 in varchar2
349 ,p_shp_information17 in varchar2
350 ,p_shp_information18 in varchar2
351 ,p_shp_information19 in varchar2
352 ,p_shp_information20 in varchar2
353 )
354 Return g_rec_type;
355 --
356 end pqp_shp_shd;