1 Package pqp_pvd_shd as
2 /* $Header: pqpvdrhi.pkh 120.0 2005/05/29 02:09:36 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (vehicle_details_id number(10)
10 ,vehicle_type varchar2(30)
11 ,business_group_id number(15)
12 ,registration_number varchar2(30)
13 ,make varchar2(30)
14 ,model varchar2(30)
15 ,date_first_registered date
16 ,engine_capacity_in_cc number
17 ,fuel_type varchar2(30)
18 ,fuel_card varchar2(30)
19 ,currency_code varchar2(30)
20 ,list_price number
21 ,accessory_value_at_startdate number
22 ,accessory_value_added_later number
23 -- ,capital_contributions number
24 -- ,private_use_contributions number
25 ,market_value_classic_car number
26 ,co2_emissions number
27 ,vehicle_provider varchar2(60)
28 ,object_version_number number(9)
29 ,vehicle_identification_number varchar2(50)
30 ,vehicle_ownership varchar2(30)
31 ,vhd_attribute_category varchar2(30)
32 ,vhd_attribute1 varchar2(150)
33 ,vhd_attribute2 varchar2(150)
34 ,vhd_attribute3 varchar2(150)
35 ,vhd_attribute4 varchar2(150)
36 ,vhd_attribute5 varchar2(150)
37 ,vhd_attribute6 varchar2(150)
38 ,vhd_attribute7 varchar2(150)
39 ,vhd_attribute8 varchar2(150)
40 ,vhd_attribute9 varchar2(150)
41 ,vhd_attribute10 varchar2(150)
42 ,vhd_attribute11 varchar2(150)
43 ,vhd_attribute12 varchar2(150)
44 ,vhd_attribute13 varchar2(150)
45 ,vhd_attribute14 varchar2(150)
46 ,vhd_attribute15 varchar2(150)
47 ,vhd_attribute16 varchar2(150)
48 ,vhd_attribute17 varchar2(150)
49 ,vhd_attribute18 varchar2(150)
50 ,vhd_attribute19 varchar2(150)
51 ,vhd_attribute20 varchar2(150)
52 ,vhd_information_category varchar2(30)
53 ,vhd_information1 varchar2(150)
54 ,vhd_information2 varchar2(150)
55 ,vhd_information3 varchar2(150)
56 ,vhd_information4 varchar2(150)
57 ,vhd_information5 varchar2(150)
58 ,vhd_information6 varchar2(150)
59 ,vhd_information7 varchar2(150)
60 ,vhd_information8 varchar2(150)
61 ,vhd_information9 varchar2(150)
62 ,vhd_information10 varchar2(150)
63 ,vhd_information11 varchar2(150)
64 ,vhd_information12 varchar2(150)
65 ,vhd_information13 varchar2(150)
66 ,vhd_information14 varchar2(150)
67 ,vhd_information15 varchar2(150)
68 ,vhd_information16 varchar2(150)
69 ,vhd_information17 varchar2(150)
70 ,vhd_information18 varchar2(150)
71 ,vhd_information19 varchar2(150)
72 ,vhd_information20 varchar2(150)
73 );
74 --
75 -- ----------------------------------------------------------------------------
76 -- | Global Definitions - Internal Development Use Only |
77 -- ----------------------------------------------------------------------------
78 --
79 g_old_rec g_rec_type; -- Global record definition
80 g_api_dml boolean; -- Global api dml status
81 --
82 -- ----------------------------------------------------------------------------
83 -- |------------------------< return_api_dml_status >-------------------------|
84 -- ----------------------------------------------------------------------------
85 -- {Start Of Comments}
86 --
87 -- Description:
88 -- This function will return the current g_api_dml private global
89 -- boolean status.
90 -- The g_api_dml status determines if at the time of the function
91 -- being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
92 -- is being issued from within an api.
93 -- If the status is TRUE then a dml statement is being issued from
94 -- within this entity api.
95 -- This function is primarily to support database triggers which
96 -- need to maintain the object_version_number for non-supported
97 -- dml statements (i.e. dml statement issued outside of the api layer).
98 --
99 -- Prerequisites:
100 -- None.
101 --
102 -- In Parameters:
103 -- None.
104 --
105 -- Post Success:
106 -- Processing continues.
107 -- If the function returns a TRUE value then, dml is being executed from
108 -- within this api.
109 --
110 -- Post Failure:
111 -- None.
112 --
113 -- Access Status:
114 -- Internal Row Handler Use Only.
115 --
116 -- {End Of Comments}
117 -- ----------------------------------------------------------------------------
118 Function return_api_dml_status Return Boolean;
119 --
120 -- ----------------------------------------------------------------------------
121 -- |---------------------------< constraint_error >---------------------------|
122 -- ----------------------------------------------------------------------------
123 -- {Start Of Comments}
124 --
125 -- Description:
126 -- This procedure is called when a constraint has been violated (i.e.
127 -- The exception hr_api.check_integrity_violated,
128 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
129 -- hr_api.unique_integrity_violated has been raised).
130 -- The exceptions can only be raised as follows:
131 -- 1) A check constraint can only be violated during an INSERT or UPDATE
132 -- dml operation.
133 -- 2) A parent integrity constraint can only be violated during an
134 -- INSERT or UPDATE dml operation.
135 -- 3) A child integrity constraint can only be violated during an
136 -- DELETE dml operation.
137 -- 4) A unique integrity constraint can only be violated during INSERT or
138 -- UPDATE dml operation.
139 --
140 -- Prerequisites:
141 -- 1) Either hr_api.check_integrity_violated,
142 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
143 -- hr_api.unique_integrity_violated has been raised with the subsequent
144 -- stripping of the constraint name from the generated error message
145 -- text.
146 -- 2) Standalone validation test which corresponds with a constraint error.
147 --
148 -- In Parameter:
149 -- p_constraint_name is in upper format and is just the constraint name
150 -- (e.g. not prefixed by brackets, schema owner etc).
151 --
152 -- Post Success:
153 -- Development dependant.
154 --
155 -- Post Failure:
156 -- Developement dependant.
157 --
158 -- Developer Implementation Notes:
159 -- For each constraint being checked the hr system package failure message
160 -- has been generated as a template only. These system error messages should
161 -- be modified as required (i.e. change the system failure message to a user
162 -- friendly defined error message).
163 --
164 -- Access Status:
165 -- Internal Development Use Only.
166 --
167 -- {End Of Comments}
168 -- ----------------------------------------------------------------------------
169 Procedure constraint_error
170 (p_constraint_name in all_constraints.constraint_name%TYPE);
171 --
172 -- ----------------------------------------------------------------------------
173 -- |-----------------------------< api_updating >-----------------------------|
174 -- ----------------------------------------------------------------------------
175 -- {Start Of Comments}
176 --
177 -- Description:
178 -- This function is used to populate the g_old_rec record with the
179 -- current row from the database for the specified primary key
180 -- provided that the primary key exists and is valid and does not
181 -- already match the current g_old_rec. The function will always return
182 -- a TRUE value if the g_old_rec is populated with the current row.
183 -- A FALSE value will be returned if all of the primary key arguments
184 -- are null.
185 --
186 -- Prerequisites:
187 -- None.
188 --
189 -- In Parameters:
190 --
191 -- Post Success:
192 -- A value of TRUE will be returned indiciating that the g_old_rec
193 -- is current.
194 -- A value of FALSE will be returned if all of the primary key arguments
195 -- have a null value (this indicates that the row has not be inserted into
196 -- the Schema), and therefore could never have a corresponding row.
197 --
198 -- Post Failure:
199 -- A failure can only occur under two circumstances:
200 -- 1) The primary key is invalid (i.e. a row does not exist for the
201 -- specified primary key values).
202 -- 2) If an object_version_number exists but is NOT the same as the current
203 -- g_old_rec value.
204 --
205 -- Developer Implementation Notes:
206 -- None.
207 --
208 -- Access Status:
209 -- Internal Development Use Only.
210 --
211 -- {End Of Comments}
212 -- ----------------------------------------------------------------------------
213 Function api_updating
214 (p_vehicle_details_id in number
215 ,p_object_version_number in number
216 ) Return Boolean;
217 --
218 -- ----------------------------------------------------------------------------
219 -- |---------------------------------< lck >----------------------------------|
220 -- ----------------------------------------------------------------------------
221 -- {Start of comments}
222 --
223 -- Description:
224 -- The Lck process has two main functions to perform. Firstly, the row to be
225 -- updated or deleted must be locked. The locking of the row will only be
226 -- successful if the row is not currently locked by another user.
227 -- Secondly, during the locking of the row, the row is selected into
228 -- the g_old_rec data structure which enables the current row values from the
229 -- server to be available to the api.
230 --
231 -- Prerequisites:
232 -- When attempting to call the lock the object version number (if defined)
233 -- is mandatory.
234 --
235 -- In Parameters:
236 -- The arguments to the Lck process are the primary key(s) which uniquely
237 -- identify the row and the object version number of row.
238 --
239 -- Post Success:
240 -- On successful completion of the Lck process the row to be updated or
241 -- deleted will be locked and selected into the global data structure
242 -- g_old_rec.
243 --
244 -- Post Failure:
245 -- The Lck process can fail for three reasons:
246 -- 1) When attempting to lock the row the row could already be locked by
247 -- another user. This will raise the HR_Api.Object_Locked exception.
248 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
249 -- This error is trapped and reported using the message name
250 -- 'HR_7220_INVALID_PRIMARY_KEY'.
251 -- 3) The row although existing in the HR Schema has a different object
252 -- version number than the object version number specified.
253 -- This error is trapped and reported using the message name
254 -- 'HR_7155_OBJECT_INVALID'.
255 --
256 -- Developer Implementation Notes:
257 -- For each primary key and the object version number arguments add a
258 -- call to hr_api.mandatory_arg_error procedure to ensure that these
259 -- argument values are not null.
260 --
261 -- Access Status:
262 -- Internal Development Use Only.
263 --
264 -- {End of comments}
265 -- ----------------------------------------------------------------------------
266 Procedure lck
267 (p_vehicle_details_id in number
268 ,p_object_version_number in number
269 );
270 --
271 -- ----------------------------------------------------------------------------
272 -- |-----------------------------< convert_args >-----------------------------|
273 -- ----------------------------------------------------------------------------
274 -- {Start Of Comments}
275 --
276 -- Description:
277 -- This function is used to turn attribute parameters into the record
278 -- structure parameter g_rec_type.
279 --
280 -- Prerequisites:
281 -- This is a private function and can only be called from the ins or upd
282 -- attribute processes.
283 --
284 -- In Parameters:
285 --
286 -- Post Success:
287 -- A returning record structure will be returned.
288 --
289 -- Post Failure:
290 -- No direct error handling is required within this function. Any possible
291 -- errors within this function will be a PL/SQL value error due to conversion
292 -- of datatypes or data lengths.
293 --
294 -- Developer Implementation Notes:
295 -- None.
296 --
297 -- Access Status:
298 -- Internal Row Handler Use Only.
299 --
300 -- {End Of Comments}
301 -- ----------------------------------------------------------------------------
302 Function convert_args
303 (p_vehicle_details_id in number
304 ,p_vehicle_type in varchar2
305 ,p_business_group_id in number
306 ,p_registration_number in varchar2
307 ,p_make in varchar2
308 ,p_model in varchar2
309 ,p_date_first_registered in date
310 ,p_engine_capacity_in_cc in number
311 ,p_fuel_type in varchar2
312 ,p_fuel_card in varchar2
313 ,p_currency_code in varchar2
314 ,p_list_price in number
315 ,p_accessory_value_at_startdate in number
316 ,p_accessory_value_added_later in number
317 -- ,p_capital_contributions in number
318 -- ,p_private_use_contributions in number
319 ,p_market_value_classic_car in number
320 ,p_co2_emissions in number
321 ,p_vehicle_provider in varchar2
322 ,p_object_version_number in number
323 ,p_vehicle_identification_numbe in varchar2
324 ,p_vehicle_ownership in varchar2
325 ,p_vhd_attribute_category in varchar2
326 ,p_vhd_attribute1 in varchar2
327 ,p_vhd_attribute2 in varchar2
328 ,p_vhd_attribute3 in varchar2
329 ,p_vhd_attribute4 in varchar2
330 ,p_vhd_attribute5 in varchar2
331 ,p_vhd_attribute6 in varchar2
332 ,p_vhd_attribute7 in varchar2
333 ,p_vhd_attribute8 in varchar2
334 ,p_vhd_attribute9 in varchar2
335 ,p_vhd_attribute10 in varchar2
336 ,p_vhd_attribute11 in varchar2
337 ,p_vhd_attribute12 in varchar2
338 ,p_vhd_attribute13 in varchar2
339 ,p_vhd_attribute14 in varchar2
340 ,p_vhd_attribute15 in varchar2
341 ,p_vhd_attribute16 in varchar2
342 ,p_vhd_attribute17 in varchar2
343 ,p_vhd_attribute18 in varchar2
344 ,p_vhd_attribute19 in varchar2
345 ,p_vhd_attribute20 in varchar2
346 ,p_vhd_information_category in varchar2
347 ,p_vhd_information1 in varchar2
348 ,p_vhd_information2 in varchar2
349 ,p_vhd_information3 in varchar2
350 ,p_vhd_information4 in varchar2
351 ,p_vhd_information5 in varchar2
352 ,p_vhd_information6 in varchar2
353 ,p_vhd_information7 in varchar2
354 ,p_vhd_information8 in varchar2
355 ,p_vhd_information9 in varchar2
356 ,p_vhd_information10 in varchar2
357 ,p_vhd_information11 in varchar2
358 ,p_vhd_information12 in varchar2
362 ,p_vhd_information16 in varchar2
359 ,p_vhd_information13 in varchar2
360 ,p_vhd_information14 in varchar2
361 ,p_vhd_information15 in varchar2
363 ,p_vhd_information17 in varchar2
364 ,p_vhd_information18 in varchar2
365 ,p_vhd_information19 in varchar2
366 ,p_vhd_information20 in varchar2
367 )
368 Return g_rec_type;
369 --
370 end pqp_pvd_shd;