DBA Data[Home] [Help]

PACKAGE BODY: APPS.PQH_CEA_DEL

Source


1 Package Body pqh_cea_del as
2 /* $Header: pqcearhi.pkb 115.5 2003/09/28 21:33:49 scnair ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  pqh_cea_del.';  -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |------------------------------< delete_dml >------------------------------|
12 -- ----------------------------------------------------------------------------
13 -- {Start Of Comments}
14 --
15 -- Description:
16 --   This procedure controls the actual dml delete logic. The functions of
17 --   this procedure are as follows:
18 --   1) To delete the specified row from the schema using the primary key in
19 --      the predicates.
20 --   2) To trap any constraint violations that may have occurred.
21 --   3) To raise any other errors.
22 --
23 -- Prerequisites:
24 --   This is an internal private procedure which must be called from the del
25 --   procedure.
26 --
27 -- In Parameters:
28 --   A Pl/Sql record structre.
29 --
30 -- Post Success:
31 --   The specified row will be delete from the schema.
32 --
33 -- Post Failure:
34 --   If a child integrity constraint violation is raised the
35 --   constraint_error procedure will be called.
36 --
37 -- Developer Implementation Notes:
38 --   None.
39 --
40 -- Access Status:
41 --   Internal Row Handler Use Only.
42 --
43 -- {End Of Comments}
44 -- ----------------------------------------------------------------------------
45 Procedure delete_dml(p_rec in pqh_cea_shd.g_rec_type) is
46 --
47   l_proc  varchar2(72) := g_package||'delete_dml';
48 --
49 Begin
50   hr_utility.set_location('Entering:'||l_proc, 5);
51   --
52   -- Delete the pqh_copy_entity_attribs row.
53   --
54   delete from pqh_copy_entity_attribs
55   where copy_entity_attrib_id = p_rec.copy_entity_attrib_id;
56   --
57   hr_utility.set_location(' Leaving:'||l_proc, 10);
58 --
59 Exception
60   When hr_api.child_integrity_violated then
61     -- Child integrity has been violated
62     pqh_cea_shd.constraint_error
63       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
64   When Others Then
65     Raise;
66 End delete_dml;
67 --
68 -- ----------------------------------------------------------------------------
69 -- |------------------------------< pre_delete >------------------------------|
70 -- ----------------------------------------------------------------------------
71 -- {Start Of Comments}
72 --
73 -- Description:
74 --   This private procedure contains any processing which is required before
75 --   the delete dml.
76 --
77 -- Prerequisites:
78 --   This is an internal procedure which is called from the del procedure.
79 --
80 -- In Parameters:
81 --   A Pl/Sql record structre.
82 --
83 -- Post Success:
84 --   Processing continues.
85 --
86 -- Post Failure:
87 --   If an error has occurred, an error message and exception will be raised
88 --   but not handled.
89 --
90 -- Developer Implementation Notes:
91 --   Any pre-processing required before the delete dml is issued should be
92 --   coded within this procedure. It is important to note that any 3rd party
93 --   maintenance should be reviewed before placing in this procedure.
94 --
95 -- Access Status:
96 --   Internal Row Handler Use Only.
97 --
98 -- {End Of Comments}
99 -- ----------------------------------------------------------------------------
100 Procedure pre_delete(p_rec in pqh_cea_shd.g_rec_type) is
101 --
102   l_proc  varchar2(72) := g_package||'pre_delete';
103 --
104 Begin
105   hr_utility.set_location('Entering:'||l_proc, 5);
106   --
107   hr_utility.set_location(' Leaving:'||l_proc, 10);
108 End pre_delete;
109 --
110 -- ----------------------------------------------------------------------------
111 -- |-----------------------------< post_delete >------------------------------|
112 -- ----------------------------------------------------------------------------
113 -- {Start Of Comments}
114 --
115 -- Description:
116 --   This private procedure contains any processing which is required after the
117 --   delete dml.
118 --
119 -- Prerequisites:
120 --   This is an internal procedure which is called from the del procedure.
121 --
122 -- In Parameters:
123 --   A Pl/Sql record structre.
124 --
125 -- Post Success:
126 --   Processing continues.
127 --
128 -- Post Failure:
129 --   If an error has occurred, an error message and exception will be raised
130 --   but not handled.
131 --
132 -- Developer Implementation Notes:
133 --   Any post-processing required after the delete dml is issued should be
134 --   coded within this procedure. It is important to note that any 3rd party
135 --   maintenance should be reviewed before placing in this procedure.
136 --
137 -- Access Status:
138 --   Internal table Handler Use Only.
139 --
140 -- {End Of Comments}
141 -- ----------------------------------------------------------------------------
142 Procedure post_delete(
143 p_effective_date in date,p_rec in pqh_cea_shd.g_rec_type) is
144 --
145   l_proc  varchar2(72) := g_package||'post_delete';
146 --
147 Begin
148   hr_utility.set_location('Entering:'||l_proc, 5);
149 --
150   --
151   -- Start of API User Hook for post_delete.
152   --
153   begin
154     --
155     pqh_cea_rkd.after_delete
156       (
157   p_copy_entity_attrib_id         =>p_rec.copy_entity_attrib_id
158  ,p_copy_entity_txn_id_o          =>pqh_cea_shd.g_old_rec.copy_entity_txn_id
159  ,p_row_type_cd_o                 =>pqh_cea_shd.g_old_rec.row_type_cd
160  ,p_information_category_o        =>pqh_cea_shd.g_old_rec.information_category
161  ,p_information1_o                =>pqh_cea_shd.g_old_rec.information1
162  ,p_information2_o                =>pqh_cea_shd.g_old_rec.information2
163  ,p_information3_o                =>pqh_cea_shd.g_old_rec.information3
164  ,p_information4_o                =>pqh_cea_shd.g_old_rec.information4
165  ,p_information5_o                =>pqh_cea_shd.g_old_rec.information5
166  ,p_information6_o                =>pqh_cea_shd.g_old_rec.information6
167  ,p_information7_o                =>pqh_cea_shd.g_old_rec.information7
168  ,p_information8_o                =>pqh_cea_shd.g_old_rec.information8
169  ,p_information9_o                =>pqh_cea_shd.g_old_rec.information9
170  ,p_information10_o               =>pqh_cea_shd.g_old_rec.information10
171  ,p_information11_o               =>pqh_cea_shd.g_old_rec.information11
172  ,p_information12_o               =>pqh_cea_shd.g_old_rec.information12
173  ,p_information13_o               =>pqh_cea_shd.g_old_rec.information13
174  ,p_information14_o               =>pqh_cea_shd.g_old_rec.information14
175  ,p_information15_o               =>pqh_cea_shd.g_old_rec.information15
176  ,p_information16_o               =>pqh_cea_shd.g_old_rec.information16
177  ,p_information17_o               =>pqh_cea_shd.g_old_rec.information17
178  ,p_information18_o               =>pqh_cea_shd.g_old_rec.information18
179  ,p_information19_o               =>pqh_cea_shd.g_old_rec.information19
180  ,p_information20_o               =>pqh_cea_shd.g_old_rec.information20
181  ,p_information21_o               =>pqh_cea_shd.g_old_rec.information21
182  ,p_information22_o               =>pqh_cea_shd.g_old_rec.information22
183  ,p_information23_o               =>pqh_cea_shd.g_old_rec.information23
184  ,p_information24_o               =>pqh_cea_shd.g_old_rec.information24
185  ,p_information25_o               =>pqh_cea_shd.g_old_rec.information25
186  ,p_information26_o               =>pqh_cea_shd.g_old_rec.information26
187  ,p_information27_o               =>pqh_cea_shd.g_old_rec.information27
188  ,p_information28_o               =>pqh_cea_shd.g_old_rec.information28
189  ,p_information29_o               =>pqh_cea_shd.g_old_rec.information29
190  ,p_information30_o               =>pqh_cea_shd.g_old_rec.information30
191  ,p_check_information1_o          =>pqh_cea_shd.g_old_rec.check_information1
192  ,p_check_information2_o          =>pqh_cea_shd.g_old_rec.check_information2
193  ,p_check_information3_o          =>pqh_cea_shd.g_old_rec.check_information3
194  ,p_object_version_number_o       =>pqh_cea_shd.g_old_rec.object_version_number
195       );
196     --
197   exception
198     --
199     when hr_api.cannot_find_prog_unit then
200       --
201       hr_api.cannot_find_prog_unit_error
202         (p_module_name => 'pqh_copy_entity_attribs'
203         ,p_hook_type   => 'AD');
204       --
205   end;
206   --
207   -- End of API User Hook for post_delete.
208   --
209   --
210   hr_utility.set_location(' Leaving:'||l_proc, 10);
211 End post_delete;
212 --
213 -- ----------------------------------------------------------------------------
214 -- |---------------------------------< del >----------------------------------|
215 -- ----------------------------------------------------------------------------
216 Procedure del
217   (
218   p_effective_date in date,
219   p_rec	      in pqh_cea_shd.g_rec_type
220   ) is
221 --
222   l_proc  varchar2(72) := g_package||'del';
223 --
224 Begin
225   hr_utility.set_location('Entering:'||l_proc, 5);
226   --
227   -- We must lock the row which we need to delete.
228   --
229   pqh_cea_shd.lck
230 	(
231 	p_rec.copy_entity_attrib_id,
232 	p_rec.object_version_number
233 	);
234   --
235   -- Call the supporting delete validate operation
236   --
237   pqh_cea_bus.delete_validate(p_rec
238   ,p_effective_date);
239   --
240   -- Call the supporting pre-delete operation
241   --
242   pre_delete(p_rec);
243   --
244   -- Delete the row.
245   --
246   delete_dml(p_rec);
247   --
248   -- Call the supporting post-delete operation
249   --
250   post_delete(
251 p_effective_date,p_rec);
252 End del;
253 --
254 -- ----------------------------------------------------------------------------
255 -- |---------------------------------< del >----------------------------------|
256 -- ----------------------------------------------------------------------------
257 Procedure del
258   (
259   p_effective_date in date,
260   p_copy_entity_attrib_id              in number,
261   p_object_version_number              in number
262   ) is
263 --
264   l_rec	  pqh_cea_shd.g_rec_type;
265   l_proc  varchar2(72) := g_package||'del';
266 --
267 Begin
268   hr_utility.set_location('Entering:'||l_proc, 5);
269   --
270   -- As the delete procedure accepts a plsql record structure we do need to
271   -- convert the  arguments into the record structure.
272   -- We don't need to call the supplied conversion argument routine as we
273   -- only need a few attributes.
274   --
275   l_rec.copy_entity_attrib_id:= p_copy_entity_attrib_id;
276   l_rec.object_version_number := p_object_version_number;
277   --
278   -- Having converted the arguments into the pqh_cea_rec
279   -- plsql record structure we must call the corresponding entity
280   -- business process
281   --
282   del(
283     p_effective_date,l_rec);
284   --
285   hr_utility.set_location(' Leaving:'||l_proc, 10);
286 End del;
287 --
288 end pqh_cea_del;