1 Package per_sub_shd as
2 /* $Header: pesubrhi.pkh 120.0 2005/05/31 22:09:52 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (
10 subjects_taken_id number(9),
11 start_date date,
12 major varchar2(30),
13 subject_status varchar2(100),
14 subject varchar2(30),
15 grade_attained varchar2(100),
16 end_date date,
17 qualification_id number(9),
18 object_version_number number(9),
19 attribute_category varchar2(30),
20 attribute1 varchar2(150),
21 attribute2 varchar2(150),
22 attribute3 varchar2(150),
23 attribute4 varchar2(150),
24 attribute5 varchar2(150),
25 attribute6 varchar2(150),
26 attribute7 varchar2(150),
27 attribute8 varchar2(150),
28 attribute9 varchar2(150),
29 attribute10 varchar2(150),
30 attribute11 varchar2(150),
31 attribute12 varchar2(150),
32 attribute13 varchar2(150),
33 attribute14 varchar2(150),
34 attribute15 varchar2(150),
35 attribute16 varchar2(150),
36 attribute17 varchar2(150),
37 attribute18 varchar2(150),
38 attribute19 varchar2(150),
39 attribute20 varchar2(150),
40 sub_information_category varchar2(30),
41 sub_information1 varchar2(150),
42 sub_information2 varchar2(150),
43 sub_information3 varchar2(150),
44 sub_information4 varchar2(150),
45 sub_information5 varchar2(150),
46 sub_information6 varchar2(150),
47 sub_information7 varchar2(150),
48 sub_information8 varchar2(150),
49 sub_information9 varchar2(150),
50 sub_information10 varchar2(150),
51 sub_information11 varchar2(150),
52 sub_information12 varchar2(150),
53 sub_information13 varchar2(150),
54 sub_information14 varchar2(150),
55 sub_information15 varchar2(150),
56 sub_information16 varchar2(150),
57 sub_information17 varchar2(150),
58 sub_information18 varchar2(150),
59 sub_information19 varchar2(150),
60 sub_information20 varchar2(150)
61 );
62
63 --
64 -- ----------------------------------------------------------------------------
65 -- | Global Definitions - Internal Development Use Only |
66 -- ----------------------------------------------------------------------------
67 --
68 g_old_rec g_rec_type; -- Global record definition
69 g_api_dml boolean; -- Global api dml status
70 --
71 -- ----------------------------------------------------------------------------
72 -- |------------------------< return_api_dml_status >-------------------------|
73 -- ----------------------------------------------------------------------------
74 -- {Start Of Comments}
75 --
76 -- Description:
77 -- This function will return the current g_api_dml private global
78 -- boolean status.
79 -- The g_api_dml status determines if at the time of the function
80 -- being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
81 -- is being issued from within an api.
82 -- If the status is TRUE then a dml statement is being issued from
83 -- within this entity api.
84 -- This function is primarily to support database triggers which
85 -- need to maintain the object_version_number for non-supported
86 -- dml statements (i.e. dml statement issued outside of the api layer).
87 --
88 -- Pre Conditions:
89 -- None.
90 --
91 -- In Parameters:
92 -- None.
93 --
94 -- Post Success:
95 -- Processing continues.
96 -- If the function returns a TRUE value then, dml is being executed from
97 -- within this api.
98 --
99 -- Post Failure:
100 -- None.
101 --
102 -- Access Status:
103 -- Internal Table Handler Use Only.
104 --
105 -- {End Of Comments}
106 -- ----------------------------------------------------------------------------
107 Function return_api_dml_status Return Boolean;
108 --
109 -- ----------------------------------------------------------------------------
110 -- |---------------------------< constraint_error >---------------------------|
111 -- ----------------------------------------------------------------------------
112 -- {Start Of Comments}
113 --
114 -- Description:
115 -- This procedure is called when a constraint has been violated (i.e.
116 -- The exception hr_api.check_integrity_violated,
117 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
118 -- hr_api.unique_integrity_violated has been raised).
119 -- The exceptions can only be raised as follows:
120 -- 1) A check constraint can only be violated during an INSERT or UPDATE
121 -- dml operation.
122 -- 2) A parent integrity constraint can only be violated during an
123 -- INSERT or UPDATE dml operation.
124 -- 3) A child integrity constraint can only be violated during an
125 -- DELETE dml operation.
126 -- 4) A unique integrity constraint can only be violated during INSERT or
127 -- UPDATE dml operation.
128 --
129 -- Pre Conditions:
130 -- 1) Either hr_api.check_integrity_violated,
131 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
132 -- hr_api.unique_integrity_violated has been raised with the subsequent
133 -- stripping of the constraint name from the generated error message
134 -- text.
135 -- 2) Standalone validation test which corresponds with a constraint error.
136 --
137 -- In Parameter:
138 -- p_constraint_name is in upper format and is just the constraint name
139 -- (e.g. not prefixed by brackets, schema owner etc).
140 --
141 -- Post Success:
142 -- Development dependant.
143 --
144 -- Post Failure:
145 -- Developement dependant.
146 --
147 -- Developer Implementation Notes:
148 -- For each constraint being checked the hr system package failure message
149 -- has been generated as a template only. These system error messages should
150 -- be modified as required (i.e. change the system failure message to a user
151 -- friendly defined error message).
152 --
153 -- Access Status:
154 -- Internal Development Use Only.
155 --
156 -- {End Of Comments}
157 -- ----------------------------------------------------------------------------
158 Procedure constraint_error
159 (p_constraint_name in all_constraints.constraint_name%TYPE);
160 --
161 -- ----------------------------------------------------------------------------
162 -- |-----------------------------< api_updating >-----------------------------|
163 -- ----------------------------------------------------------------------------
164 -- {Start Of Comments}
165 --
166 -- Description:
167 -- This function is used to populate the g_old_rec record with the
168 -- current row from the database for the specified primary key
169 -- provided that the primary key exists and is valid and does not
170 -- already match the current g_old_rec. The function will always return
171 -- a TRUE value if the g_old_rec is populated with the current row.
172 -- A FALSE value will be returned if all of the primary key arguments
173 -- are null.
174 --
175 -- Pre Conditions:
176 -- None.
177 --
178 -- In Parameters:
179 --
180 -- Post Success:
181 -- A value of TRUE will be returned indiciating that the g_old_rec
182 -- is current.
183 -- A value of FALSE will be returned if all of the primary key arguments
184 -- have a null value (this indicates that the row has not be inserted into
185 -- the Schema), and therefore could never have a corresponding row.
186 --
187 -- Post Failure:
188 -- A failure can only occur under two circumstances:
189 -- 1) The primary key is invalid (i.e. a row does not exist for the
190 -- specified primary key values).
191 -- 2) If an object_version_number exists but is NOT the same as the current
192 -- g_old_rec value.
193 --
194 -- Developer Implementation Notes:
195 -- None.
196 --
197 -- Access Status:
198 -- Internal Development Use Only.
199 --
200 -- {End Of Comments}
201 -- ----------------------------------------------------------------------------
202 Function api_updating
203 (
204 p_subjects_taken_id in number,
205 p_object_version_number in number
206 ) Return Boolean;
207 --
208 -- ----------------------------------------------------------------------------
209 -- |---------------------------------< lck >----------------------------------|
210 -- ----------------------------------------------------------------------------
211 -- {Start Of Comments}
212 --
213 -- Description:
214 -- The Lck process has two main functions to perform. Firstly, the row to be
215 -- updated or deleted must be locked. The locking of the row will only be
216 -- successful if the row is not currently locked by another user.
217 -- Secondly, during the locking of the row, the row is selected into
218 -- the g_old_rec data structure which enables the current row values from the
219 -- server to be available to the api.
220 --
221 -- Pre Conditions:
222 -- When attempting to call the lock the object version number (if defined)
223 -- is mandatory.
224 --
225 -- In Parameters:
226 -- The arguments to the Lck process are the primary key(s) which uniquely
227 -- identify the row and the object version number of row.
228 --
229 -- Post Success:
230 -- On successful completion of the Lck process the row to be updated or
231 -- deleted will be locked and selected into the global data structure
232 -- g_old_rec.
233 --
234 -- Post Failure:
235 -- The Lck process can fail for three reasons:
236 -- 1) When attempting to lock the row the row could already be locked by
237 -- another user. This will raise the HR_Api.Object_Locked exception.
238 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
239 -- This error is trapped and reported using the message name
240 -- 'HR_7220_INVALID_PRIMARY_KEY'.
241 -- 3) The row although existing in the HR Schema has a different object
242 -- version number than the object version number specified.
243 -- This error is trapped and reported using the message name
244 -- 'HR_7155_OBJECT_INVALID'.
245 --
246 -- Developer Implementation Notes:
247 -- For each primary key and the object version number arguments add a
248 -- call to hr_api.mandatory_arg_error procedure to ensure that these
249 -- argument values are not null.
250 --
251 -- Access Status:
252 -- Internal Development Use Only.
253 --
254 -- {End Of Comments}
255 -- ----------------------------------------------------------------------------
256 Procedure lck
257 (
258 p_subjects_taken_id in number,
259 p_object_version_number in number
260 );
261 --
262 -- ----------------------------------------------------------------------------
263 -- |-----------------------------< convert_args >-----------------------------|
264 -- ----------------------------------------------------------------------------
265 -- {Start Of Comments}
266 --
267 -- Description:
268 -- This function is used to turn attribute parameters into the record
269 -- structure parameter g_rec_type.
270 --
271 -- Pre Conditions:
272 -- This is a private function and can only be called from the ins or upd
273 -- attribute processes.
274 --
275 -- In Parameters:
276 --
277 -- Post Success:
278 -- A returning record structure will be returned.
279 --
280 -- Post Failure:
281 -- No direct error handling is required within this function. Any possible
282 -- errors within this function will be a PL/SQL value error due to conversion
283 -- of datatypes or data lengths.
284 --
285 -- Developer Implementation Notes:
286 -- None.
287 --
288 -- Access Status:
289 -- Internal Table Handler Use Only.
290 --
291 -- {End Of Comments}
292 -- ----------------------------------------------------------------------------
293 Function convert_args
294 (
295 p_subjects_taken_id in number,
296 p_start_date in date,
297 p_major in varchar2,
298 p_subject_status in varchar2,
299 p_subject in varchar2,
300 p_grade_attained in varchar2,
301 p_end_date in date,
302 p_qualification_id in number,
303 p_object_version_number in number,
304 p_attribute_category in varchar2,
305 p_attribute1 in varchar2,
306 p_attribute2 in varchar2,
307 p_attribute3 in varchar2,
308 p_attribute4 in varchar2,
309 p_attribute5 in varchar2,
310 p_attribute6 in varchar2,
311 p_attribute7 in varchar2,
312 p_attribute8 in varchar2,
313 p_attribute9 in varchar2,
314 p_attribute10 in varchar2,
315 p_attribute11 in varchar2,
316 p_attribute12 in varchar2,
317 p_attribute13 in varchar2,
318 p_attribute14 in varchar2,
319 p_attribute15 in varchar2,
320 p_attribute16 in varchar2,
321 p_attribute17 in varchar2,
322 p_attribute18 in varchar2,
323 p_attribute19 in varchar2,
324 p_attribute20 in varchar2,
325 p_sub_information_category in varchar2,
326 p_sub_information1 in varchar2,
327 p_sub_information2 in varchar2,
328 p_sub_information3 in varchar2,
329 p_sub_information4 in varchar2,
330 p_sub_information5 in varchar2,
331 p_sub_information6 in varchar2,
332 p_sub_information7 in varchar2,
333 p_sub_information8 in varchar2,
334 p_sub_information9 in varchar2,
335 p_sub_information10 in varchar2,
336 p_sub_information11 in varchar2,
337 p_sub_information12 in varchar2,
338 p_sub_information13 in varchar2,
339 p_sub_information14 in varchar2,
340 p_sub_information15 in varchar2,
341 p_sub_information16 in varchar2,
342 p_sub_information17 in varchar2,
343 p_sub_information18 in varchar2,
344 p_sub_information19 in varchar2,
345 p_sub_information20 in varchar2
346 )
347 Return g_rec_type;
348 --
349 end per_sub_shd;