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