1 Package per_za_ass_shd AUTHID CURRENT_USER as
2 /* $Header: pezaassh.pkh 115.0 2001/02/04 22:31:07 pkm ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_za_rec_type Is Record
9 (
10 assessment_id number(9),
11 person_id number(9),
12 level_id number(9),
13 name_of_assessor varchar2(120),
14 institution varchar2(120),
15 credit number(10),
16 date_of_assessment date,
17 final_result varchar2(120),
18 assessment_number varchar2(10),
19 location_where_assessed varchar2(200),
20 field_of_learning varchar2(30),
21 sub_field varchar2(120),
22 assessment_start_date date,
23 assessment_end_date date,
24 competence_acquired varchar2(30),
25 ETQA_name varchar2(30),
26 certification_date date,
27 certificate_number varchar2(30),
28 accredited_by varchar2(80),
29 date_of_accreditation date,
30 certification_expiry_date date
31 );
32 --
33 -- ----------------------------------------------------------------------------
34 -- | Global Definitions - Internal Development Use Only |
35 -- ----------------------------------------------------------------------------
36 --
37 g_old_rec g_za_rec_type; -- Global record definition
38 g_api_dml boolean; -- Global api dml status
39 --
40 -- ----------------------------------------------------------------------------
41 -- |------------------------< return_api_dml_status >-------------------------|
42 -- ----------------------------------------------------------------------------
43 -- {Start Of Comments}
44 --
45 -- Description:
46 -- This function will return the current g_api_dml private global
47 -- boolean status.
48 -- The g_api_dml status determines if at the time of the function
49 -- being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
50 -- is being issued from within an api.
51 -- If the status is TRUE then a dml statement is being issued from
52 -- within this entity api.
53 -- This function is primarily to support database triggers which
54 -- need to maintain the object_version_number for non-supported
55 -- dml statements (i.e. dml statement issued outside of the api layer).
56 --
57 -- Pre Conditions:
58 -- None.
59 --
60 -- In Parameters:
61 -- None.
62 --
63 -- Post Success:
64 -- Processing continues.
65 -- If the function returns a TRUE value then, dml is being executed from
66 -- within this api.
67 --
68 -- Post Failure:
69 -- None.
70 --
71 -- Access Status:
72 -- Internal Table Handler Use Only.
73 --
74 -- {End Of Comments}
75 -- ----------------------------------------------------------------------------
76 Function return_api_dml_status Return Boolean;
77 --
78 -- ----------------------------------------------------------------------------
79 -- |---------------------------< constraint_error >---------------------------|
80 -- ----------------------------------------------------------------------------
81 -- {Start Of Comments}
82 --
83 -- Description:
84 -- This procedure is called when a constraint has been violated (i.e.
85 -- The exception hr_api.check_integrity_violated,
86 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
87 -- hr_api.unique_integrity_violated has been raised).
88 -- The exceptions can only be raised as follows:
89 -- 1) A check constraint can only be violated during an INSERT or UPDATE
90 -- dml operation.
91 -- 2) A parent integrity constraint can only be violated during an
92 -- INSERT or UPDATE dml operation.
93 -- 3) A child integrity constraint can only be violated during an
94 -- DELETE dml operation.
95 -- 4) A unique integrity constraint can only be violated during INSERT or
96 -- UPDATE dml operation.
97 --
98 -- Pre Conditions:
99 -- 1) Either hr_api.check_integrity_violated,
100 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
101 -- hr_api.unique_integrity_violated has been raised with the subsequent
102 -- stripping of the constraint name from the generated error message
103 -- text.
104 -- 2) Standalone validation test which corresponds with a constraint error.
105 --
106 -- In Parameter:
107 -- p_constraint_name is in upper format and is just the constraint name
108 -- (e.g. not prefixed by brackets, schema owner etc).
109 --
110 -- Post Success:
111 -- Development dependant.
112 --
113 -- Post Failure:
114 -- Developement dependant.
115 --
116 -- Developer Implementation Notes:
117 -- For each constraint being checked the hr system package failure message
118 -- has been generated as a template only. These system error messages should
119 -- be modified as required (i.e. change the system failure message to a user
120 -- friendly defined error message).
121 --
122 -- Access Status:
123 -- Internal Development Use Only.
124 --
125 -- {End Of Comments}
126 -- ----------------------------------------------------------------------------
127 Procedure constraint_error
128 (p_constraint_name in all_constraints.constraint_name%TYPE);
129 --
130 -- ----------------------------------------------------------------------------
131 -- |-----------------------------< api_updating >-----------------------------|
132 -- ----------------------------------------------------------------------------
133 -- {Start Of Comments}
134 --
135 -- Description:
136 -- This function is used to populate the g_old_rec record with the
137 -- current row from the database for the specified primary key
138 -- provided that the primary key exists and is valid and does not
139 -- already match the current g_old_rec. The function will always return
140 -- a TRUE value if the g_old_rec is populated with the current row.
141 -- A FALSE value will be returned if all of the primary key arguments
142 -- are null.
143 --
144 -- Pre Conditions:
145 -- None.
146 --
147 -- In Parameters:
148 --
149 -- Post Success:
150 -- A value of TRUE will be returned indiciating that the g_old_rec
151 -- is current.
152 -- A value of FALSE will be returned if all of the primary key arguments
153 -- have a null value (this indicates that the row has not be inserted into
154 -- the Schema), and therefore could never have a corresponding row.
155 --
156 -- Post Failure:
157 -- A failure can only occur under two circumstances:
158 -- 1) The primary key is invalid (i.e. a row does not exist for the
159 -- specified primary key values).
160 -- 2) If an object_version_number exists but is NOT the same as the current
161 -- g_old_rec value.
162 --
163 -- Developer Implementation Notes:
164 -- None.
165 --
166 -- Access Status:
167 -- Internal Development Use Only.
168 --
169 -- {End Of Comments}
170 -- ----------------------------------------------------------------------------
171 -- Function api_updating
172 -- (
173 -- p_assessment_id in number,
174 -- p_person_id in number,
175 -- p_level_id in number,
176 -- p_name_of_assessor in varchar2,
177 -- p_institution in varchar2,
178 -- p_credit in number,
179 -- p_date_of_assessment in date,
180 -- p_final_result in varchar2,
181 -- p_assessment_number in varchar2,
182 -- p_location_where_assessed in varchar2,
183 -- p_field_of_learning in varchar2
184 -- ) Return Boolean;
185 --
186 -- ----------------------------------------------------------------------------
187 -- |---------------------------------< lck >----------------------------------|
188 -- ----------------------------------------------------------------------------
189 -- {Start Of Comments}
190 --
191 -- Description:
192 -- The Lck process has two main functions to perform. Firstly, the row to be
193 -- updated or deleted must be locked. The locking of the row will only be
194 -- successful if the row is not currently locked by another user.
195 -- Secondly, during the locking of the row, the row is selected into
196 -- the g_old_rec data structure which enables the current row values from the
197 -- server to be available to the api.
198 --
199 -- Pre Conditions:
200 -- When attempting to call the lock the object version number (if defined)
201 -- is mandatory.
202 --
203 -- In Parameters:
204 -- The arguments to the Lck process are the primary key(s) which uniquely
205 -- identify the row and the object version number of row.
206 --
207 -- Post Success:
208 -- On successful completion of the Lck process the row to be updated or
209 -- deleted will be locked and selected into the global data structure
210 -- g_old_rec.
211 --
212 -- Post Failure:
213 -- The Lck process can fail for three reasons:
214 -- 1) When attempting to lock the row the row could already be locked by
215 -- another user. This will raise the HR_Api.Object_Locked exception.
216 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
217 -- This error is trapped and reported using the message name
218 -- 'HR_7220_INVALID_PRIMARY_KEY'.
219 -- 3) The row although existing in the HR Schema has a different object
220 -- version number than the object version number specified.
221 -- This error is trapped and reported using the message name
222 -- 'HR_7155_OBJECT_INVALID'.
223 --
224 -- Developer Implementation Notes:
225 -- For each primary key and the object version number arguments add a
226 -- call to hr_api.mandatory_arg_error procedure to ensure that these
227 -- argument values are not null.
228 --
229 -- Access Status:
230 -- Internal Development Use Only.
231 --
232 -- {End Of Comments}
233 -- ----------------------------------------------------------------------------
234 Procedure lck
235 (
236 p_assessment_id in number,
237 p_person_id in number
238 );
239 --
240 -- ----------------------------------------------------------------------------
241 -- |-----------------------------< convert_args >-----------------------------|
242 -- ----------------------------------------------------------------------------
243 -- {Start Of Comments}
244 --
245 -- Description:
246 -- This function is used to turn attribute parameters into the record
247 -- structure parameter g_rec_type.
248 --
249 -- Pre Conditions:
250 -- This is a private function and can only be called from the ins or upd
251 -- attribute processes.
252 --
253 -- In Parameters:
254 --
255 -- Post Success:
256 -- A returning record structure will be returned.
257 --
258 -- Post Failure:
259 -- No direct error handling is required within this function. Any possible
260 -- errors within this function will be a PL/SQL value error due to conversion
261 -- of datatypes or data lengths.
262 --
263 -- Developer Implementation Notes:
264 -- None.
265 --
266 -- Access Status:
267 -- Internal Table Handler Use Only.
268 --
269 -- {End Of Comments}
270 -- ----------------------------------------------------------------------------
271 Function convert_args
272 (
273 p_assessment_id in number,
274 p_person_id in number,
275 p_level_id in number,
276 p_name_of_assessor in varchar2,
277 p_institution in varchar2,
278 p_credit in number,
279 p_date_of_assessment in date,
280 p_final_result in varchar2,
281 p_assessment_number in varchar2,
282 p_location_where_assessed in varchar2,
283 p_field_of_learning in varchar2,
284 p_sub_field in varchar2,
285 p_assessment_start_date in date,
286 p_assessment_end_date in date,
287 p_competence_acquired in varchar2,
288 p_ETQA_name in varchar2,
289 p_certification_date in date,
290 p_certificate_number in varchar2,
291 p_accredited_by in varchar2,
292 p_date_of_accreditation in date,
293 p_certification_expiry_date in date
294 )
295 Return g_za_rec_type;
296 --
297 procedure validate_record(p_date_from in date default null,
298 p_date_to in date default null,
299 p_date_of_assessment in date default null,
300 p_certification_date in date default null,
301 p_certification_expiry_date in date default null,
302 p_date_of_accreditation in date default null);
303
304 end per_za_ass_shd ;