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