1 Package pqp_vri_shd as
2 /* $Header: pqvrirhi.pkh 120.0.12010000.2 2008/08/08 07:24:24 ubhat ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (veh_repos_extra_info_id number(15)
10 ,vehicle_repository_id number(15)
11 ,information_type varchar2(40)
12 ,vrei_attribute_category varchar2(150)
13 ,vrei_attribute1 varchar2(150)
14 ,vrei_attribute2 varchar2(150)
15 ,vrei_attribute3 varchar2(150)
16 ,vrei_attribute4 varchar2(150)
17 ,vrei_attribute5 varchar2(150)
18 ,vrei_attribute6 varchar2(150)
19 ,vrei_attribute7 varchar2(150)
20 ,vrei_attribute8 varchar2(150)
21 ,vrei_attribute9 varchar2(150)
22 ,vrei_attribute10 varchar2(150)
23 ,vrei_attribute11 varchar2(150)
24 ,vrei_attribute12 varchar2(150)
25 ,vrei_attribute13 varchar2(150)
26 ,vrei_attribute14 varchar2(150)
27 ,vrei_attribute15 varchar2(150)
28 ,vrei_attribute16 varchar2(150)
29 ,vrei_attribute17 varchar2(150)
30 ,vrei_attribute18 varchar2(150)
31 ,vrei_attribute19 varchar2(150)
32 ,vrei_attribute20 varchar2(150)
33 ,vrei_information_category varchar2(150)
34 ,vrei_information1 varchar2(150)
35 ,vrei_information2 varchar2(150)
36 ,vrei_information3 varchar2(150)
37 ,vrei_information4 varchar2(150)
38 ,vrei_information5 varchar2(150)
39 ,vrei_information6 varchar2(150)
40 ,vrei_information7 varchar2(150)
41 ,vrei_information8 varchar2(150)
42 ,vrei_information9 varchar2(150)
43 ,vrei_information10 varchar2(150)
44 ,vrei_information11 varchar2(150)
45 ,vrei_information12 varchar2(150)
46 ,vrei_information13 varchar2(150)
47 ,vrei_information14 varchar2(150)
48 ,vrei_information15 varchar2(150)
49 ,vrei_information16 varchar2(150)
50 ,vrei_information17 varchar2(150)
51 ,vrei_information18 varchar2(150)
52 ,vrei_information19 varchar2(150)
53 ,vrei_information20 varchar2(150)
54 ,vrei_information21 varchar2(150)
55 ,vrei_information22 varchar2(150)
56 ,vrei_information23 varchar2(150)
57 ,vrei_information24 varchar2(150)
58 ,vrei_information25 varchar2(150)
59 ,vrei_information26 varchar2(150)
60 ,vrei_information27 varchar2(150)
61 ,vrei_information28 varchar2(150)
62 ,vrei_information29 varchar2(150)
63 ,vrei_information30 varchar2(150)
64 ,object_version_number number(9)
65 ,request_id number(15)
66 ,program_application_id number(15)
67 ,program_id number(15)
68 ,program_update_date date
69 );
70 --
71 -- ----------------------------------------------------------------------------
72 -- | Global Definitions - Internal Development Use Only |
73 -- ----------------------------------------------------------------------------
74 --
75 g_old_rec g_rec_type; -- Global record definition
76 -- Global table name
77 g_tab_nam constant varchar2(30) := 'PQP_VEH_REPOS_EXTRA_INFO';
78 g_api_dml boolean; -- Global api dml status
79 --
80 -- ----------------------------------------------------------------------------
81 -- |------------------------< return_api_dml_status >-------------------------|
82 -- ----------------------------------------------------------------------------
83 -- {Start Of Comments}
84 --
85 -- Description:
86 -- This function will return the current g_api_dml private global
87 -- boolean status.
88 -- The g_api_dml status determines if at the time of the function
89 -- being executed if a dml statement (i.e. INSERT, UPDATE or DELETE)
90 -- is being issued from within an api.
91 -- If the status is TRUE then a dml statement is being issued from
92 -- within this entity api.
93 -- This function is primarily to support database triggers which
94 -- need to maintain the object_version_number for non-supported
95 -- dml statements (i.e. dml statement issued outside of the api layer).
96 --
97 -- Prerequisites:
98 -- None.
99 --
100 -- In Parameters:
101 -- None.
102 --
103 -- Post Success:
104 -- Processing continues.
105 -- If the function returns a TRUE value then, dml is being executed from
106 -- within this api.
107 --
108 -- Post Failure:
109 -- None.
110 --
111 -- Access Status:
112 -- Internal Row Handler Use Only.
113 --
114 -- {End Of Comments}
115 -- ----------------------------------------------------------------------------
116 Function return_api_dml_status Return Boolean;
117 --
118 -- ----------------------------------------------------------------------------
119 -- |---------------------------< constraint_error >---------------------------|
120 -- ----------------------------------------------------------------------------
121 -- {Start Of Comments}
122 --
123 -- Description:
124 -- This procedure is called when a constraint has been violated (i.e.
125 -- The exception hr_api.check_integrity_violated,
126 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
127 -- hr_api.unique_integrity_violated has been raised).
128 -- The exceptions can only be raised as follows:
129 -- 1) A check constraint can only be violated during an INSERT or UPDATE
130 -- dml operation.
131 -- 2) A parent integrity constraint can only be violated during an
132 -- INSERT or UPDATE dml operation.
133 -- 3) A child integrity constraint can only be violated during an
134 -- DELETE dml operation.
135 -- 4) A unique integrity constraint can only be violated during INSERT or
136 -- UPDATE dml operation.
137 --
138 -- Prerequisites:
139 -- 1) Either hr_api.check_integrity_violated,
140 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
141 -- hr_api.unique_integrity_violated has been raised with the subsequent
142 -- stripping of the constraint name from the generated error message
143 -- text.
144 -- 2) Standalone validation test which corresponds with a constraint error.
145 --
146 -- In Parameter:
147 -- p_constraint_name is in upper format and is just the constraint name
148 -- (e.g. not prefixed by brackets, schema owner etc).
149 --
150 -- Post Success:
151 -- Development dependant.
152 --
153 -- Post Failure:
154 -- Developement dependant.
155 --
156 -- Developer Implementation Notes:
157 -- For each constraint being checked the hr system package failure message
158 -- has been generated as a template only. These system error messages should
159 -- be modified as required (i.e. change the system failure message to a user
160 -- friendly defined error message).
161 --
162 -- Access Status:
163 -- Internal Development Use Only.
164 --
165 -- {End Of Comments}
166 -- ----------------------------------------------------------------------------
167 Procedure constraint_error
168 (p_constraint_name in all_constraints.constraint_name%TYPE);
169 --
170 -- ----------------------------------------------------------------------------
171 -- |-----------------------------< api_updating >-----------------------------|
172 -- ----------------------------------------------------------------------------
173 -- {Start Of Comments}
174 --
175 -- Description:
176 -- This function is used to populate the g_old_rec record with the
177 -- current row from the database for the specified primary key
178 -- provided that the primary key exists and is valid and does not
179 -- already match the current g_old_rec. The function will always return
180 -- a TRUE value if the g_old_rec is populated with the current row.
181 -- A FALSE value will be returned if all of the primary key arguments
182 -- are null.
183 --
184 -- Prerequisites:
185 -- None.
186 --
187 -- In Parameters:
188 --
189 -- Post Success:
190 -- A value of TRUE will be returned indiciating that the g_old_rec
191 -- is current.
192 -- A value of FALSE will be returned if all of the primary key arguments
193 -- have a null value (this indicates that the row has not be inserted into
194 -- the Schema), and therefore could never have a corresponding row.
195 --
196 -- Post Failure:
197 -- A failure can only occur under two circumstances:
198 -- 1) The primary key is invalid (i.e. a row does not exist for the
199 -- specified primary key values).
200 -- 2) If an object_version_number exists but is NOT the same as the current
201 -- g_old_rec value.
202 --
203 -- Developer Implementation Notes:
204 -- None.
205 --
206 -- Access Status:
207 -- Internal Development Use Only.
208 --
209 -- {End Of Comments}
210 -- ----------------------------------------------------------------------------
211 Function api_updating
212 (p_veh_repos_extra_info_id in number
213 ,p_object_version_number in number
214 ) Return Boolean;
215 --
216 -- ----------------------------------------------------------------------------
217 -- |---------------------------------< lck >----------------------------------|
218 -- ----------------------------------------------------------------------------
219 -- {Start of comments}
220 --
221 -- Description:
222 -- The Lck process has two main functions to perform. Firstly, the row to be
223 -- updated or deleted must be locked. The locking of the row will only be
224 -- successful if the row is not currently locked by another user.
225 -- Secondly, during the locking of the row, the row is selected into
226 -- the g_old_rec data structure which enables the current row values from
227 -- the server to be available to the api.
228 --
229 -- Prerequisites:
230 -- When attempting to call the lock the object version number (if defined)
231 -- is mandatory.
232 --
233 -- In Parameters:
234 -- The arguments to the Lck process are the primary key(s) which uniquely
235 -- identify the row and the object version number of row.
236 --
237 -- Post Success:
238 -- On successful completion of the Lck process the row to be updated or
239 -- deleted will be locked and selected into the global data structure
240 -- g_old_rec.
241 --
242 -- Post Failure:
243 -- The Lck process can fail for three reasons:
244 -- 1) When attempting to lock the row the row could already be locked by
245 -- another user. This will raise the HR_Api.Object_Locked exception.
246 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
247 -- This error is trapped and reported using the message name
248 -- 'HR_7220_INVALID_PRIMARY_KEY'.
249 -- 3) The row although existing in the HR Schema has a different object
250 -- version number than the object version number specified.
251 -- This error is trapped and reported using the message name
252 -- 'HR_7155_OBJECT_INVALID'.
253 --
254 -- Developer Implementation Notes:
255 -- For each primary key and the object version number arguments add a
256 -- call to hr_api.mandatory_arg_error procedure to ensure that these
257 -- argument values are not null.
258 --
259 -- Access Status:
260 -- Internal Development Use Only.
261 --
262 -- {End of comments}
263 -- ----------------------------------------------------------------------------
264 Procedure lck
265 (p_veh_repos_extra_info_id in number
266 ,p_object_version_number in number
267 );
268 --
269 -- ----------------------------------------------------------------------------
270 -- |-----------------------------< convert_args >-----------------------------|
271 -- ----------------------------------------------------------------------------
272 -- {Start Of Comments}
273 --
274 -- Description:
275 -- This function is used to turn attribute parameters into the record
276 -- structure parameter g_rec_type.
277 --
278 -- Prerequisites:
279 -- This is a private function and can only be called from the ins or upd
280 -- attribute processes.
281 --
282 -- In Parameters:
283 --
284 -- Post Success:
285 -- A returning record structure will be returned.
286 --
287 -- Post Failure:
288 -- No direct error handling is required within this function. Any possible
289 -- errors within this function will be a PL/SQL value error due to
290 -- conversion of datatypes or data lengths.
291 --
292 -- Developer Implementation Notes:
293 -- None.
294 --
295 -- Access Status:
296 -- Internal Row Handler Use Only.
297 --
298 -- {End Of Comments}
299 -- ----------------------------------------------------------------------------
300 Function convert_args
301 (p_veh_repos_extra_info_id in number
302 ,p_vehicle_repository_id in number
303 ,p_information_type in varchar2
304 ,p_vrei_attribute_category in varchar2
305 ,p_vrei_attribute1 in varchar2
306 ,p_vrei_attribute2 in varchar2
307 ,p_vrei_attribute3 in varchar2
308 ,p_vrei_attribute4 in varchar2
309 ,p_vrei_attribute5 in varchar2
310 ,p_vrei_attribute6 in varchar2
311 ,p_vrei_attribute7 in varchar2
312 ,p_vrei_attribute8 in varchar2
313 ,p_vrei_attribute9 in varchar2
314 ,p_vrei_attribute10 in varchar2
315 ,p_vrei_attribute11 in varchar2
316 ,p_vrei_attribute12 in varchar2
317 ,p_vrei_attribute13 in varchar2
318 ,p_vrei_attribute14 in varchar2
319 ,p_vrei_attribute15 in varchar2
320 ,p_vrei_attribute16 in varchar2
321 ,p_vrei_attribute17 in varchar2
322 ,p_vrei_attribute18 in varchar2
323 ,p_vrei_attribute19 in varchar2
324 ,p_vrei_attribute20 in varchar2
325 ,p_vrei_information_category in varchar2
326 ,p_vrei_information1 in varchar2
327 ,p_vrei_information2 in varchar2
328 ,p_vrei_information3 in varchar2
329 ,p_vrei_information4 in varchar2
330 ,p_vrei_information5 in varchar2
331 ,p_vrei_information6 in varchar2
332 ,p_vrei_information7 in varchar2
333 ,p_vrei_information8 in varchar2
334 ,p_vrei_information9 in varchar2
335 ,p_vrei_information10 in varchar2
336 ,p_vrei_information11 in varchar2
337 ,p_vrei_information12 in varchar2
338 ,p_vrei_information13 in varchar2
339 ,p_vrei_information14 in varchar2
340 ,p_vrei_information15 in varchar2
341 ,p_vrei_information16 in varchar2
342 ,p_vrei_information17 in varchar2
343 ,p_vrei_information18 in varchar2
344 ,p_vrei_information19 in varchar2
345 ,p_vrei_information20 in varchar2
346 ,p_vrei_information21 in varchar2
347 ,p_vrei_information22 in varchar2
348 ,p_vrei_information23 in varchar2
349 ,p_vrei_information24 in varchar2
350 ,p_vrei_information25 in varchar2
351 ,p_vrei_information26 in varchar2
352 ,p_vrei_information27 in varchar2
353 ,p_vrei_information28 in varchar2
354 ,p_vrei_information29 in varchar2
355 ,p_vrei_information30 in varchar2
356 ,p_object_version_number in number
357 ,p_request_id in number
358 ,p_program_application_id in number
359 ,p_program_id in number
360 ,p_program_update_date in date
361 )
362 Return g_rec_type;
363 --
364 end pqp_vri_shd;