1 Package ota_ple_shd AUTHID CURRENT_USER as
2 /* $Header: otple01t.pkh 115.0 99/07/16 00:53:01 porting ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (
10 price_list_entry_id number(9),
11 vendor_supply_id number(9),
12 activity_version_id number(9),
13 price_list_id number(9),
14 object_version_number number(9), -- Increased length
15 price number,
16 price_basis varchar2(30),
17 start_date date,
18 comments varchar2(2000),
19 end_date date,
20 maximum_attendees number(9),
21 minimum_attendees number(9),
22 ple_information_category varchar2(30),
23 ple_information1 varchar2(150),
24 ple_information2 varchar2(150),
25 ple_information3 varchar2(150),
26 ple_information4 varchar2(150),
27 ple_information5 varchar2(150),
28 ple_information6 varchar2(150),
29 ple_information7 varchar2(150),
30 ple_information8 varchar2(150),
31 ple_information9 varchar2(150),
32 ple_information10 varchar2(150),
33 ple_information11 varchar2(150),
34 ple_information12 varchar2(150),
35 ple_information13 varchar2(150),
36 ple_information14 varchar2(150),
37 ple_information15 varchar2(150),
38 ple_information16 varchar2(150),
39 ple_information17 varchar2(150),
40 ple_information18 varchar2(150),
41 ple_information19 varchar2(150),
42 ple_information20 varchar2(150)
43 );
44 --
45 -- ----------------------------------------------------------------------------
46 -- | Global Definitions - Internal Development Use Only |
47 -- ----------------------------------------------------------------------------
48 --
49 g_old_rec g_rec_type; -- Global record definition
50 g_api_dml boolean; -- Global api dml status
51 --
52 -- ----------------------------------------------------------------------------
53 -- |------------------------< return_api_dml_status >-------------------------|
54 -- ----------------------------------------------------------------------------
55 -- {Start Of Comments}
56 --
57 -- Description:
58 -- This function will return the current g_api_dml private global
59 -- boolean status.
60 -- The g_api_dml status determines if at the time of the function
61 -- being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
62 -- is being issued from within an api.
63 -- If the status is TRUE then a dml statement is being issued from
64 -- within this entity api.
65 -- This function is primarily to support database triggers which
66 -- need to maintain the object_version_number for non-supported
67 -- dml statements (i.e. dml statement issued outside of the api layer).
68 --
69 -- Pre Conditions:
70 -- None.
71 --
72 -- In Arguments:
73 -- None.
74 --
75 -- Post Success:
76 -- Processing continues.
77 -- If the function returns a TRUE value then, dml is being executed from
78 -- within this api.
79 --
80 -- Post Failure:
81 -- None.
82 --
83 -- Access Status:
84 -- Public.
85 --
86 -- {End Of Comments}
87 -- ----------------------------------------------------------------------------
88 Function return_api_dml_status Return Boolean;
89 --
90 -- ----------------------------------------------------------------------------
91 -- |---------------------------< constraint_error >---------------------------|
92 -- ----------------------------------------------------------------------------
93 -- {Start Of Comments}
94 --
95 -- Description:
96 -- This procedure is called when a constraint has been violated (i.e.
97 -- The exception hr_api.check_integrity_violated,
98 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
99 -- hr_api.unique_integrity_violated has been raised).
100 -- The exceptions can only be raised as follows:
101 -- 1) A check constraint can only be violated during an INSERT or UPDATE
102 -- dml operation.
103 -- 2) A parent integrity constraint can only be violated during an
104 -- INSERT or UPDATE dml operation.
105 -- 3) A child integrity constraint can only be violated during an
106 -- DELETE dml operation.
107 -- 4) A unique integrity constraint can only be violated during INSERT or
108 -- UPDATE dml operation.
109 --
110 -- Pre Conditions:
111 -- 1) Either hr_api.check_integrity_violated,
112 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
113 -- hr_api.unique_integrity_violated has been raised with the subsequent
114 -- stripping of the constraint name from the generated error message
115 -- text.
116 -- 2) Standalone validation test which correspond with a constraint error.
117 --
118 -- In Arguments:
119 -- p_constraint_name is in upper format and is just the constraint name
120 -- (e.g. not prefixed by brackets, schema owner etc).
121 --
122 -- Post Success:
123 -- Development dependant.
124 --
125 -- Post Failure:
126 -- Developement dependant.
127 --
128 -- Developer Implementation Notes:
129 -- For each constraint being checked the hr system package failure message
130 -- has been generated as a template only. These system error messages should
131 -- be modified as required (i.e. change the system failure message to a user
132 -- friendly defined error message).
133 --
134 -- Access Status:
135 -- Public.
136 --
137 -- {End Of Comments}
138 -- ----------------------------------------------------------------------------
139 Procedure constraint_error
140 (p_constraint_name in varchar2);
141 --
142 -- ----------------------------------------------------------------------------
143 -- |-----------------------------< api_updating >-----------------------------|
144 -- ----------------------------------------------------------------------------
145 -- {Start Of Comments}
146 --
147 -- Description:
148 -- This function is used to populate the g_old_rec record with the
149 -- current row from the database for the specified primary key
150 -- provided that the primary key exists and is valid and does not
151 -- already match the current g_old_rec. The function will always return
152 -- a TRUE value if the g_old_rec is populated with the current row.
153 -- A FALSE value will be returned if all of the primary key arguments
154 -- are null.
155 --
156 -- Pre Conditions:
157 -- None.
158 --
159 -- In Arguments:
160 --
161 -- Post Success:
162 -- A value of TRUE will be returned indiciating that the g_old_rec
163 -- is current.
164 -- A value of FALSE will be returned if all of the primary key arguments
165 -- have a null value (this indicates that the row has not be inserted into
166 -- the Schema), and therefore could never have a corresponding row.
167 --
168 -- Post Failure:
169 -- A failure can only occur under two circumstances:
170 -- 1) The primary key is invalid (i.e. a row does not exist for the
171 -- specified primary key values).
172 -- 2) If an object_version_number exists but is NOT the same as the current
173 -- g_old_rec value.
174 --
175 -- Developer Implementation Notes:
176 -- None.
177 --
178 -- Access Status:
179 -- Internal Development Use Only.
180 --
181 -- {End Of Comments}
182 -- ----------------------------------------------------------------------------
183 Function api_updating
184 (
185 p_price_list_entry_id in number,
186 p_object_version_number in number
187 ) Return Boolean;
188 --
189 -- ----------------------------------------------------------------------------
190 -- |---------------------------------< lck >----------------------------------|
191 -- ----------------------------------------------------------------------------
192 -- {Start Of Comments}
193 --
194 -- Description:
195 -- The Lck process has two main functions to perform. Firstly, the row to be
196 -- updated or deleted must be locked. The locking of the row will only be
197 -- successful if the row is not currently locked by another user.
198 -- Secondly, during the locking of the row, the row is selected into
199 -- the g_old_rec data structure which enables the current row values from the
200 -- server to be available to the api.
201 --
202 -- Pre Conditions:
203 -- When attempting to call the lock the object version number (if defined)
204 -- is mandatory.
205 --
206 -- In Arguments:
207 -- The arguments to the Lck process are the primary key(s) which uniquely
208 -- identify the row and the object version number of row.
209 --
210 -- Post Success:
211 -- On successful completion of the Lck process the row to be updated or
212 -- deleted will be locked and selected into the global data structure
213 -- g_old_rec.
214 --
215 -- Post Failure:
216 -- The Lck process can fail for three reasons:
217 -- 1) When attempting to lock the row the row could already be locked by
218 -- another user. This will raise the HR_Api.Object_Locked exception.
219 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
220 -- This error is trapped and reported using the message name
221 -- 'HR_7220_INVALID_PRIMARY_KEY'.
222 -- 3) The row although existing in the HR Schema has a different object
223 -- version number than the object version number specified.
224 -- This error is trapped and reported using the message name
225 -- 'HR_7155_OBJECT_INVALID'.
226 --
227 -- Developer Implementation Notes:
228 -- For each primary key and the object version number arguments add a
229 -- call to hr_api.mandatory_arg_error procedure to ensure that these
230 -- argument values are not null.
231 --
232 -- Access Status:
233 -- Public.
234 --
235 -- {End Of Comments}
236 -- ----------------------------------------------------------------------------
237 Procedure lck
238 (
239 p_price_list_entry_id in number,
240 p_object_version_number 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_price_list_entry_id in number,
277 p_vendor_supply_id in number,
278 p_activity_version_id in number,
279 p_price_list_id in number,
280 p_object_version_number in number,
281 p_price in number,
282 p_price_basis in varchar2,
283 p_start_date in date,
284 p_comments in varchar2,
285 p_end_date in date,
286 p_maximum_attendees in number,
287 p_minimum_attendees in number,
288 p_ple_information_category in varchar2,
289 p_ple_information1 in varchar2,
290 p_ple_information2 in varchar2,
291 p_ple_information3 in varchar2,
292 p_ple_information4 in varchar2,
293 p_ple_information5 in varchar2,
294 p_ple_information6 in varchar2,
295 p_ple_information7 in varchar2,
296 p_ple_information8 in varchar2,
297 p_ple_information9 in varchar2,
298 p_ple_information10 in varchar2,
299 p_ple_information11 in varchar2,
300 p_ple_information12 in varchar2,
301 p_ple_information13 in varchar2,
302 p_ple_information14 in varchar2,
303 p_ple_information15 in varchar2,
304 p_ple_information16 in varchar2,
305 p_ple_information17 in varchar2,
306 p_ple_information18 in varchar2,
307 p_ple_information19 in varchar2,
308 p_ple_information20 in varchar2
309 )
310 Return g_rec_type;
311 --
312 end ota_ple_shd;