DBA Data[Home] [Help]

PACKAGE BODY: APPS.PQH_PTE_INS

Source


1 Package Body pqh_pte_ins as
2 /* $Header: pqpterhi.pkb 115.11 2002/12/12 23:13:54 sgoyal noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  pqh_pte_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 --   3) To insert the row into the schema.
21 --   4) To trap any constraint violations that may have occurred.
22 --   5) To raise any other errors.
23 --
24 -- Prerequisites:
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 Pl/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 Row Handler Use Only.
44 --
45 -- {End Of Comments}
46 -- ----------------------------------------------------------------------------
47 Procedure insert_dml(p_rec in out nocopy pqh_pte_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: pqh_ptx_extra_info
57   --
58   insert into pqh_ptx_extra_info
59   (	ptx_extra_info_id,
60 	information_type,
61 	position_transaction_id,
62         position_extra_info_id,
63 	information_category,
64 	information1,
65 	information2,
66 	information3,
67 	information4,
68 	information5,
69 	information6,
70 	information7,
71 	information8,
72 	information9,
73 	information10,
74 	information11,
75 	information12,
76 	information13,
77 	information14,
78 	information15,
79 	information16,
80 	information17,
81 	information18,
82 	information19,
83 	information20,
84 	information21,
85 	information22,
86 	information23,
87 	information24,
88 	information25,
89 	information26,
90 	information27,
91 	information28,
92 	information29,
93 	information30,
94 	attribute_category,
95 	attribute1,
96 	attribute2,
97 	attribute3,
98 	attribute4,
99 	attribute5,
100 	attribute6,
101 	attribute7,
102 	attribute8,
103 	attribute9,
104 	attribute10,
105 	attribute11,
106 	attribute12,
107 	attribute13,
108 	attribute14,
109 	attribute15,
110 	attribute16,
111 	attribute17,
112 	attribute18,
113 	attribute19,
114 	attribute20,
115 	object_version_number
116   )
117   Values
118   (	p_rec.ptx_extra_info_id,
119 	p_rec.information_type,
120 	p_rec.position_transaction_id,
121         p_rec.position_extra_info_id,
122 	p_rec.information_category,
123 	p_rec.information1,
124 	p_rec.information2,
125 	p_rec.information3,
126 	p_rec.information4,
127 	p_rec.information5,
128 	p_rec.information6,
129 	p_rec.information7,
130 	p_rec.information8,
131 	p_rec.information9,
132 	p_rec.information10,
133 	p_rec.information11,
134 	p_rec.information12,
135 	p_rec.information13,
136 	p_rec.information14,
137 	p_rec.information15,
138 	p_rec.information16,
139 	p_rec.information17,
140 	p_rec.information18,
141 	p_rec.information19,
142 	p_rec.information20,
143 	p_rec.information21,
144 	p_rec.information22,
145 	p_rec.information23,
146 	p_rec.information24,
147 	p_rec.information25,
148 	p_rec.information26,
149 	p_rec.information27,
150 	p_rec.information28,
151 	p_rec.information29,
152 	p_rec.information30,
153 	p_rec.attribute_category,
154 	p_rec.attribute1,
155 	p_rec.attribute2,
156 	p_rec.attribute3,
157 	p_rec.attribute4,
158 	p_rec.attribute5,
159 	p_rec.attribute6,
160 	p_rec.attribute7,
161 	p_rec.attribute8,
162 	p_rec.attribute9,
163 	p_rec.attribute10,
164 	p_rec.attribute11,
165 	p_rec.attribute12,
166 	p_rec.attribute13,
167 	p_rec.attribute14,
168 	p_rec.attribute15,
169 	p_rec.attribute16,
170 	p_rec.attribute17,
171 	p_rec.attribute18,
172 	p_rec.attribute19,
173 	p_rec.attribute20,
174 	p_rec.object_version_number
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     pqh_pte_shd.constraint_error
183       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
184   When hr_api.parent_integrity_violated Then
185     -- Parent integrity has been violated
186     pqh_pte_shd.constraint_error
187       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
188   When hr_api.unique_integrity_violated Then
189     -- Unique integrity has been violated
190     pqh_pte_shd.constraint_error
191       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
192   When Others Then
193     Raise;
194 End insert_dml;
195 --
196 -- ----------------------------------------------------------------------------
197 -- |------------------------------< pre_insert >------------------------------|
198 -- ----------------------------------------------------------------------------
199 -- {Start Of Comments}
200 --
201 -- Description:
202 --   This private procedure contains any processing which is required before
206 --   preparation for the insert dml.
203 --   the insert dml. Presently, if the entity has a corresponding primary
204 --   key which is maintained by an associating sequence, the primary key for
205 --   the entity will be populated with the next sequence value in
207 --
208 -- Prerequisites:
209 --   This is an internal procedure which is called from the ins procedure.
210 --
211 -- In Parameters:
212 --   A Pl/Sql record structre.
213 --
214 -- Post Success:
215 --   Processing continues.
216 --
217 -- Post Failure:
218 --   If an error has occurred, an error message and exception will be raised
219 --   but not handled.
220 --
221 -- Developer Implementation Notes:
222 --   Any pre-processing required before the insert dml is issued should be
223 --   coded within this procedure. As stated above, a good example is the
224 --   generation of a primary key number via a corresponding sequence.
225 --   It is important to note that any 3rd party maintenance should be reviewed
226 --   before placing in this procedure.
227 --
228 -- Access Status:
229 --   Internal Row Handler Use Only.
230 --
231 -- {End Of Comments}
232 -- ----------------------------------------------------------------------------
233 Procedure pre_insert(p_rec  in out nocopy pqh_pte_shd.g_rec_type) is
234 --
235   l_proc  varchar2(72) := g_package||'pre_insert';
236 --
237   Cursor C_Sel1 is select pqh_ptx_extra_info_s.nextval from sys.dual;
238 --
239 --
240 Begin
241   hr_utility.set_location('Entering:'||l_proc, 5);
242   --
243   --
244   -- Select the next sequence number
245   --
246   Open C_Sel1;
247   Fetch C_Sel1 Into p_rec.ptx_extra_info_id;
248   Close C_Sel1;
249   --
250   --
251   --
252   hr_utility.set_location(' Leaving:'||l_proc, 10);
253 End pre_insert;
254 --
255 -- ----------------------------------------------------------------------------
256 -- |-----------------------------< post_insert >------------------------------|
257 -- ----------------------------------------------------------------------------
258 -- {Start Of Comments}
259 --
260 -- Description:
261 --   This private procedure contains any processing which is required after the
262 --   insert dml.
263 --
264 -- Prerequisites:
265 --   This is an internal procedure which is called from the ins procedure.
266 --
267 -- In Parameters:
268 --   A Pl/Sql record structre.
269 --
270 -- Post Success:
271 --   Processing continues.
272 --
273 -- Post Failure:
274 --   If an error has occurred, an error message and exception will be raised
275 --   but not handled.
276 --
277 -- Developer Implementation Notes:
278 --   Any post-processing required after the insert dml is issued should be
279 --   coded within this procedure. It is important to note that any 3rd party
280 --   maintenance should be reviewed before placing in this procedure.
281 --
282 -- Access Status:
283 --   Internal Row Handler Use Only.
284 --
285 -- {End Of Comments}
286 -- ----------------------------------------------------------------------------
287 Procedure post_insert(p_rec in pqh_pte_shd.g_rec_type) is
288 --
289   l_proc  varchar2(72) := g_package||'post_insert';
290 --
291 Begin
292   hr_utility.set_location('Entering:'||l_proc, 5);
293 --
294   --
295   -- Start of API User Hook for post_insert.
296   --
297   begin
298     --
299     pqh_pte_rki.after_insert
300       (
301   p_ptx_extra_info_id             =>p_rec.ptx_extra_info_id
302  ,p_information_type              =>p_rec.information_type
303  ,p_position_transaction_id       =>p_rec.position_transaction_id
304  ,p_position_extra_info_id        =>p_rec.position_extra_info_id
305  ,p_information_category          =>p_rec.information_category
306  ,p_information1                  =>p_rec.information1
307  ,p_information2                  =>p_rec.information2
308  ,p_information3                  =>p_rec.information3
309  ,p_information4                  =>p_rec.information4
310  ,p_information5                  =>p_rec.information5
311  ,p_information6                  =>p_rec.information6
312  ,p_information7                  =>p_rec.information7
313  ,p_information8                  =>p_rec.information8
314  ,p_information9                  =>p_rec.information9
315  ,p_information10                 =>p_rec.information10
316  ,p_information11                 =>p_rec.information11
317  ,p_information12                 =>p_rec.information12
318  ,p_information13                 =>p_rec.information13
319  ,p_information14                 =>p_rec.information14
320  ,p_information15                 =>p_rec.information15
321  ,p_information16                 =>p_rec.information16
322  ,p_information17                 =>p_rec.information17
323  ,p_information18                 =>p_rec.information18
324  ,p_information19                 =>p_rec.information19
325  ,p_information20                 =>p_rec.information20
326  ,p_information21                 =>p_rec.information21
327  ,p_information22                 =>p_rec.information22
328  ,p_information23                 =>p_rec.information23
329  ,p_information24                 =>p_rec.information24
330  ,p_information25                 =>p_rec.information25
331  ,p_information26                 =>p_rec.information26
332  ,p_information27                 =>p_rec.information27
333  ,p_information28                 =>p_rec.information28
334  ,p_information29                 =>p_rec.information29
338  ,p_attribute2                    =>p_rec.attribute2
335  ,p_information30                 =>p_rec.information30
336  ,p_attribute_category            =>p_rec.attribute_category
337  ,p_attribute1                    =>p_rec.attribute1
339  ,p_attribute3                    =>p_rec.attribute3
340  ,p_attribute4                    =>p_rec.attribute4
341  ,p_attribute5                    =>p_rec.attribute5
342  ,p_attribute6                    =>p_rec.attribute6
343  ,p_attribute7                    =>p_rec.attribute7
344  ,p_attribute8                    =>p_rec.attribute8
345  ,p_attribute9                    =>p_rec.attribute9
346  ,p_attribute10                   =>p_rec.attribute10
347  ,p_attribute11                   =>p_rec.attribute11
348  ,p_attribute12                   =>p_rec.attribute12
349  ,p_attribute13                   =>p_rec.attribute13
350  ,p_attribute14                   =>p_rec.attribute14
351  ,p_attribute15                   =>p_rec.attribute15
352  ,p_attribute16                   =>p_rec.attribute16
353  ,p_attribute17                   =>p_rec.attribute17
354  ,p_attribute18                   =>p_rec.attribute18
355  ,p_attribute19                   =>p_rec.attribute19
356  ,p_attribute20                   =>p_rec.attribute20
357  ,p_object_version_number         =>p_rec.object_version_number
358       );
359     --
360   exception
361     --
362     when hr_api.cannot_find_prog_unit then
363       --
364       hr_api.cannot_find_prog_unit_error
365         (p_module_name => 'pqh_ptx_extra_info'
366         ,p_hook_type   => 'AI');
367       --
368   end;
369   --
370   -- End of API User Hook for post_insert.
371   --
372   --
373   hr_utility.set_location(' Leaving:'||l_proc, 10);
374 End post_insert;
375 --
376 -- ----------------------------------------------------------------------------
377 -- |---------------------------------< ins >----------------------------------|
378 -- ----------------------------------------------------------------------------
379 Procedure ins
380   (
381   p_rec        in out nocopy pqh_pte_shd.g_rec_type
382   ) is
383 --
384   l_proc  varchar2(72) := g_package||'ins';
385 --
386 Begin
387   hr_utility.set_location('Entering:'||l_proc, 5);
388   --
389   -- Call the supporting insert validate operations
390   --
391   pqh_pte_bus.insert_validate(p_rec);
392   --
393   -- Call the supporting pre-insert operation
394   --
395   pre_insert(p_rec);
396   --
397   -- Insert the row
398   --
399   insert_dml(p_rec);
400   --
401   -- Call the supporting post-insert operation
402   --
403   post_insert(p_rec);
404 end ins;
405 --
406 -- ----------------------------------------------------------------------------
407 -- |---------------------------------< ins >----------------------------------|
408 -- ----------------------------------------------------------------------------
409 Procedure ins
410   (
411   p_ptx_extra_info_id            out nocopy number,
412   p_information_type             in varchar2,
413   p_position_transaction_id      in number,
414   p_position_extra_info_id       in number,
415   p_information_category         in varchar2         default null,
416   p_information1                 in varchar2         default null,
417   p_information2                 in varchar2         default null,
418   p_information3                 in varchar2         default null,
419   p_information4                 in varchar2         default null,
420   p_information5                 in varchar2         default null,
421   p_information6                 in varchar2         default null,
422   p_information7                 in varchar2         default null,
423   p_information8                 in varchar2         default null,
424   p_information9                 in varchar2         default null,
425   p_information10                in varchar2         default null,
426   p_information11                in varchar2         default null,
427   p_information12                in varchar2         default null,
428   p_information13                in varchar2         default null,
429   p_information14                in varchar2         default null,
430   p_information15                in varchar2         default null,
431   p_information16                in varchar2         default null,
432   p_information17                in varchar2         default null,
433   p_information18                in varchar2         default null,
434   p_information19                in varchar2         default null,
435   p_information20                in varchar2         default null,
436   p_information21                in varchar2         default null,
437   p_information22                in varchar2         default null,
438   p_information23                in varchar2         default null,
439   p_information24                in varchar2         default null,
440   p_information25                in varchar2         default null,
441   p_information26                in varchar2         default null,
442   p_information27                in varchar2         default null,
443   p_information28                in varchar2         default null,
444   p_information29                in varchar2         default null,
445   p_information30                in varchar2         default null,
446   p_attribute_category           in varchar2         default null,
447   p_attribute1                   in varchar2         default null,
448   p_attribute2                   in varchar2         default null,
449   p_attribute3                   in varchar2         default null,
450   p_attribute4                   in varchar2         default null,
451   p_attribute5                   in varchar2         default null,
452   p_attribute6                   in varchar2         default null,
453   p_attribute7                   in varchar2         default null,
454   p_attribute8                   in varchar2         default null,
455   p_attribute9                   in varchar2         default null,
456   p_attribute10                  in varchar2         default null,
457   p_attribute11                  in varchar2         default null,
458   p_attribute12                  in varchar2         default null,
459   p_attribute13                  in varchar2         default null,
460   p_attribute14                  in varchar2         default null,
461   p_attribute15                  in varchar2         default null,
462   p_attribute16                  in varchar2         default null,
463   p_attribute17                  in varchar2         default null,
464   p_attribute18                  in varchar2         default null,
465   p_attribute19                  in varchar2         default null,
466   p_attribute20                  in varchar2         default null,
467   p_object_version_number        out nocopy number
468   ) is
469 --
470   l_rec	  pqh_pte_shd.g_rec_type;
471   l_proc  varchar2(72) := g_package||'ins';
472 --
473 Begin
474   hr_utility.set_location('Entering:'||l_proc, 5);
475   --
476   -- Call conversion function to turn arguments into the
477   -- p_rec structure.
478   --
479   l_rec :=
480   pqh_pte_shd.convert_args
481   (
482   null,
483   p_information_type,
484   p_position_transaction_id,
485   p_position_extra_info_id,
486   p_information_category,
487   p_information1,
488   p_information2,
489   p_information3,
490   p_information4,
491   p_information5,
492   p_information6,
493   p_information7,
494   p_information8,
495   p_information9,
496   p_information10,
497   p_information11,
498   p_information12,
499   p_information13,
500   p_information14,
501   p_information15,
502   p_information16,
503   p_information17,
504   p_information18,
505   p_information19,
506   p_information20,
507   p_information21,
508   p_information22,
509   p_information23,
510   p_information24,
511   p_information25,
512   p_information26,
513   p_information27,
514   p_information28,
515   p_information29,
516   p_information30,
517   p_attribute_category,
518   p_attribute1,
519   p_attribute2,
520   p_attribute3,
521   p_attribute4,
522   p_attribute5,
523   p_attribute6,
524   p_attribute7,
525   p_attribute8,
526   p_attribute9,
527   p_attribute10,
528   p_attribute11,
529   p_attribute12,
530   p_attribute13,
531   p_attribute14,
532   p_attribute15,
533   p_attribute16,
534   p_attribute17,
535   p_attribute18,
536   p_attribute19,
537   p_attribute20,
538   null
539   );
540   --
541   -- Having converted the arguments into the pqh_pte_rec
542   -- plsql record structure we call the corresponding record business process.
543   --
544   ins(l_rec);
545   --
546   -- As the primary key argument(s)
547   -- are specified as an OUT's we must set these values.
548   --
549   p_ptx_extra_info_id := l_rec.ptx_extra_info_id;
550   p_object_version_number := l_rec.object_version_number;
551   --
552   hr_utility.set_location(' Leaving:'||l_proc, 10);
553 End ins;
554 --
555 end pqh_pte_ins;