[Home] [Help]
PACKAGE BODY: APPS.OTA_PLE_SHD
Source
1 Package Body ota_ple_shd as
2 /* $Header: otple01t.pkb 115.3 99/07/16 00:52:56 porting ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' ota_ple_shd.'; -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |------------------------< return_api_dml_status >-------------------------|
12 -- ----------------------------------------------------------------------------
13 Function return_api_dml_status Return Boolean Is
14 --
15 l_proc varchar2(72) := g_package||'return_api_dml_status';
16 --
17 Begin
18 hr_utility.set_location('Entering:'||l_proc, 5);
19 --
20 Return (nvl(g_api_dml, false));
21 --
22 hr_utility.set_location(' Leaving:'||l_proc, 10);
23 End return_api_dml_status;
24 --
25 -- ----------------------------------------------------------------------------
26 -- |---------------------------< constraint_error >---------------------------|
27 -- ----------------------------------------------------------------------------
28 Procedure constraint_error
29 (p_constraint_name in varchar2) Is
30 --
31 l_proc varchar2(72) := g_package||'constraint_error';
32 --
33 Begin
34 hr_utility.set_location('Entering:'||l_proc, 5);
35 --
36 If (p_constraint_name = 'OTA_PLE_DATES_ORDER') Then
37 hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
38 hr_utility.set_message_token('PROCEDURE', l_proc);
39 hr_utility.set_message_token('STEP','5');
40 hr_utility.raise_error;
41 ElsIf (p_constraint_name = 'OTA_PLE_MAX_ATTENDEES_NOTNULL') Then
42 hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
43 hr_utility.set_message_token('PROCEDURE', l_proc);
44 hr_utility.set_message_token('STEP','10');
45 hr_utility.raise_error;
46 ElsIf (p_constraint_name = 'OTA_PLE_MAX_ATTENDEES_NULL') Then
47 hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
48 hr_utility.set_message_token('PROCEDURE', l_proc);
49 hr_utility.set_message_token('STEP','15');
50 hr_utility.raise_error;
51 ElsIf (p_constraint_name = 'OTA_PLE_MIN_ATTENDEES_NOTNULL') Then
52 hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
53 hr_utility.set_message_token('PROCEDURE', l_proc);
54 hr_utility.set_message_token('STEP','20');
55 hr_utility.raise_error;
56 ElsIf (p_constraint_name = 'OTA_PLE_MIN_ATTENDEES_NULL') Then
57 hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
58 hr_utility.set_message_token('PROCEDURE', l_proc);
59 hr_utility.set_message_token('STEP','25');
60 hr_utility.raise_error;
61 ElsIf (p_constraint_name = 'OTA_PLE_MIN_GREATER_THAN_ONE') Then
62 hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
63 hr_utility.set_message_token('PROCEDURE', l_proc);
64 hr_utility.set_message_token('STEP','30');
65 hr_utility.raise_error;
66 ElsIf (p_constraint_name = 'OTA_PLE_MIN_SMALLER_THAN_MAX') Then
67 hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
68 hr_utility.set_message_token('PROCEDURE', l_proc);
69 hr_utility.set_message_token('STEP','35');
70 hr_utility.raise_error;
71 ElsIf (p_constraint_name = 'OTA_PLE_PRICE_BASIS_CHK') Then
72 hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
73 hr_utility.set_message_token('PROCEDURE', l_proc);
74 hr_utility.set_message_token('STEP','40');
75 hr_utility.raise_error;
76 ElsIf (p_constraint_name = 'OTA_PLE_PRICE_POSITIVE') Then
77 hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
78 hr_utility.set_message_token('PROCEDURE', l_proc);
79 hr_utility.set_message_token('STEP','45');
80 hr_utility.raise_error;
81 ElsIf (p_constraint_name = 'OTA_PLE_VEND_ACTIV_MUT_EXCL') Then
82 hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
83 hr_utility.set_message_token('PROCEDURE', l_proc);
84 hr_utility.set_message_token('STEP','50');
85 hr_utility.raise_error;
86 ElsIf (p_constraint_name = 'OTA_PRICE_LIST_ENTRIES_FK3') Then
87 hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
88 hr_utility.set_message_token('PROCEDURE', l_proc);
89 hr_utility.set_message_token('STEP','55');
90 hr_utility.raise_error;
91 ElsIf (p_constraint_name = 'OTA_PRICE_LIST_ENTRIES_PK') Then
92 hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
93 hr_utility.set_message_token('PROCEDURE', l_proc);
94 hr_utility.set_message_token('STEP','60');
95 hr_utility.raise_error;
96 ElsIf (p_constraint_name = 'OTA_PRICE_LIST_ENTRIES_UK2') Then
97 hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
98 hr_utility.set_message_token('PROCEDURE', l_proc);
99 hr_utility.set_message_token('STEP','65');
100 hr_utility.raise_error;
101 Else
102 hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
103 hr_utility.set_message_token('PROCEDURE', l_proc);
104 hr_utility.set_message_token('STEP','70');
105 hr_utility.raise_error;
106 End If;
107 --
108 hr_utility.set_location(' Leaving:'||l_proc, 10);
109 End constraint_error;
110 --
111 -- ----------------------------------------------------------------------------
112 -- |-----------------------------< api_updating >-----------------------------|
113 -- ----------------------------------------------------------------------------
114 Function api_updating
115 (
116 p_price_list_entry_id in number,
117 p_object_version_number in number
118 ) Return Boolean Is
119 --
120 --
121 -- Cursor selects the 'current' row from the HR Schema
122 --
123 Cursor C_Sel1 is
124 select
125 price_list_entry_id,
126 vendor_supply_id,
127 activity_version_id,
128 price_list_id,
129 object_version_number,
130 price,
131 price_basis,
132 start_date,
133 comments,
134 end_date,
135 maximum_attendees,
136 minimum_attendees,
137 ple_information_category,
138 ple_information1,
139 ple_information2,
140 ple_information3,
141 ple_information4,
142 ple_information5,
143 ple_information6,
144 ple_information7,
145 ple_information8,
146 ple_information9,
147 ple_information10,
148 ple_information11,
149 ple_information12,
150 ple_information13,
151 ple_information14,
152 ple_information15,
153 ple_information16,
154 ple_information17,
155 ple_information18,
156 ple_information19,
157 ple_information20
158 from ota_price_list_entries
159 where price_list_entry_id = p_price_list_entry_id;
160 --
161 l_proc varchar2(72) := g_package||'api_updating';
162 l_fct_ret boolean;
163 --
164 Begin
165 hr_utility.set_location('Entering:'||l_proc, 5);
166 --
167 If (
168 p_price_list_entry_id is null and
169 p_object_version_number is null
170 ) Then
171 --
172 -- One of the primary key arguments is null therefore we must
173 -- set the returning function value to false
174 --
175 l_fct_ret := false;
176 Else
177 If (
178 p_price_list_entry_id = g_old_rec.price_list_entry_id and
179 p_object_version_number = g_old_rec.object_version_number
180 ) Then
181 hr_utility.set_location(l_proc, 10);
182 --
183 -- The g_old_rec is current therefore we must
184 -- set the returning function to true
185 --
186 l_fct_ret := true;
187 Else
188 --
189 -- Select the current row into g_old_rec
190 --
191 Open C_Sel1;
192 Fetch C_Sel1 Into g_old_rec;
193 If C_Sel1%notfound Then
194 Close C_Sel1;
195 --
196 -- The primary key is invalid therefore we must error
197 --
198 hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
199 hr_utility.raise_error;
200 End If;
201 Close C_Sel1;
202 If (p_object_version_number <> g_old_rec.object_version_number) Then
203 hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
204 hr_utility.raise_error;
205 End If;
206 hr_utility.set_location(l_proc, 15);
207 l_fct_ret := true;
208 End If;
209 End If;
210 hr_utility.set_location(' Leaving:'||l_proc, 20);
211 Return (l_fct_ret);
212 --
213 End api_updating;
214 --
215 -- ----------------------------------------------------------------------------
216 -- |---------------------------------< lck >----------------------------------|
217 -- ----------------------------------------------------------------------------
218 Procedure lck
219 (
220 p_price_list_entry_id in number,
221 p_object_version_number in number
222 ) is
223 --
224 -- Cursor selects the 'current' row from the HR Schema
225 --
226 Cursor C_Sel1 is
227 select price_list_entry_id,
228 vendor_supply_id,
229 activity_version_id,
230 price_list_id,
231 object_version_number,
232 price,
233 price_basis,
234 start_date,
235 comments,
236 end_date,
237 maximum_attendees,
238 minimum_attendees,
239 ple_information_category,
240 ple_information1,
241 ple_information2,
242 ple_information3,
243 ple_information4,
244 ple_information5,
245 ple_information6,
246 ple_information7,
247 ple_information8,
248 ple_information9,
249 ple_information10,
250 ple_information11,
251 ple_information12,
252 ple_information13,
253 ple_information14,
254 ple_information15,
255 ple_information16,
256 ple_information17,
257 ple_information18,
258 ple_information19,
259 ple_information20
260 from ota_price_list_entries
261 where price_list_entry_id = p_price_list_entry_id
262 for update nowait;
263 --
264 l_proc varchar2(72) := g_package||'lck';
265 --
266 Begin
267 hr_utility.set_location('Entering:'||l_proc, 5);
268 --
269 -- Add any mandatory argument checking here:
270 -- Example:
271 -- hr_api.mandatory_arg_error
272 -- (p_api_name => l_proc,
273 -- p_argument => 'object_version_number',
274 -- p_argument_value => p_object_version_number);
275 --
276 Open C_Sel1;
277 Fetch C_Sel1 Into g_old_rec;
278 If C_Sel1%notfound then
279 Close C_Sel1;
280 --
281 -- The primary key is invalid therefore we must error
282 --
283 hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
284 hr_utility.raise_error;
285 End If;
286 Close C_Sel1;
287 If (p_object_version_number <> g_old_rec.object_version_number) Then
288 hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
289 hr_utility.raise_error;
290 End If;
291 --
292 hr_utility.set_location(' Leaving:'||l_proc, 10);
293 --
294 -- We need to trap the ORA LOCK exception
295 --
296 Exception
297 When HR_Api.Object_Locked then
298 --
299 -- The object is locked therefore we need to supply a meaningful
300 -- error message.
301 --
302 hr_utility.set_message(801, 'HR_7165_OBJECT_LOCKED');
303 hr_utility.set_message_token('TABLE_NAME', 'ota_price_list_entries');
304 hr_utility.raise_error;
305 End lck;
306 --
307 -- ----------------------------------------------------------------------------
308 -- |-----------------------------< convert_args >-----------------------------|
309 -- ----------------------------------------------------------------------------
310 Function convert_args
311 (
312 p_price_list_entry_id in number,
313 p_vendor_supply_id in number,
314 p_activity_version_id in number,
315 p_price_list_id in number,
316 p_object_version_number in number,
317 p_price in number,
318 p_price_basis in varchar2,
319 p_start_date in date,
320 p_comments in varchar2,
321 p_end_date in date,
322 p_maximum_attendees in number,
323 p_minimum_attendees in number,
324 p_ple_information_category in varchar2,
325 p_ple_information1 in varchar2,
326 p_ple_information2 in varchar2,
327 p_ple_information3 in varchar2,
328 p_ple_information4 in varchar2,
329 p_ple_information5 in varchar2,
330 p_ple_information6 in varchar2,
331 p_ple_information7 in varchar2,
332 p_ple_information8 in varchar2,
333 p_ple_information9 in varchar2,
334 p_ple_information10 in varchar2,
335 p_ple_information11 in varchar2,
336 p_ple_information12 in varchar2,
337 p_ple_information13 in varchar2,
338 p_ple_information14 in varchar2,
339 p_ple_information15 in varchar2,
340 p_ple_information16 in varchar2,
341 p_ple_information17 in varchar2,
342 p_ple_information18 in varchar2,
343 p_ple_information19 in varchar2,
344 p_ple_information20 in varchar2
345 )
346 Return g_rec_type is
347 --
348 l_rec g_rec_type;
349 l_proc varchar2(72) := g_package||'convert_args';
350 --
351 Begin
352 --
353 hr_utility.set_location('Entering:'||l_proc, 5);
354 --
355 -- Convert arguments into local l_rec structure.
356 --
357 l_rec.price_list_entry_id := p_price_list_entry_id;
358 l_rec.vendor_supply_id := p_vendor_supply_id;
359 l_rec.activity_version_id := p_activity_version_id;
360 l_rec.price_list_id := p_price_list_id;
361 l_rec.object_version_number := p_object_version_number;
362 l_rec.price := p_price;
363 l_rec.price_basis := p_price_basis;
364 l_rec.start_date := p_start_date;
365 l_rec.comments := p_comments;
366 l_rec.end_date := p_end_date;
367 l_rec.maximum_attendees := p_maximum_attendees;
368 l_rec.minimum_attendees := p_minimum_attendees;
369 l_rec.ple_information_category := p_ple_information_category;
370 l_rec.ple_information1 := p_ple_information1;
371 l_rec.ple_information2 := p_ple_information2;
372 l_rec.ple_information3 := p_ple_information3;
373 l_rec.ple_information4 := p_ple_information4;
374 l_rec.ple_information5 := p_ple_information5;
375 l_rec.ple_information6 := p_ple_information6;
376 l_rec.ple_information7 := p_ple_information7;
377 l_rec.ple_information8 := p_ple_information8;
378 l_rec.ple_information9 := p_ple_information9;
379 l_rec.ple_information10 := p_ple_information10;
380 l_rec.ple_information11 := p_ple_information11;
381 l_rec.ple_information12 := p_ple_information12;
382 l_rec.ple_information13 := p_ple_information13;
383 l_rec.ple_information14 := p_ple_information14;
384 l_rec.ple_information15 := p_ple_information15;
385 l_rec.ple_information16 := p_ple_information16;
386 l_rec.ple_information17 := p_ple_information17;
387 l_rec.ple_information18 := p_ple_information18;
388 l_rec.ple_information19 := p_ple_information19;
389 l_rec.ple_information20 := p_ple_information20;
390 --
391 -- Return the plsql record structure.
392 --
393 hr_utility.set_location(' Leaving:'||l_proc, 10);
394 Return(l_rec);
395 --
396 End convert_args;
397 --
398 end ota_ple_shd;