1 Package ssp_mat_shd AUTHID CURRENT_USER as
2 /* $Header: spmatrhi.pkh 120.3 2010/11/27 16:32:44 npannamp ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (
10 maternity_id number(9),
11 due_date date,
12 person_id number(10),
13 start_date_maternity_allowance date,
14 notification_of_birth_date date,
15 unfit_for_scheduled_return varchar2(30),
16 stated_return_date date,
17 intend_to_return_flag varchar2(30),
18 start_date_with_new_employer date,
19 smp_must_be_paid_by_date date,
20 pay_smp_as_lump_sum varchar2(30),
21 live_birth_flag varchar2(30),
22 actual_birth_date date,
23 mpp_start_date date,
24 object_version_number number(9),
25 attribute_category varchar2(30),
26 attribute1 varchar2(150),
27 attribute2 varchar2(150),
28 attribute3 varchar2(150),
29 attribute4 varchar2(150),
30 attribute5 varchar2(150),
31 attribute6 varchar2(150),
32 attribute7 varchar2(150),
33 attribute8 varchar2(150),
34 attribute9 varchar2(150),
35 attribute10 varchar2(150),
36 attribute11 varchar2(150),
37 attribute12 varchar2(150),
38 attribute13 varchar2(150),
39 attribute14 varchar2(150),
40 attribute15 varchar2(150),
41 attribute16 varchar2(150),
42 attribute17 varchar2(150),
43 attribute18 varchar2(150),
44 attribute19 varchar2(150),
45 attribute20 varchar2(150),
46 LEAVE_TYPE VARCHAR2(2),
47 MATCHING_DATE DATE,
48 PLACEMENT_DATE DATE,
49 DISRUPTED_PLACEMENT_DATE DATE,
50 mat_information_category varchar2(30),
51 mat_information1 varchar2(150),
52 mat_information2 varchar2(150),
53 mat_information3 varchar2(150),
54 mat_information4 varchar2(150),
55 mat_information5 varchar2(150),
56 mat_information6 varchar2(150),
57 mat_information7 varchar2(150),
58 mat_information8 varchar2(150),
59 mat_information9 varchar2(150),
60 mat_information10 varchar2(150),
61 mat_information11 varchar2(150),
62 mat_information12 varchar2(150),
63 mat_information13 varchar2(150),
64 mat_information14 varchar2(150),
65 mat_information15 varchar2(150),
66 mat_information16 varchar2(150),
67 mat_information17 varchar2(150),
68 mat_information18 varchar2(150),
69 mat_information19 varchar2(150),
70 mat_information20 varchar2(150),
71 mat_information21 varchar2(150),
72 mat_information22 varchar2(150),
73 mat_information23 varchar2(150),
74 mat_information24 varchar2(150),
75 mat_information25 varchar2(150),
76 mat_information26 varchar2(150),
77 mat_information27 varchar2(150),
78 mat_information28 varchar2(150),
79 mat_information29 varchar2(150),
80 mat_information30 varchar2(150),
81 partner_stat_pay_start_date date ,
82 partner_return_to_work date ,
83 partner_death_date date
84 );
85 --
86 -- ----------------------------------------------------------------------------
87 -- | Global Definitions - Internal Development Use Only |
88 -- ----------------------------------------------------------------------------
89 --
90 g_old_rec g_rec_type; -- Global record definition
91 g_api_dml boolean; -- Global api dml status
92 --
93 -- ----------------------------------------------------------------------------
94 -- |------------------------< return_api_dml_status >-------------------------|
95 -- ----------------------------------------------------------------------------
96 -- {Start Of Comments}
97 --
98 -- Description:
99 -- This function will return the current g_api_dml private global
100 -- boolean status.
101 -- The g_api_dml status determines if at the time of the function
102 -- being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
103 -- is being issued from within an api.
104 -- If the status is TRUE then a dml statement is being issued from
105 -- within this entity api.
106 -- This function is primarily to support database triggers which
107 -- need to maintain the object_version_number for non-supported
108 -- dml statements (i.e. dml statement issued outside of the api layer).
109 --
110 -- Pre Conditions:
111 -- None.
112 --
113 -- In Parameters:
114 -- None.
115 --
116 -- Post Success:
117 -- Processing continues.
118 -- If the function returns a TRUE value then, dml is being executed from
119 -- within this api.
120 --
121 -- Post Failure:
122 -- None.
123 --
124 -- Access Status:
125 -- Internal Table Handler Use Only.
126 --
127 -- {End Of Comments}
128 -- ----------------------------------------------------------------------------
129 Function return_api_dml_status Return Boolean;
130 --
131 -- ----------------------------------------------------------------------------
132 -- |---------------------------< constraint_error >---------------------------|
133 -- ----------------------------------------------------------------------------
134 -- {Start Of Comments}
135 --
136 -- Description:
137 -- This procedure is called when a constraint has been violated (i.e.
138 -- The exception hr_api.check_integrity_violated,
139 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
140 -- hr_api.unique_integrity_violated has been raised).
141 -- The exceptions can only be raised as follows:
142 -- 1) A check constraint can only be violated during an INSERT or UPDATE
143 -- dml operation.
144 -- 2) A parent integrity constraint can only be violated during an
145 -- INSERT or UPDATE dml operation.
146 -- 3) A child integrity constraint can only be violated during an
147 -- DELETE dml operation.
148 -- 4) A unique integrity constraint can only be violated during INSERT or
149 -- UPDATE dml operation.
150 --
151 -- Pre Conditions:
152 -- 1) Either hr_api.check_integrity_violated,
153 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
154 -- hr_api.unique_integrity_violated has been raised with the subsequent
155 -- stripping of the constraint name from the generated error message
156 -- text.
157 -- 2) Standalone validation test which corresponds with a constraint error.
158 --
159 -- In Parameter:
160 -- p_constraint_name is in upper format and is just the constraint name
161 -- (e.g. not prefixed by brackets, schema owner etc).
162 --
163 -- Post Success:
164 -- Development dependant.
165 --
166 -- Post Failure:
167 -- Developement dependant.
168 --
169 -- Developer Implementation Notes:
170 -- For each constraint being checked the hr system package failure message
171 -- has been generated as a template only. These system error messages should
172 -- be modified as required (i.e. change the system failure message to a user
173 -- friendly defined error message).
174 --
175 -- Access Status:
176 -- Internal Development Use Only.
177 --
178 -- {End Of Comments}
179 -- ----------------------------------------------------------------------------
180 Procedure constraint_error
181 (p_constraint_name in all_constraints.constraint_name%TYPE);
182 --
183 -- ----------------------------------------------------------------------------
184 -- |-----------------------------< api_updating >-----------------------------|
185 -- ----------------------------------------------------------------------------
186 -- {Start Of Comments}
187 --
188 -- Description:
189 -- This function is used to populate the g_old_rec record with the
190 -- current row from the database for the specified primary key
191 -- provided that the primary key exists and is valid and does not
192 -- already match the current g_old_rec. The function will always return
193 -- a TRUE value if the g_old_rec is populated with the current row.
194 -- A FALSE value will be returned if all of the primary key arguments
195 -- are null.
196 --
197 -- Pre Conditions:
198 -- None.
199 --
200 -- In Parameters:
201 --
202 -- Post Success:
203 -- A value of TRUE will be returned indiciating that the g_old_rec
204 -- is current.
205 -- A value of FALSE will be returned if all of the primary key arguments
206 -- have a null value (this indicates that the row has not be inserted into
207 -- the Schema), and therefore could never have a corresponding row.
208 --
209 -- Post Failure:
210 -- A failure can only occur under two circumstances:
211 -- 1) The primary key is invalid (i.e. a row does not exist for the
212 -- specified primary key values).
213 -- 2) If an object_version_number exists but is NOT the same as the current
214 -- g_old_rec value.
215 --
216 -- Developer Implementation Notes:
217 -- None.
218 --
219 -- Access Status:
220 -- Internal Development Use Only.
221 --
222 -- {End Of Comments}
223 -- ----------------------------------------------------------------------------
224 Function api_updating
225 (
226 p_maternity_id in number,
227 p_object_version_number in number
228 ) Return Boolean;
229 --
230 -- ----------------------------------------------------------------------------
231 -- |---------------------------------< lck >----------------------------------|
232 -- ----------------------------------------------------------------------------
233 -- {Start Of Comments}
234 --
235 -- Description:
236 -- The Lck process has two main functions to perform. Firstly, the row to be
237 -- updated or deleted must be locked. The locking of the row will only be
238 -- successful if the row is not currently locked by another user.
239 -- Secondly, during the locking of the row, the row is selected into
240 -- the g_old_rec data structure which enables the current row values from the
241 -- server to be available to the api.
242 --
243 -- Pre Conditions:
244 -- When attempting to call the lock the object version number (if defined)
245 -- is mandatory.
246 --
247 -- In Parameters:
248 -- The arguments to the Lck process are the primary key(s) which uniquely
249 -- identify the row and the object version number of row.
250 --
251 -- Post Success:
252 -- On successful completion of the Lck process the row to be updated or
253 -- deleted will be locked and selected into the global data structure
254 -- g_old_rec.
255 --
256 -- Post Failure:
257 -- The Lck process can fail for three reasons:
258 -- 1) When attempting to lock the row the row could already be locked by
259 -- another user. This will raise the HR_Api.Object_Locked exception.
260 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
261 -- This error is trapped and reported using the message name
262 -- 'HR_7220_INVALID_PRIMARY_KEY'.
263 -- 3) The row although existing in the HR Schema has a different object
264 -- version number than the object version number specified.
265 -- This error is trapped and reported using the message name
266 -- 'HR_7155_OBJECT_INVALID'.
267 --
268 -- Developer Implementation Notes:
269 -- For each primary key and the object version number arguments add a
270 -- call to hr_api.mandatory_arg_error procedure to ensure that these
271 -- argument values are not null.
272 --
273 -- Access Status:
274 -- Internal Development Use Only.
275 --
276 -- {End Of Comments}
277 -- ----------------------------------------------------------------------------
278 Procedure lck
279 (
280 p_maternity_id in number,
281 p_object_version_number in number
282 );
283 --
284 -- ----------------------------------------------------------------------------
285 -- |-----------------------------< convert_args >-----------------------------|
286 -- ----------------------------------------------------------------------------
287 -- {Start Of Comments}
288 --
289 -- Description:
290 -- This function is used to turn attribute parameters into the record
291 -- structure parameter g_rec_type.
292 --
293 -- Pre Conditions:
294 -- This is a private function and can only be called from the ins or upd
295 -- attribute processes.
296 --
297 -- In Parameters:
298 --
299 -- Post Success:
300 -- A returning record structure will be returned.
301 --
302 -- Post Failure:
303 -- No direct error handling is required within this function. Any possible
304 -- errors within this function will be a PL/SQL value error due to conversion
305 -- of datatypes or data lengths.
306 --
307 -- Developer Implementation Notes:
308 -- None.
309 --
310 -- Access Status:
311 -- Internal Table Handler Use Only.
312 --
313 -- {End Of Comments}
314 -- ----------------------------------------------------------------------------
315 Function convert_args
316 (
317 p_maternity_id in number,
318 p_due_date in date,
319 p_person_id in number,
320 p_start_date_SMA in date,
321 p_notification_of_birth_date in date,
322 p_unfit_for_scheduled_return in varchar2,
323 p_stated_return_date in date,
324 p_intend_to_return_flag in varchar2,
325 p_start_date_with_new_employer in date,
326 p_smp_must_be_paid_by_date in date,
327 p_pay_smp_as_lump_sum in varchar2,
328 p_live_birth_flag in varchar2,
329 p_actual_birth_date in date,
330 p_mpp_start_date in date,
331 p_object_version_number in number,
332 p_attribute_category in varchar2,
333 p_attribute1 in varchar2,
334 p_attribute2 in varchar2,
335 p_attribute3 in varchar2,
336 p_attribute4 in varchar2,
337 p_attribute5 in varchar2,
338 p_attribute6 in varchar2,
339 p_attribute7 in varchar2,
340 p_attribute8 in varchar2,
341 p_attribute9 in varchar2,
342 p_attribute10 in varchar2,
343 p_attribute11 in varchar2,
344 p_attribute12 in varchar2,
345 p_attribute13 in varchar2,
346 p_attribute14 in varchar2,
347 p_attribute15 in varchar2,
348 p_attribute16 in varchar2,
349 p_attribute17 in varchar2,
350 p_attribute18 in varchar2,
351 p_attribute19 in varchar2,
352 p_attribute20 in varchar2,
353 p_LEAVE_TYPE in VARCHAR2 default 'MA',
354 p_MATCHING_DATE in DATE default null,
355 p_PLACEMENT_DATE in DATE default null,
356 p_DISRUPTED_PLACEMENT_DATE in DATE default null,
357 p_mat_information_category in varchar2,
358 p_mat_information1 in varchar2,
359 p_mat_information2 in varchar2,
365 p_mat_information8 in varchar2,
360 p_mat_information3 in varchar2,
361 p_mat_information4 in varchar2,
362 p_mat_information5 in varchar2,
363 p_mat_information6 in varchar2,
364 p_mat_information7 in varchar2,
366 p_mat_information9 in varchar2,
367 p_mat_information10 in varchar2,
368 p_mat_information11 in varchar2,
369 p_mat_information12 in varchar2,
370 p_mat_information13 in varchar2,
371 p_mat_information14 in varchar2,
372 p_mat_information15 in varchar2,
373 p_mat_information16 in varchar2,
374 p_mat_information17 in varchar2,
375 p_mat_information18 in varchar2,
376 p_mat_information19 in varchar2,
377 p_mat_information20 in varchar2,
378 p_mat_information21 in varchar2,
379 p_mat_information22 in varchar2,
380 p_mat_information23 in varchar2,
381 p_mat_information24 in varchar2,
382 p_mat_information25 in varchar2,
383 p_mat_information26 in varchar2,
384 p_mat_information27 in varchar2,
385 p_mat_information28 in varchar2,
386 p_mat_information29 in varchar2,
387 p_mat_information30 in varchar2,
388 p_partner_stat_pay_start_date in date,
389 p_partner_return_to_work in date,
390 p_partner_death_date in date
391 )
392 Return g_rec_type;
393 --
394 end ssp_mat_shd;