1 Package Body pay_con_del as
2 /* $Header: pyconrhi.pkb 115.3 1999/12/03 16:45:29 pkm ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' pay_con_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 set and unset the g_api_dml status as required (as we are about to
19 -- perform dml).
20 -- 2) To delete the specified row from the schema using the primary key in
21 -- the predicates.
22 -- 3) To trap any constraint violations that may have occurred.
23 -- 4) To raise any other errors.
24 --
25 -- Prerequisites:
26 -- This is an internal private procedure which must be called from the del
27 -- procedure.
28 --
29 -- In Parameters:
30 -- A Pl/Sql record structre.
31 --
32 -- Post Success:
33 -- The specified row will be delete from the schema.
34 --
35 -- Post Failure:
36 -- On the delete dml failure it is important to note that we always reset the
37 -- g_api_dml status to false.
38 -- If a child integrity constraint violation is raised the
39 -- constraint_error procedure will be called.
40 -- If any other error is reported, the error will be raised after the
41 -- g_api_dml status is reset.
42 --
43 -- Developer Implementation Notes:
44 -- None.
45 --
46 -- Access Status:
47 -- Internal Row Handler Use Only.
48 --
49 -- {End Of Comments}
50 -- ----------------------------------------------------------------------------
51 Procedure delete_dml(p_rec in pay_con_shd.g_rec_type) is
52 --
53 l_proc varchar2(72) := g_package||'delete_dml';
54 --
55 Begin
56 hr_utility.set_location('Entering:'||l_proc, 5);
57 --
58 pay_con_shd.g_api_dml := true; -- Set the api dml status
59 --
60 -- Delete the pay_us_contribution_history row.
61 --
62 delete from pay_us_contribution_history
63 where contr_history_id = p_rec.contr_history_id;
64 --
65 pay_con_shd.g_api_dml := false; -- Unset the api dml status
66 --
67 hr_utility.set_location(' Leaving:'||l_proc, 10);
68 --
69 Exception
70 When hr_api.child_integrity_violated then
71 -- Child integrity has been violated
72 pay_con_shd.g_api_dml := false; -- Unset the api dml status
73 pay_con_shd.constraint_error
74 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
75 When Others Then
76 pay_con_shd.g_api_dml := false; -- Unset the api dml status
77 Raise;
78 End delete_dml;
79 --
80 -- ----------------------------------------------------------------------------
81 -- |------------------------------< pre_delete >------------------------------|
82 -- ----------------------------------------------------------------------------
83 -- {Start Of Comments}
84 --
85 -- Description:
86 -- This private procedure contains any processing which is required before
87 -- the delete dml.
88 --
89 -- Prerequisites:
90 -- This is an internal procedure which is called from the del procedure.
91 --
92 -- In Parameters:
93 -- A Pl/Sql record structre.
94 --
95 -- Post Success:
96 -- Processing continues.
97 --
98 -- Post Failure:
99 -- If an error has occurred, an error message and exception will be raised
100 -- but not handled.
101 --
102 -- Developer Implementation Notes:
103 -- Any pre-processing required before the delete dml is issued should be
104 -- coded within this procedure. It is important to note that any 3rd party
105 -- maintenance should be reviewed before placing in this procedure.
106 --
107 -- Access Status:
108 -- Internal Row Handler Use Only.
109 --
110 -- {End Of Comments}
111 -- ----------------------------------------------------------------------------
112 Procedure pre_delete(p_rec in pay_con_shd.g_rec_type) is
113 --
114 l_proc varchar2(72) := g_package||'pre_delete';
115 --
116 Begin
117 hr_utility.set_location('Entering:'||l_proc, 5);
118 --
119 hr_utility.set_location(' Leaving:'||l_proc, 10);
120 End pre_delete;
121 --
122 -- ----------------------------------------------------------------------------
123 -- |-----------------------------< post_delete >------------------------------|
124 -- ----------------------------------------------------------------------------
125 -- {Start Of Comments}
126 --
127 -- Description:
128 -- This private procedure contains any processing which is required after the
129 -- delete dml.
130 --
131 -- Prerequisites:
132 -- This is an internal procedure which is called from the del procedure.
133 --
134 -- In Parameters:
135 -- A Pl/Sql record structre.
136 --
137 -- Post Success:
138 -- Processing continues.
139 --
140 -- Post Failure:
141 -- If an error has occurred, an error message and exception will be raised
142 -- but not handled.
143 --
144 -- Developer Implementation Notes:
145 -- Any post-processing required after the delete dml is issued should be
146 -- coded within this procedure. It is important to note that any 3rd party
147 -- maintenance should be reviewed before placing in this procedure.
148 --
149 -- Access Status:
150 -- Internal table Handler Use Only.
151 --
152 -- {End Of Comments}
153 -- ----------------------------------------------------------------------------
154 Procedure post_delete(p_rec in pay_con_shd.g_rec_type) is
155 --
156 l_proc varchar2(72) := g_package||'post_delete';
157 --
158 Begin
159 hr_utility.set_location('Entering:'||l_proc, 5);
160 --
161 --
162 -- Start of API User Hook for post_delete.
163 --
164 begin
165 --
166 pay_con_rkd.after_delete
167 (
168 p_contr_history_id =>p_rec.contr_history_id
169 ,p_person_id_o =>pay_con_shd.g_old_rec.person_id
170 ,p_date_from_o =>pay_con_shd.g_old_rec.date_from
171 ,p_date_to_o =>pay_con_shd.g_old_rec.date_to
172 ,p_contr_type_o =>pay_con_shd.g_old_rec.contr_type
173 ,p_business_group_id_o =>pay_con_shd.g_old_rec.business_group_id
174 ,p_legislation_code_o =>pay_con_shd.g_old_rec.legislation_code
175 ,p_amt_contr_o =>pay_con_shd.g_old_rec.amt_contr
176 ,p_max_contr_allowed_o =>pay_con_shd.g_old_rec.max_contr_allowed
177 ,p_includable_comp_o =>pay_con_shd.g_old_rec.includable_comp
178 ,p_tax_unit_id_o =>pay_con_shd.g_old_rec.tax_unit_id
179 ,p_source_system_o =>pay_con_shd.g_old_rec.source_system
180 ,p_contr_information_category_o =>pay_con_shd.g_old_rec.contr_information_category
181 ,p_contr_information1_o =>pay_con_shd.g_old_rec.contr_information1
182 ,p_contr_information2_o =>pay_con_shd.g_old_rec.contr_information2
183 ,p_contr_information3_o =>pay_con_shd.g_old_rec.contr_information3
184 ,p_contr_information4_o =>pay_con_shd.g_old_rec.contr_information4
185 ,p_contr_information5_o =>pay_con_shd.g_old_rec.contr_information5
186 ,p_contr_information6_o =>pay_con_shd.g_old_rec.contr_information6
187 ,p_contr_information7_o =>pay_con_shd.g_old_rec.contr_information7
188 ,p_contr_information8_o =>pay_con_shd.g_old_rec.contr_information8
189 ,p_contr_information9_o =>pay_con_shd.g_old_rec.contr_information9
190 ,p_contr_information10_o =>pay_con_shd.g_old_rec.contr_information10
191 ,p_contr_information11_o =>pay_con_shd.g_old_rec.contr_information11
192 ,p_contr_information12_o =>pay_con_shd.g_old_rec.contr_information12
193 ,p_contr_information13_o =>pay_con_shd.g_old_rec.contr_information13
194 ,p_contr_information14_o =>pay_con_shd.g_old_rec.contr_information14
195 ,p_contr_information15_o =>pay_con_shd.g_old_rec.contr_information15
196 ,p_contr_information16_o =>pay_con_shd.g_old_rec.contr_information16
197 ,p_contr_information17_o =>pay_con_shd.g_old_rec.contr_information17
198 ,p_contr_information18_o =>pay_con_shd.g_old_rec.contr_information18
199 ,p_contr_information19_o =>pay_con_shd.g_old_rec.contr_information19
200 ,p_contr_information20_o =>pay_con_shd.g_old_rec.contr_information20
201 ,p_contr_information21_o =>pay_con_shd.g_old_rec.contr_information21
202 ,p_contr_information22_o =>pay_con_shd.g_old_rec.contr_information22
203 ,p_contr_information23_o =>pay_con_shd.g_old_rec.contr_information23
204 ,p_contr_information24_o =>pay_con_shd.g_old_rec.contr_information24
205 ,p_contr_information25_o =>pay_con_shd.g_old_rec.contr_information25
206 ,p_contr_information26_o =>pay_con_shd.g_old_rec.contr_information26
207 ,p_contr_information27_o =>pay_con_shd.g_old_rec.contr_information27
208 ,p_contr_information28_o =>pay_con_shd.g_old_rec.contr_information28
209 ,p_contr_information29_o =>pay_con_shd.g_old_rec.contr_information29
210 ,p_contr_information30_o =>pay_con_shd.g_old_rec.contr_information30
211 ,p_object_version_number_o =>pay_con_shd.g_old_rec.object_version_number
212 );
213 --
214 exception
215 --
216 when hr_api.cannot_find_prog_unit then
217 --
218 hr_api.cannot_find_prog_unit_error
219 (p_module_name => 'pay_contribution_history'
220 ,p_hook_type => 'AD');
221 --
222 end;
223 --
224 -- End of API User Hook for post_delete.
225 --
226 --
227 hr_utility.set_location(' Leaving:'||l_proc, 10);
228 End post_delete;
229 --
230 -- ----------------------------------------------------------------------------
231 -- |---------------------------------< del >----------------------------------|
232 -- ----------------------------------------------------------------------------
233 Procedure del
234 (
235 p_rec in pay_con_shd.g_rec_type
236 ) is
237 --
238 l_proc varchar2(72) := g_package||'del';
239 --
240 Begin
241 hr_utility.set_location('Entering:'||l_proc, 5);
242 --
243 -- We must lock the row which we need to delete.
244 --
245 pay_con_shd.lck
246 (
247 p_rec.contr_history_id,
248 p_rec.object_version_number
249 );
250 --
251 -- Call the supporting delete validate operation
252 --
253 pay_con_bus.delete_validate(p_rec);
254 --
255 -- Call the supporting pre-delete operation
256 --
257 pre_delete(p_rec);
258 --
259 -- Delete the row.
260 --
261 delete_dml(p_rec);
262 --
263 -- Call the supporting post-delete operation
264 --
265 post_delete(p_rec);
266 End del;
267 --
268 -- ----------------------------------------------------------------------------
269 -- |---------------------------------< del >----------------------------------|
270 -- ----------------------------------------------------------------------------
271 Procedure del
272 (
273 p_contr_history_id in number,
274 p_object_version_number in number
275 ) is
276 --
277 l_rec pay_con_shd.g_rec_type;
278 l_proc varchar2(72) := g_package||'del';
279 --
280 Begin
281 hr_utility.set_location('Entering:'||l_proc, 5);
282 --
283 -- As the delete procedure accepts a plsql record structure we do need to
284 -- convert the arguments into the record structure.
285 -- We don't need to call the supplied conversion argument routine as we
286 -- only need a few attributes.
287 --
288 l_rec.contr_history_id:= p_contr_history_id;
289 l_rec.object_version_number := p_object_version_number;
290 --
291 -- Having converted the arguments into the pay_con_rec
292 -- plsql record structure we must call the corresponding entity
293 -- business process
294 --
295 del(l_rec);
296 --
297 hr_utility.set_location(' Leaving:'||l_proc, 10);
298 End del;
299 --
300 end pay_con_del;