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