1 Package ota_tsr_shd as
2 /* $Header: ottsr01t.pkh 120.1 2006/02/13 02:49:09 jbharath noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (
10 supplied_resource_id number(9),
11 vendor_id number(15),
12 business_group_id number(9),
13 resource_definition_id number(15),
14 consumable_flag varchar2(30),
15 object_version_number number(9), -- Increased length
16 resource_type varchar2(30),
17 start_date date,
18 comments varchar2(2000),
19 cost number(17,2), -- Increased length
20 cost_unit varchar2(30),
21 currency_code varchar2(30),
22 end_date date,
23 internal_address_line varchar2(80),
24 lead_time number(17,2), -- Increased length
25 name varchar2(400), -- Increased length bug#5018347
26 supplier_reference varchar2(80),
27 tsr_information_category varchar2(30),
28 tsr_information1 varchar2(150),
29 tsr_information2 varchar2(150),
30 tsr_information3 varchar2(150),
31 tsr_information4 varchar2(150),
32 tsr_information5 varchar2(150),
33 tsr_information6 varchar2(150),
34 tsr_information7 varchar2(150),
35 tsr_information8 varchar2(150),
36 tsr_information9 varchar2(150),
37 tsr_information10 varchar2(150),
38 tsr_information11 varchar2(150),
39 tsr_information12 varchar2(150),
40 tsr_information13 varchar2(150),
41 tsr_information14 varchar2(150),
42 tsr_information15 varchar2(150),
43 tsr_information16 varchar2(150),
44 tsr_information17 varchar2(150),
45 tsr_information18 varchar2(150),
46 tsr_information19 varchar2(150),
47 tsr_information20 varchar2(150),
48 training_center_id number(15),
49 location_id number(15),
50 trainer_id number(10),
51 special_instruction varchar2(2000)
52 );
53 --
54 -- ----------------------------------------------------------------------------
55 -- | Global Definitions - Internal Development Use Only |
56 -- ----------------------------------------------------------------------------
57 --
58 g_old_rec g_rec_type; -- Global record definition
59 g_api_dml boolean; -- Global api dml status
60 --
61 -- ----------------------------------------------------------------------------
62 -- |------------------------< return_api_dml_status >-------------------------|
63 -- ----------------------------------------------------------------------------
64 -- {Start Of Comments}
65 --
66 -- Description:
67 -- This function will return the current g_api_dml private global
68 -- boolean status.
69 -- The g_api_dml status determines if at the time of the function
70 -- being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
71 -- is being issued from within an api.
72 -- If the status is TRUE then a dml statement is being issued from
73 -- within this entity api.
74 -- This function is primarily to support database triggers which
75 -- need to maintain the object_version_number for non-supported
76 -- dml statements (i.e. dml statement issued outside of the api layer).
77 --
78 -- Pre Conditions:
79 -- None.
80 --
81 -- In Arguments:
82 -- None.
83 --
84 -- Post Success:
85 -- Processing continues.
86 -- If the function returns a TRUE value then, dml is being executed from
87 -- within this api.
88 --
89 -- Post Failure:
90 -- None.
91 --
92 -- Access Status:
93 -- Public.
94 --
95 -- {End Of Comments}
96 -- ----------------------------------------------------------------------------
97 Function return_api_dml_status Return Boolean;
98 --
99 -- ----------------------------------------------------------------------------
100 -- |---------------------------< constraint_error >---------------------------|
101 -- ----------------------------------------------------------------------------
102 -- {Start Of Comments}
103 --
104 -- Description:
105 -- This procedure is called when a constraint has been violated (i.e.
106 -- The exception hr_api.check_integrity_violated,
107 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
108 -- hr_api.unique_integrity_violated has been raised).
109 -- The exceptions can only be raised as follows:
110 -- 1) A check constraint can only be violated during an INSERT or UPDATE
111 -- dml operation.
112 -- 2) A parent integrity constraint can only be violated during an
113 -- INSERT or UPDATE dml operation.
114 -- 3) A child integrity constraint can only be violated during an
115 -- DELETE dml operation.
116 -- 4) A unique integrity constraint can only be violated during INSERT or
117 -- UPDATE dml operation.
118 --
119 -- Pre Conditions:
120 -- 1) Either hr_api.check_integrity_violated,
121 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
122 -- hr_api.unique_integrity_violated has been raised with the subsequent
123 -- stripping of the constraint name from the generated error message
124 -- text.
125 -- 2) Standalone validation test which correspond with a constraint error.
126 --
127 -- In Arguments:
128 -- p_constraint_name is in upper format and is just the constraint name
129 -- (e.g. not prefixed by brackets, schema owner etc).
130 --
131 -- Post Success:
132 -- Development dependant.
133 --
134 -- Post Failure:
135 -- Developement dependant.
136 --
137 -- Developer Implementation Notes:
138 -- For each constraint being checked the hr system package failure message
139 -- has been generated as a template only. These system error messages should
140 -- be modified as required (i.e. change the system failure message to a user
141 -- friendly defined error message).
142 --
143 -- Access Status:
144 -- Public.
145 --
146 -- {End Of Comments}
147 -- ----------------------------------------------------------------------------
148 Procedure constraint_error
149 (p_constraint_name in varchar2);
150 --
151 -- ----------------------------------------------------------------------------
152 -- |-----------------------------< api_updating >-----------------------------|
153 -- ----------------------------------------------------------------------------
154 -- {Start Of Comments}
155 --
156 -- Description:
157 -- This function is used to populate the g_old_rec record with the
158 -- current row from the database for the specified primary key
159 -- provided that the primary key exists and is valid and does not
160 -- already match the current g_old_rec. The function will always return
161 -- a TRUE value if the g_old_rec is populated with the current row.
162 -- A FALSE value will be returned if all of the primary key arguments
163 -- are null.
164 --
165 -- Pre Conditions:
166 -- None.
167 --
168 -- In Arguments:
169 --
170 -- Post Success:
171 -- A value of TRUE will be returned indiciating that the g_old_rec
172 -- is current.
173 -- A value of FALSE will be returned if all of the primary key arguments
174 -- have a null value (this indicates that the row has not be inserted into
175 -- the Schema), and therefore could never have a corresponding row.
176 --
177 -- Post Failure:
178 -- A failure can only occur under two circumstances:
179 -- 1) The primary key is invalid (i.e. a row does not exist for the
180 -- specified primary key values).
181 -- 2) If an object_version_number exists but is NOT the same as the current
182 -- g_old_rec value.
183 --
184 -- Developer Implementation Notes:
185 -- None.
186 --
187 -- Access Status:
188 -- Internal Development Use Only.
189 --
190 -- {End Of Comments}
191 -- ----------------------------------------------------------------------------
192 Function api_updating
193 (
194 p_supplied_resource_id in number,
195 p_object_version_number in number
196 ) Return Boolean;
197 --
198 -- ----------------------------------------------------------------------------
199 -- |---------------------------------< lck >----------------------------------|
200 -- ----------------------------------------------------------------------------
201 -- {Start Of Comments}
202 --
203 -- Description:
204 -- The Lck process has two main functions to perform. Firstly, the row to be
205 -- updated or deleted must be locked. The locking of the row will only be
206 -- successful if the row is not currently locked by another user.
207 -- Secondly, during the locking of the row, the row is selected into
208 -- the g_old_rec data structure which enables the current row values from the
209 -- server to be available to the api.
210 --
211 -- Pre Conditions:
212 -- When attempting to call the lock the object version number (if defined)
213 -- is mandatory.
214 --
215 -- In Arguments:
216 -- The arguments to the Lck process are the primary key(s) which uniquely
217 -- identify the row and the object version number of row.
218 --
219 -- Post Success:
220 -- On successful completion of the Lck process the row to be updated or
221 -- deleted will be locked and selected into the global data structure
222 -- g_old_rec.
223 --
224 -- Post Failure:
225 -- The Lck process can fail for three reasons:
226 -- 1) When attempting to lock the row the row could already be locked by
227 -- another user. This will raise the HR_Api.Object_Locked exception.
228 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
229 -- This error is trapped and reported using the message name
230 -- 'HR_7220_INVALID_PRIMARY_KEY'.
231 -- 3) The row although existing in the HR Schema has a different object
232 -- version number than the object version number specified.
233 -- This error is trapped and reported using the message name
234 -- 'HR_7155_OBJECT_INVALID'.
235 --
236 -- Developer Implementation Notes:
237 -- For each primary key and the object version number arguments add a
238 -- call to hr_api.mandatory_arg_error procedure to ensure that these
239 -- argument values are not null.
240 --
241 -- Access Status:
242 -- Public.
243 --
244 -- {End Of Comments}
245 -- ----------------------------------------------------------------------------
246 Procedure lck
247 (
248 p_supplied_resource_id in number,
249 p_object_version_number in number
250 );
251 --
252 -- ----------------------------------------------------------------------------
253 -- |-----------------------------< convert_args >-----------------------------|
254 -- ----------------------------------------------------------------------------
255 -- {Start Of Comments}
256 --
257 -- Description:
258 -- This function is used to turn attribute arguments into the record
259 -- structure g_rec_type.
260 --
261 -- Pre Conditions:
262 -- This is a private function and can only be called from the ins or upd
263 -- attribute processes.
264 --
265 -- In Arguments:
266 --
267 -- Post Success:
268 -- A returning record structure will be returned.
269 --
270 -- Post Failure:
271 -- No direct error handling is required within this function. Any possible
272 -- errors within this function will be a PL/SQL value error due to conversion
273 -- of datatypes or data lengths.
274 --
275 -- Developer Implementation Notes:
276 -- None.
277 --
278 -- Access Status:
279 -- Internal Development Use Only.
280 --
281 -- {End Of Comments}
282 -- ----------------------------------------------------------------------------
283 Function convert_args
284 (
285 p_supplied_resource_id in number,
286 p_vendor_id in number,
287 p_business_group_id in number,
288 p_resource_definition_id in number,
289 p_consumable_flag in varchar2,
290 p_object_version_number in number,
291 p_resource_type in varchar2,
292 p_start_date in date,
293 p_comments in varchar2,
294 p_cost in number,
295 p_cost_unit in varchar2,
296 p_currency_code in varchar2,
297 p_end_date in date,
298 p_internal_address_line in varchar2,
299 p_lead_time in number,
300 p_name in varchar2,
301 p_supplier_reference in varchar2,
302 p_tsr_information_category in varchar2,
303 p_tsr_information1 in varchar2,
304 p_tsr_information2 in varchar2,
305 p_tsr_information3 in varchar2,
306 p_tsr_information4 in varchar2,
307 p_tsr_information5 in varchar2,
308 p_tsr_information6 in varchar2,
309 p_tsr_information7 in varchar2,
310 p_tsr_information8 in varchar2,
311 p_tsr_information9 in varchar2,
312 p_tsr_information10 in varchar2,
313 p_tsr_information11 in varchar2,
314 p_tsr_information12 in varchar2,
315 p_tsr_information13 in varchar2,
316 p_tsr_information14 in varchar2,
317 p_tsr_information15 in varchar2,
318 p_tsr_information16 in varchar2,
319 p_tsr_information17 in varchar2,
320 p_tsr_information18 in varchar2,
321 p_tsr_information19 in varchar2,
322 p_tsr_information20 in varchar2,
323 p_training_center_id in number,
324 p_location_id in number,
325 p_trainer_id in number,
326 p_special_instruction in varchar2
327 )
328 Return g_rec_type;
329 --
330 end ota_tsr_shd;