[Home] [Help]
PACKAGE BODY: APPS.BEN_ELI_INS
Source
1 Package Body ben_eli_ins as
2 /* $Header: beelirhi.pkb 115.1 2004/04/14 02:40:36 hmani noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' ben_eli_ins.'; -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |------------------------------< insert_dml >------------------------------|
12 -- ----------------------------------------------------------------------------
13 -- {Start Of Comments}
14 --
15 -- Description:
16 -- This procedure controls the actual dml insert logic. The processing of
17 -- this procedure are as follows:
18 -- 1) Initialise the object_version_number to 1 if the object_version_number
19 -- is defined as an attribute for this entity.
20 -- 2) To insert the row into the schema.
21 -- 3) To trap any constraint violations that may have occurred.
22 -- 4) To raise any other errors.
23 --
24 -- Pre Conditions:
25 -- This is an internal private procedure which must be called from the ins
26 -- procedure and must have all mandatory attributes set (except the
27 -- object_version_number which is initialised within this procedure).
28 --
29 -- In Parameters:
30 -- A elp/Sql record structre.
31 --
32 -- Post Success:
33 -- The specified row will be inserted into the schema.
34 --
35 -- Post Failure:
36 -- If a check, unique or parent integrity constraint violation is raised the
37 -- constraint_error procedure will be called.
38 --
39 -- Developer Implementation Notes:
40 -- None.
41 --
42 -- Access Status:
43 -- Internal Table Handelp Use Only.
44 --
45 -- {End Of Comments}
46 -- ----------------------------------------------------------------------------
47 Procedure insert_dml(p_rec in out nocopy ben_eli_shd.g_rec_type) is
48 --
49 l_proc varchar2(72) := g_package||'insert_dml';
50 --
51 Begin
52 hr_utility.set_location('Entering:'||l_proc, 5);
53 p_rec.object_version_number := 1; -- Initialise the object version
54 --
55 --
56 -- Insert the row into: ben_elp_extra_info
57 --
58 insert into ben_elp_extra_info
59 ( elp_extra_info_id,
60 information_type,
61 eligy_prfl_id,
62 request_id,
63 program_application_id,
64 program_id,
65 program_update_date,
66 eli_attribute_category,
67 eli_attribute1,
68 eli_attribute2,
69 eli_attribute3,
70 eli_attribute4,
71 eli_attribute5,
72 eli_attribute6,
73 eli_attribute7,
74 eli_attribute8,
75 eli_attribute9,
76 eli_attribute10,
77 eli_attribute11,
78 eli_attribute12,
79 eli_attribute13,
80 eli_attribute14,
81 eli_attribute15,
82 eli_attribute16,
83 eli_attribute17,
84 eli_attribute18,
85 eli_attribute19,
86 eli_attribute20,
87 eli_information_category,
88 eli_information1,
89 eli_information2,
90 eli_information3,
91 eli_information4,
92 eli_information5,
93 eli_information6,
94 eli_information7,
95 eli_information8,
96 eli_information9,
97 eli_information10,
98 eli_information11,
99 eli_information12,
100 eli_information13,
101 eli_information14,
102 eli_information15,
103 eli_information16,
104 eli_information17,
105 eli_information18,
106 eli_information19,
107 eli_information20,
108 eli_information21,
109 eli_information22,
110 eli_information23,
111 eli_information24,
112 eli_information25,
113 eli_information26,
114 eli_information27,
115 eli_information28,
116 eli_information29,
117 eli_information30,
118 object_version_number
119 )
120 Values
121 ( p_rec.elp_extra_info_id,
122 p_rec.information_type,
123 p_rec.eligy_prfl_id,
124 p_rec.request_id,
125 p_rec.program_application_id,
126 p_rec.program_id,
127 p_rec.program_update_date,
128 p_rec.eli_attribute_category,
129 p_rec.eli_attribute1,
130 p_rec.eli_attribute2,
131 p_rec.eli_attribute3,
132 p_rec.eli_attribute4,
133 p_rec.eli_attribute5,
134 p_rec.eli_attribute6,
135 p_rec.eli_attribute7,
136 p_rec.eli_attribute8,
137 p_rec.eli_attribute9,
138 p_rec.eli_attribute10,
139 p_rec.eli_attribute11,
140 p_rec.eli_attribute12,
141 p_rec.eli_attribute13,
142 p_rec.eli_attribute14,
143 p_rec.eli_attribute15,
144 p_rec.eli_attribute16,
145 p_rec.eli_attribute17,
146 p_rec.eli_attribute18,
147 p_rec.eli_attribute19,
148 p_rec.eli_attribute20,
149 p_rec.eli_information_category,
150 p_rec.eli_information1,
151 p_rec.eli_information2,
152 p_rec.eli_information3,
153 p_rec.eli_information4,
154 p_rec.eli_information5,
155 p_rec.eli_information6,
156 p_rec.eli_information7,
157 p_rec.eli_information8,
158 p_rec.eli_information9,
159 p_rec.eli_information10,
160 p_rec.eli_information11,
161 p_rec.eli_information12,
162 p_rec.eli_information13,
163 p_rec.eli_information14,
164 p_rec.eli_information15,
165 p_rec.eli_information16,
166 p_rec.eli_information17,
167 p_rec.eli_information18,
168 p_rec.eli_information19,
169 p_rec.eli_information20,
170 p_rec.eli_information21,
171 p_rec.eli_information22,
172 p_rec.eli_information23,
173 p_rec.eli_information24,
174 p_rec.eli_information25,
175 p_rec.eli_information26,
176 p_rec.eli_information27,
177 p_rec.eli_information28,
178 p_rec.eli_information29,
179 p_rec.eli_information30,
180 p_rec.object_version_number
181 );
182 --
183 --
184 hr_utility.set_location(' Leaving:'||l_proc, 10);
185 Exception
186 When hr_api.check_integrity_violated Then
187 -- A check constraint has been violated
188 ben_eli_shd.constraint_error
189 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
190 When hr_api.parent_integrity_violated Then
191 -- Parent integrity has been violated
192 ben_eli_shd.constraint_error
193 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
194 When hr_api.unique_integrity_violated Then
195 -- Unique integrity has been violated
196 ben_eli_shd.constraint_error
197 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
198 When Others Then
199 Raise;
200 End insert_dml;
201 --
202 -- ----------------------------------------------------------------------------
203 -- |------------------------------< pre_insert >------------------------------|
204 -- ----------------------------------------------------------------------------
205 -- {Start Of Comments}
206 --
207 -- Description:
208 -- This private procedure contains any processing which is required before
209 -- the insert dml. Presently, if the entity has a corresponding primary
210 -- key which is maintained by an associating sequence, the primary key for
211 -- the entity will be populated with the next sequence value in
212 -- preparation for the insert dml.
213 --
214 -- Pre Conditions:
215 -- This is an internal procedure which is called from the ins procedure.
216 --
217 -- In Parameters:
218 -- A elp/Sql record structre.
219 --
220 -- Post Success:
221 -- Processing continues.
222 --
223 -- Post Failure:
224 -- If an error has occurred, an error message and exception will be raised
225 -- but not handled.
226 --
227 -- Developer Implementation Notes:
228 -- Any pre-processing required before the insert dml is issued should be
229 -- coded within this procedure. As stated above, a good example is the
230 -- generation of a primary key number via a corresponding sequence.
231 -- It is important to note that any 3rd party maintenance should be reviewed
232 -- before elpacing in this procedure.
233 --
234 -- Access Status:
235 -- Internal Table Handelp Use Only.
236 --
237 -- {End Of Comments}
238 -- ----------------------------------------------------------------------------
239 Procedure pre_insert(p_rec in out nocopy ben_eli_shd.g_rec_type) is
240 --
241 l_proc varchar2(72) := g_package||'pre_insert';
242 --
243 Cursor C_Sel1 is select ben_elp_extra_info_s.nextval from sys.dual;
244 --
245 Begin
246 hr_utility.set_location('Entering:'||l_proc, 5);
247 --
248 --
249 -- Select the next sequence number
250 --
251 Open C_Sel1;
252 Fetch C_Sel1 Into p_rec.elp_extra_info_id;
253 Close C_Sel1;
254 --
255 hr_utility.set_location(' Leaving:'||l_proc, 10);
256 End pre_insert;
257 --
258 -- ----------------------------------------------------------------------------
259 -- |-----------------------------< post_insert >------------------------------|
260 -- ----------------------------------------------------------------------------
261 -- {Start Of Comments}
262 --
263 -- Description:
264 -- This private procedure contains any processing which is required after the
265 -- insert dml.
266 --
267 -- Pre Conditions:
268 -- This is an internal procedure which is called from the ins procedure.
269 --
270 -- In Parameters:
271 -- A elp/Sql record structre.
272 --
273 -- Post Success:
274 -- Processing continues.
275 --
276 -- Post Failure:
277 -- If an error has occurred, an error message and exception will be raised
278 -- but not handled.
279 --
280 -- Developer Implementation Notes:
281 -- Any post-processing required after the insert dml is issued should be
282 -- coded within this procedure. It is important to note that any 3rd party
283 -- maintenance should be reviewed before elpacing in this procedure.
284 --
285 -- Access Status:
286 -- Internal Table Handelp Use Only.
287 --
288 -- {End Of Comments}
289 -- ----------------------------------------------------------------------------
290 Procedure post_insert(p_rec in ben_eli_shd.g_rec_type) is
291 --
292 l_proc varchar2(72) := g_package||'post_insert';
293 --
294 Begin
295 hr_utility.set_location('Entering:'||l_proc, 5);
296 --
297 -- This is a hook point and the user hook for post_insert is called here.
298 --
299 begin
300 ben_eli_rki.after_insert (
301 p_elp_extra_info_id => p_rec.elp_extra_info_id ,
302 p_information_type => p_rec.information_type ,
303 p_eligy_prfl_id => p_rec.eligy_prfl_id ,
304 p_request_id => p_rec.request_id ,
305 p_program_application_id => p_rec.program_application_id ,
306 p_program_id => p_rec.program_id ,
307 p_program_update_date => p_rec.program_update_date ,
308 p_eli_attribute_category => p_rec.eli_attribute_category ,
309 p_eli_attribute1 => p_rec.eli_attribute1 ,
310 p_eli_attribute2 => p_rec.eli_attribute2 ,
311 p_eli_attribute3 => p_rec.eli_attribute3 ,
312 p_eli_attribute4 => p_rec.eli_attribute4 ,
313 p_eli_attribute5 => p_rec.eli_attribute5 ,
314 p_eli_attribute6 => p_rec.eli_attribute6 ,
315 p_eli_attribute7 => p_rec.eli_attribute7 ,
316 p_eli_attribute8 => p_rec.eli_attribute8 ,
317 p_eli_attribute9 => p_rec.eli_attribute9 ,
318 p_eli_attribute10 => p_rec.eli_attribute10 ,
319 p_eli_attribute11 => p_rec.eli_attribute11 ,
320 p_eli_attribute12 => p_rec.eli_attribute12 ,
321 p_eli_attribute13 => p_rec.eli_attribute13 ,
322 p_eli_attribute14 => p_rec.eli_attribute14 ,
323 p_eli_attribute15 => p_rec.eli_attribute15 ,
324 p_eli_attribute16 => p_rec.eli_attribute16 ,
325 p_eli_attribute17 => p_rec.eli_attribute17 ,
326 p_eli_attribute18 => p_rec.eli_attribute18 ,
327 p_eli_attribute19 => p_rec.eli_attribute19 ,
328 p_eli_attribute20 => p_rec.eli_attribute20 ,
329 p_eli_information_category => p_rec.eli_information_category ,
330 p_eli_information1 => p_rec.eli_information1 ,
331 p_eli_information2 => p_rec.eli_information2 ,
332 p_eli_information3 => p_rec.eli_information3 ,
333 p_eli_information4 => p_rec.eli_information4 ,
334 p_eli_information5 => p_rec.eli_information5 ,
335 p_eli_information6 => p_rec.eli_information6 ,
336 p_eli_information7 => p_rec.eli_information7 ,
337 p_eli_information8 => p_rec.eli_information8 ,
338 p_eli_information9 => p_rec.eli_information9 ,
339 p_eli_information10 => p_rec.eli_information10 ,
340 p_eli_information11 => p_rec.eli_information11 ,
341 p_eli_information12 => p_rec.eli_information12 ,
342 p_eli_information13 => p_rec.eli_information13 ,
343 p_eli_information14 => p_rec.eli_information14 ,
344 p_eli_information15 => p_rec.eli_information15 ,
345 p_eli_information16 => p_rec.eli_information16 ,
346 p_eli_information17 => p_rec.eli_information17 ,
347 p_eli_information18 => p_rec.eli_information18 ,
348 p_eli_information19 => p_rec.eli_information19 ,
349 p_eli_information20 => p_rec.eli_information20 ,
350 p_eli_information21 => p_rec.eli_information21 ,
351 p_eli_information22 => p_rec.eli_information22 ,
352 p_eli_information23 => p_rec.eli_information23 ,
353 p_eli_information24 => p_rec.eli_information24 ,
354 p_eli_information25 => p_rec.eli_information25 ,
355 p_eli_information26 => p_rec.eli_information26 ,
356 p_eli_information27 => p_rec.eli_information27 ,
357 p_eli_information28 => p_rec.eli_information28 ,
358 p_eli_information29 => p_rec.eli_information29 ,
359 p_eli_information30 => p_rec.eli_information30
360 );
361 exception
362 when hr_api.cannot_find_prog_unit then
363 hr_api.cannot_find_prog_unit_error
364 ( p_module_name => 'BEN_ELP_EXTRA_INFO'
365 ,p_hook_type => 'AI'
366 );
367 end;
368 -- End of API User Hook for post_insert.
369 hr_utility.set_location(' Leaving:'||l_proc, 10);
370 End post_insert;
371 --
372 -- ----------------------------------------------------------------------------
373 -- |---------------------------------< ins >----------------------------------|
374 -- ----------------------------------------------------------------------------
375 Procedure ins
376 (
377 p_rec in out nocopy ben_eli_shd.g_rec_type,
378 p_validate in boolean default false
379 ) is
380 --
381 l_proc varchar2(72) := g_package||'ins';
382 --
383 Begin
384 hr_utility.set_location('Entering:'||l_proc, 5);
385 --
386 -- Determine if the business process is to be validated.
387 --
388 If p_validate then
389 --
390 -- Issue the savepoint.
391 --
392 SAVEPOINT ins_ben_eli;
393 End If;
394 --
395 -- Call the supporting insert validate operations
396 --
397 ben_eli_bus.insert_validate(p_rec);
398 --
399 -- Call the supporting pre-insert operation
400 --
401 pre_insert(p_rec);
402 --
403 -- Insert the row
404 --
405 insert_dml(p_rec);
406 --
407 -- Call the supporting post-insert operation
408 --
409 post_insert(p_rec);
410 --
411 -- If we are validating then raise the Validate_Enabled exception
412 --
413 If p_validate then
414 Raise HR_Api.Validate_Enabled;
415 End If;
416 --
417 hr_utility.set_location(' Leaving:'||l_proc, 10);
418 Exception
419 When HR_Api.Validate_Enabled Then
420 --
421 -- As the Validate_Enabled exception has been raised
422 -- we must rollback to the savepoint
423 --
424 ROLLBACK TO ins_ben_eli;
425 end ins;
426 --
427 -- ----------------------------------------------------------------------------
428 -- |---------------------------------< ins >----------------------------------|
429 -- ----------------------------------------------------------------------------
430 Procedure ins
431 (
432 p_elp_extra_info_id out nocopy number,
433 p_information_type in varchar2,
434 p_eligy_prfl_id in number,
435 p_request_id in number default null,
436 p_program_application_id in number default null,
437 p_program_id in number default null,
438 p_program_update_date in date default null,
439 p_eli_attribute_category in varchar2 default null,
440 p_eli_attribute1 in varchar2 default null,
441 p_eli_attribute2 in varchar2 default null,
442 p_eli_attribute3 in varchar2 default null,
443 p_eli_attribute4 in varchar2 default null,
444 p_eli_attribute5 in varchar2 default null,
445 p_eli_attribute6 in varchar2 default null,
446 p_eli_attribute7 in varchar2 default null,
447 p_eli_attribute8 in varchar2 default null,
448 p_eli_attribute9 in varchar2 default null,
449 p_eli_attribute10 in varchar2 default null,
450 p_eli_attribute11 in varchar2 default null,
451 p_eli_attribute12 in varchar2 default null,
452 p_eli_attribute13 in varchar2 default null,
453 p_eli_attribute14 in varchar2 default null,
454 p_eli_attribute15 in varchar2 default null,
455 p_eli_attribute16 in varchar2 default null,
456 p_eli_attribute17 in varchar2 default null,
457 p_eli_attribute18 in varchar2 default null,
458 p_eli_attribute19 in varchar2 default null,
459 p_eli_attribute20 in varchar2 default null,
460 p_eli_information_category in varchar2 default null,
461 p_eli_information1 in varchar2 default null,
462 p_eli_information2 in varchar2 default null,
463 p_eli_information3 in varchar2 default null,
464 p_eli_information4 in varchar2 default null,
465 p_eli_information5 in varchar2 default null,
466 p_eli_information6 in varchar2 default null,
467 p_eli_information7 in varchar2 default null,
468 p_eli_information8 in varchar2 default null,
469 p_eli_information9 in varchar2 default null,
470 p_eli_information10 in varchar2 default null,
471 p_eli_information11 in varchar2 default null,
472 p_eli_information12 in varchar2 default null,
473 p_eli_information13 in varchar2 default null,
474 p_eli_information14 in varchar2 default null,
475 p_eli_information15 in varchar2 default null,
476 p_eli_information16 in varchar2 default null,
477 p_eli_information17 in varchar2 default null,
478 p_eli_information18 in varchar2 default null,
479 p_eli_information19 in varchar2 default null,
480 p_eli_information20 in varchar2 default null,
481 p_eli_information21 in varchar2 default null,
482 p_eli_information22 in varchar2 default null,
483 p_eli_information23 in varchar2 default null,
484 p_eli_information24 in varchar2 default null,
485 p_eli_information25 in varchar2 default null,
486 p_eli_information26 in varchar2 default null,
487 p_eli_information27 in varchar2 default null,
488 p_eli_information28 in varchar2 default null,
489 p_eli_information29 in varchar2 default null,
490 p_eli_information30 in varchar2 default null,
491 p_object_version_number out nocopy number,
492 p_validate in boolean default false
493 ) is
494 --
495 l_rec ben_eli_shd.g_rec_type;
496 l_proc varchar2(72) := g_package||'ins';
497 --
498 Begin
499 hr_utility.set_location('Entering:'||l_proc, 5);
500 --
501 -- Call conversion function to turn arguments into the
502 -- p_rec structure.
503 --
504 l_rec :=
505 ben_eli_shd.convert_args
506 (
507 null,
508 p_information_type,
509 p_eligy_prfl_id,
510 p_request_id,
511 p_program_application_id,
512 p_program_id,
513 p_program_update_date,
514 p_eli_attribute_category,
515 p_eli_attribute1,
516 p_eli_attribute2,
517 p_eli_attribute3,
518 p_eli_attribute4,
519 p_eli_attribute5,
520 p_eli_attribute6,
521 p_eli_attribute7,
522 p_eli_attribute8,
523 p_eli_attribute9,
524 p_eli_attribute10,
525 p_eli_attribute11,
526 p_eli_attribute12,
527 p_eli_attribute13,
528 p_eli_attribute14,
529 p_eli_attribute15,
530 p_eli_attribute16,
531 p_eli_attribute17,
532 p_eli_attribute18,
533 p_eli_attribute19,
534 p_eli_attribute20,
535 p_eli_information_category,
536 p_eli_information1,
537 p_eli_information2,
538 p_eli_information3,
539 p_eli_information4,
540 p_eli_information5,
541 p_eli_information6,
542 p_eli_information7,
543 p_eli_information8,
544 p_eli_information9,
545 p_eli_information10,
546 p_eli_information11,
547 p_eli_information12,
548 p_eli_information13,
549 p_eli_information14,
550 p_eli_information15,
551 p_eli_information16,
552 p_eli_information17,
553 p_eli_information18,
554 p_eli_information19,
555 p_eli_information20,
556 p_eli_information21,
557 p_eli_information22,
558 p_eli_information23,
559 p_eli_information24,
560 p_eli_information25,
561 p_eli_information26,
562 p_eli_information27,
563 p_eli_information28,
564 p_eli_information29,
565 p_eli_information30,
566 null
567 );
568 --
569 -- Having converted the arguments into the ben_eli_rec
570 -- elpsql record structure we call the corresponding record business process.
571 --
572 ins(l_rec, p_validate);
573 --
574 -- As the primary key argument(s)
575 -- are specified as an OUT's we must set these values.
576 --
577 p_elp_extra_info_id := l_rec.elp_extra_info_id;
578 p_object_version_number := l_rec.object_version_number;
579 --
580 hr_utility.set_location(' Leaving:'||l_proc, 10);
581 End ins;
582 --
583 end ben_eli_ins;