DBA Data[Home] [Help]

PACKAGE BODY: APPS.PAY_AUD_INS

Source


1 Package Body pay_aud_ins as
2 /* $Header: pyaudrhi.pkb 115.4 2002/12/09 10:29:32 alogue ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  pay_aud_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
20 --   2) To set and unset the g_api_dml status as required (as we are about to
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.
21 --      perform dml).
22 --   3) To insert the row into the schema.
23 --   4) To trap any constraint violations that may have occurred.
24 --   5) To raise any other errors.
25 --
26 -- Prerequisites:
27 --   This is an internal private procedure which must be called from the ins
28 --   procedure and must have all mandatory attributes set (except the
29 --   object_version_number which is initialised within this procedure).
30 --
31 -- In Parameters:
32 --   A Pl/Sql record structre.
33 --
34 -- Post Success:
35 --   The specified row will be inserted into the schema.
36 --
37 -- Post Failure:
38 --   On the insert dml failure it is important to note that we always reset the
39 --   g_api_dml status to false.
40 --   If a check, unique or parent integrity constraint violation is raised the
41 --   constraint_error procedure will be called.
42 --   If any other error is reported, the error will be raised after the
43 --   g_api_dml status is reset.
44 --
45 -- Developer Implementation Notes:
46 --   None.
47 --
48 -- Access Status:
49 --   Internal Row Handler Use Only.
50 --
51 -- {End Of Comments}
52 -- ----------------------------------------------------------------------------
53 Procedure insert_dml
54   (p_rec in out nocopy pay_aud_shd.g_rec_type
55   ) is
56 --
57   l_proc  varchar2(72) := g_package||'insert_dml';
58 --
59 Begin
60   hr_utility.set_location('Entering:'||l_proc, 5);
61   p_rec.object_version_number := 1;  -- Initialise the object version
62   --
63   --
64   --
65   -- Insert the row into: pay_stat_trans_audit
66   --
67   insert into pay_stat_trans_audit
68       (stat_trans_audit_id
69       ,transaction_type
70       ,transaction_subtype
71       ,transaction_date
72       ,transaction_effective_date
73       ,business_group_id
74       ,person_id
75       ,assignment_id
76       ,source1
77       ,source1_type
78       ,source2
79       ,source2_type
80       ,source3
81       ,source3_type
82       ,source4
83       ,source4_type
84       ,source5
85       ,source5_type
86       ,transaction_parent_id
87       ,audit_information_category
88       ,audit_information1
89       ,audit_information2
90       ,audit_information3
91       ,audit_information4
92       ,audit_information5
93       ,audit_information6
94       ,audit_information7
95       ,audit_information8
96       ,audit_information9
97       ,audit_information10
98       ,audit_information11
99       ,audit_information12
100       ,audit_information13
101       ,audit_information14
102       ,audit_information15
103       ,audit_information16
104       ,audit_information17
105       ,audit_information18
106       ,audit_information19
107       ,audit_information20
108       ,audit_information21
109       ,audit_information22
110       ,audit_information23
111       ,audit_information24
112       ,audit_information25
113       ,audit_information26
114       ,audit_information27
115       ,audit_information28
116       ,audit_information29
117       ,audit_information30
118       ,title
119       ,object_version_number
120       )
121   Values
122     (p_rec.stat_trans_audit_id
123     ,p_rec.transaction_type
124     ,p_rec.transaction_subtype
125     ,p_rec.transaction_date
126     ,p_rec.transaction_effective_date
127     ,p_rec.business_group_id
128     ,p_rec.person_id
129     ,p_rec.assignment_id
130     ,p_rec.source1
131     ,p_rec.source1_type
132     ,p_rec.source2
133     ,p_rec.source2_type
134     ,p_rec.source3
135     ,p_rec.source3_type
136     ,p_rec.source4
137     ,p_rec.source4_type
138     ,p_rec.source5
139     ,p_rec.source5_type
140     ,p_rec.transaction_parent_id
141     ,p_rec.audit_information_category
142     ,p_rec.audit_information1
143     ,p_rec.audit_information2
144     ,p_rec.audit_information3
145     ,p_rec.audit_information4
146     ,p_rec.audit_information5
147     ,p_rec.audit_information6
148     ,p_rec.audit_information7
149     ,p_rec.audit_information8
150     ,p_rec.audit_information9
151     ,p_rec.audit_information10
152     ,p_rec.audit_information11
153     ,p_rec.audit_information12
154     ,p_rec.audit_information13
155     ,p_rec.audit_information14
156     ,p_rec.audit_information15
157     ,p_rec.audit_information16
158     ,p_rec.audit_information17
159     ,p_rec.audit_information18
160     ,p_rec.audit_information19
161     ,p_rec.audit_information20
162     ,p_rec.audit_information21
163     ,p_rec.audit_information22
164     ,p_rec.audit_information23
165     ,p_rec.audit_information24
166     ,p_rec.audit_information25
167     ,p_rec.audit_information26
168     ,p_rec.audit_information27
169     ,p_rec.audit_information28
170     ,p_rec.audit_information29
171     ,p_rec.audit_information30
172     ,p_rec.title
173     ,p_rec.object_version_number
174     );
175   --
176   --
177   --
178   hr_utility.set_location(' Leaving:'||l_proc, 10);
179 Exception
180   When hr_api.check_integrity_violated Then
181     -- A check constraint has been violated
182     --
183     pay_aud_shd.constraint_error
184       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
185   When hr_api.parent_integrity_violated Then
186     -- Parent integrity has been violated
187     --
188     pay_aud_shd.constraint_error
189       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
190   When hr_api.unique_integrity_violated Then
191     -- Unique integrity has been violated
192     --
193     pay_aud_shd.constraint_error
194       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
195   When Others Then
196     --
197     Raise;
198 End insert_dml;
199 --
200 -- ----------------------------------------------------------------------------
201 -- |------------------------------< pre_insert >------------------------------|
202 -- ----------------------------------------------------------------------------
203 -- {Start Of Comments}
204 --
205 -- Description:
206 --   This private procedure contains any processing which is required before
207 --   the insert dml. Presently, if the entity has a corresponding primary
208 --   key which is maintained by an associating sequence, the primary key for
209 --   the entity will be populated with the next sequence value in
210 --   preparation for the insert dml.
211 --
212 -- Prerequisites:
213 --   This is an internal procedure which is called from the ins procedure.
214 --
215 -- In Parameters:
216 --   A Pl/Sql record structre.
217 --
218 -- Post Success:
219 --   Processing continues.
220 --
221 -- Post Failure:
222 --   If an error has occurred, an error message and exception will be raised
223 --   but not handled.
224 --
225 -- Developer Implementation Notes:
226 --   Any pre-processing required before the insert dml is issued should be
227 --   coded within this procedure. As stated above, a good example is the
228 --   generation of a primary key number via a corresponding sequence.
229 --   It is important to note that any 3rd party maintenance should be reviewed
230 --   before placing in this procedure.
231 --
232 -- Access Status:
233 --   Internal Row Handler Use Only.
234 --
235 -- {End Of Comments}
236 -- ----------------------------------------------------------------------------
237 Procedure pre_insert
238   (p_rec  in out nocopy pay_aud_shd.g_rec_type
239   ) is
240 --
241   l_proc  varchar2(72) := g_package||'pre_insert';
242 --
243   Cursor C_Sel1 is select pay_stat_trans_audit_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.stat_trans_audit_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 -- Prerequisites:
268 --   This is an internal procedure which is called from the ins procedure.
269 --
270 -- In Parameters:
271 --   A Pl/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 placing in this procedure.
284 --
285 -- Access Status:
286 --   Internal Row Handler Use Only.
287 --
288 -- {End Of Comments}
289 -- ----------------------------------------------------------------------------
290 Procedure post_insert
291   (p_effective_date               in date
292   ,p_rec                          in pay_aud_shd.g_rec_type
293   ) is
294 --
295   l_proc  varchar2(72) := g_package||'post_insert';
296 --
297 Begin
298   hr_utility.set_location('Entering:'||l_proc, 5);
299   begin
300     --
301     pay_aud_rki.after_insert
302       (p_effective_date              => p_effective_date
303       ,p_stat_trans_audit_id
304       => p_rec.stat_trans_audit_id
305       ,p_transaction_type
306       => p_rec.transaction_type
307       ,p_transaction_subtype
308       => p_rec.transaction_subtype
309       ,p_transaction_date
310       => p_rec.transaction_date
311       ,p_transaction_effective_date
312       => p_rec.transaction_effective_date
313       ,p_business_group_id
314       => p_rec.business_group_id
315       ,p_person_id
316       => p_rec.person_id
317       ,p_assignment_id
318       => p_rec.assignment_id
319       ,p_source1
320       => p_rec.source1
321       ,p_source1_type
322       => p_rec.source1_type
323       ,p_source2
324       => p_rec.source2
325       ,p_source2_type
326       => p_rec.source2_type
327       ,p_source3
328       => p_rec.source3
329       ,p_source3_type
330       => p_rec.source3_type
331       ,p_source4
332       => p_rec.source4
333       ,p_source4_type
334       => p_rec.source4_type
335       ,p_source5
336       => p_rec.source5
337       ,p_source5_type
338       => p_rec.source5_type
339       ,p_transaction_parent_id
340       => p_rec.transaction_parent_id
341       ,p_audit_information_category
342       => p_rec.audit_information_category
343       ,p_audit_information1
344       => p_rec.audit_information1
345       ,p_audit_information2
346       => p_rec.audit_information2
347       ,p_audit_information3
348       => p_rec.audit_information3
349       ,p_audit_information4
350       => p_rec.audit_information4
351       ,p_audit_information5
352       => p_rec.audit_information5
353       ,p_audit_information6
354       => p_rec.audit_information6
355       ,p_audit_information7
356       => p_rec.audit_information7
357       ,p_audit_information8
358       => p_rec.audit_information8
359       ,p_audit_information9
360       => p_rec.audit_information9
361       ,p_audit_information10
362       => p_rec.audit_information10
363       ,p_audit_information11
364       => p_rec.audit_information11
365       ,p_audit_information12
366       => p_rec.audit_information12
367       ,p_audit_information13
368       => p_rec.audit_information13
369       ,p_audit_information14
370       => p_rec.audit_information14
371       ,p_audit_information15
372       => p_rec.audit_information15
373       ,p_audit_information16
374       => p_rec.audit_information16
375       ,p_audit_information17
376       => p_rec.audit_information17
377       ,p_audit_information18
378       => p_rec.audit_information18
379       ,p_audit_information19
380       => p_rec.audit_information19
381       ,p_audit_information20
382       => p_rec.audit_information20
383       ,p_audit_information21
384       => p_rec.audit_information21
385       ,p_audit_information22
386       => p_rec.audit_information22
387       ,p_audit_information23
388       => p_rec.audit_information23
392       => p_rec.audit_information25
389       ,p_audit_information24
390       => p_rec.audit_information24
391       ,p_audit_information25
393       ,p_audit_information26
394       => p_rec.audit_information26
395       ,p_audit_information27
396       => p_rec.audit_information27
397       ,p_audit_information28
398       => p_rec.audit_information28
399       ,p_audit_information29
400       => p_rec.audit_information29
401       ,p_audit_information30
402       => p_rec.audit_information30
403       ,p_title
404       => p_rec.title
405       ,p_object_version_number
406       => p_rec.object_version_number
407       );
408     --
409   exception
410     --
411     when hr_api.cannot_find_prog_unit then
412       --
413       hr_api.cannot_find_prog_unit_error
414         (p_module_name => 'PAY_STAT_TRANS_AUDIT'
415         ,p_hook_type   => 'AI');
416       --
417   end;
418   --
419   hr_utility.set_location(' Leaving:'||l_proc, 10);
420 End post_insert;
421 --
422 -- ----------------------------------------------------------------------------
423 -- |---------------------------------< ins >----------------------------------|
424 -- ----------------------------------------------------------------------------
425 Procedure ins
426   (p_effective_date               in date
427   ,p_rec                          in out nocopy pay_aud_shd.g_rec_type
428   ) is
429 --
430   l_proc  varchar2(72) := g_package||'ins';
431 --
432 Begin
433   hr_utility.set_location('Entering:'||l_proc, 5);
434   --
435   -- Call the supporting insert validate operations
436   --
437   pay_aud_bus.insert_validate
438      (p_effective_date
439      ,p_rec
440      );
441   --
442   -- Call the supporting pre-insert operation
443   --
444   pay_aud_ins.pre_insert(p_rec);
445   --
446   -- Insert the row
447   --
448   pay_aud_ins.insert_dml(p_rec);
449   --
450   -- Call the supporting post-insert operation
451   --
452   pay_aud_ins.post_insert
453      (p_effective_date
454      ,p_rec
455      );
456   --
457   hr_utility.set_location('Leaving:'||l_proc, 20);
458 end ins;
459 --
460 -- ----------------------------------------------------------------------------
461 -- |---------------------------------< ins >----------------------------------|
462 -- ----------------------------------------------------------------------------
463 Procedure ins
464   (p_effective_date               in     date
465   ,p_transaction_type               in     varchar2
466   ,p_transaction_date               in     date
467   ,p_transaction_effective_date     in     date
468   ,p_business_group_id              in     number
469   ,p_transaction_subtype            in     varchar2 default null
470   ,p_person_id                      in     number   default null
471   ,p_assignment_id                  in     number   default null
472   ,p_source1                        in     varchar2 default null
473   ,p_source1_type                   in     varchar2 default null
474   ,p_source2                        in     varchar2 default null
475   ,p_source2_type                   in     varchar2 default null
476   ,p_source3                        in     varchar2 default null
477   ,p_source3_type                   in     varchar2 default null
478   ,p_source4                        in     varchar2 default null
479   ,p_source4_type                   in     varchar2 default null
480   ,p_source5                        in     varchar2 default null
481   ,p_source5_type                   in     varchar2 default null
482   ,p_transaction_parent_id          in     number   default null
483   ,p_audit_information_category     in     varchar2 default null
484   ,p_audit_information1             in     varchar2 default null
485   ,p_audit_information2             in     varchar2 default null
486   ,p_audit_information3             in     varchar2 default null
487   ,p_audit_information4             in     varchar2 default null
488   ,p_audit_information5             in     varchar2 default null
489   ,p_audit_information6             in     varchar2 default null
490   ,p_audit_information7             in     varchar2 default null
491   ,p_audit_information8             in     varchar2 default null
492   ,p_audit_information9             in     varchar2 default null
493   ,p_audit_information10            in     varchar2 default null
494   ,p_audit_information11            in     varchar2 default null
495   ,p_audit_information12            in     varchar2 default null
496   ,p_audit_information13            in     varchar2 default null
497   ,p_audit_information14            in     varchar2 default null
498   ,p_audit_information15            in     varchar2 default null
499   ,p_audit_information16            in     varchar2 default null
500   ,p_audit_information17            in     varchar2 default null
501   ,p_audit_information18            in     varchar2 default null
502   ,p_audit_information19            in     varchar2 default null
503   ,p_audit_information20            in     varchar2 default null
504   ,p_audit_information21            in     varchar2 default null
505   ,p_audit_information22            in     varchar2 default null
506   ,p_audit_information23            in     varchar2 default null
507   ,p_audit_information24            in     varchar2 default null
508   ,p_audit_information25            in     varchar2 default null
509   ,p_audit_information26            in     varchar2 default null
510   ,p_audit_information27            in     varchar2 default null
511   ,p_audit_information28            in     varchar2 default null
512   ,p_audit_information29            in     varchar2 default null
513   ,p_audit_information30            in     varchar2 default null
514   ,p_title                          in     varchar2 default null
515   ,p_stat_trans_audit_id              out nocopy number
516   ,p_object_version_number            out nocopy number
517   ) is
518 --
519   l_rec	  pay_aud_shd.g_rec_type;
520   l_proc  varchar2(72) := g_package||'ins';
521 --
522 Begin
523   hr_utility.set_location('Entering:'||l_proc, 5);
524   --
525   -- Call conversion function to turn arguments into the
526   -- p_rec structure.
527   --
528   l_rec :=
529   pay_aud_shd.convert_args
530     (null
531     ,p_transaction_type
532     ,p_transaction_subtype
533     ,p_transaction_date
534     ,p_transaction_effective_date
535     ,p_business_group_id
536     ,p_person_id
537     ,p_assignment_id
538     ,p_source1
539     ,p_source1_type
540     ,p_source2
541     ,p_source2_type
542     ,p_source3
543     ,p_source3_type
544     ,p_source4
545     ,p_source4_type
546     ,p_source5
547     ,p_source5_type
548     ,p_transaction_parent_id
549     ,p_audit_information_category
550     ,p_audit_information1
551     ,p_audit_information2
552     ,p_audit_information3
553     ,p_audit_information4
554     ,p_audit_information5
555     ,p_audit_information6
556     ,p_audit_information7
557     ,p_audit_information8
558     ,p_audit_information9
559     ,p_audit_information10
560     ,p_audit_information11
561     ,p_audit_information12
562     ,p_audit_information13
563     ,p_audit_information14
564     ,p_audit_information15
565     ,p_audit_information16
566     ,p_audit_information17
567     ,p_audit_information18
568     ,p_audit_information19
569     ,p_audit_information20
570     ,p_audit_information21
571     ,p_audit_information22
572     ,p_audit_information23
573     ,p_audit_information24
574     ,p_audit_information25
575     ,p_audit_information26
576     ,p_audit_information27
577     ,p_audit_information28
578     ,p_audit_information29
579     ,p_audit_information30
580     ,p_title
581     ,null
582     );
583   --
584   -- Having converted the arguments into the pay_aud_rec
585   -- plsql record structure we call the corresponding record business process.
586   --
587   pay_aud_ins.ins
588      (p_effective_date
589      ,l_rec
590      );
591   --
592   -- As the primary key argument(s)
593   -- are specified as an OUT's we must set these values.
594   --
595   p_stat_trans_audit_id := l_rec.stat_trans_audit_id;
596   p_object_version_number := l_rec.object_version_number;
597   --
598   hr_utility.set_location(' Leaving:'||l_proc, 10);
599 End ins;
600 --
601 end pay_aud_ins;