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