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