DBA Data[Home] [Help]

PACKAGE BODY: APPS.PE_AEI_DEL

Source


1 Package Body pe_aei_del as
2 /* $Header: peaeirhi.pkb 115.8 2002/12/03 15:36:45 raranjan ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  pe_aei_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 -- Pre Conditions:
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 Table Handler Use Only.
42 --
43 -- {End Of Comments}
44 -- ----------------------------------------------------------------------------
45 Procedure delete_dml(p_rec in pe_aei_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 per_assignment_extra_info row.
53   --
54   delete from per_assignment_extra_info
55   where assignment_extra_info_id = p_rec.assignment_extra_info_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     pe_aei_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 -- Pre Conditions:
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 Table Handler Use Only.
97 --
98 -- {End Of Comments}
99 -- ----------------------------------------------------------------------------
100 Procedure pre_delete(p_rec in pe_aei_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 -- Pre Conditions:
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(p_rec in pe_aei_shd.g_rec_type) is
143 --
144   l_proc  varchar2(72) := g_package||'post_delete';
145 --
146 Begin
147   hr_utility.set_location('Entering:'||l_proc, 5);
148   --
149   -- This is a hook point and the user hook for post_delete is called here.
150   --
151   begin
152      pe_aei_rkd.after_delete	(
153 	p_assignment_extra_info_id_o	=>	pe_aei_shd.g_old_rec.assignment_extra_info_id		,
154 	p_assignment_id_o			=>	pe_aei_shd.g_old_rec.assignment_id				,
155 	p_information_type_o		=>	pe_aei_shd.g_old_rec.information_type			,
156 	p_request_id_o			=>	pe_aei_shd.g_old_rec.request_id				,
157 	p_program_application_id_o	=>	pe_aei_shd.g_old_rec.program_application_id		,
158 	p_program_id_o			=>	pe_aei_shd.g_old_rec.program_id				,
159 	p_program_update_date_o		=>	pe_aei_shd.g_old_rec.program_update_date			,
160 	p_aei_attribute_category_o	=>	pe_aei_shd.g_old_rec.aei_attribute_category		,
161 	p_aei_attribute1_o		=>	pe_aei_shd.g_old_rec.aei_attribute1				,
162 	p_aei_attribute2_o		=>	pe_aei_shd.g_old_rec.aei_attribute2				,
163 	p_aei_attribute3_o		=>	pe_aei_shd.g_old_rec.aei_attribute3				,
164 	p_aei_attribute4_o		=>	pe_aei_shd.g_old_rec.aei_attribute4				,
165 	p_aei_attribute5_o		=>	pe_aei_shd.g_old_rec.aei_attribute5				,
166 	p_aei_attribute6_o		=>	pe_aei_shd.g_old_rec.aei_attribute6				,
167 	p_aei_attribute7_o		=>	pe_aei_shd.g_old_rec.aei_attribute7				,
168 	p_aei_attribute8_o		=>	pe_aei_shd.g_old_rec.aei_attribute8				,
169 	p_aei_attribute9_o		=>	pe_aei_shd.g_old_rec.aei_attribute9				,
170 	p_aei_attribute10_o		=>	pe_aei_shd.g_old_rec.aei_attribute10			,
171 	p_aei_attribute11_o		=>	pe_aei_shd.g_old_rec.aei_attribute11			,
172 	p_aei_attribute12_o		=>	pe_aei_shd.g_old_rec.aei_attribute12			,
173 	p_aei_attribute13_o		=>	pe_aei_shd.g_old_rec.aei_attribute13			,
174 	p_aei_attribute14_o		=>	pe_aei_shd.g_old_rec.aei_attribute14			,
175 	p_aei_attribute15_o		=>	pe_aei_shd.g_old_rec.aei_attribute15			,
176 	p_aei_attribute16_o		=>	pe_aei_shd.g_old_rec.aei_attribute16			,
177 	p_aei_attribute17_o		=>	pe_aei_shd.g_old_rec.aei_attribute17			,
178 	p_aei_attribute18_o		=>	pe_aei_shd.g_old_rec.aei_attribute18			,
179 	p_aei_attribute19_o		=>	pe_aei_shd.g_old_rec.aei_attribute19			,
180 	p_aei_attribute20_o		=>	pe_aei_shd.g_old_rec.aei_attribute20			,
181 	p_aei_information_category_o	=>	pe_aei_shd.g_old_rec.aei_information_category		,
182 	p_aei_information1_o		=>	pe_aei_shd.g_old_rec.aei_information1			,
183 	p_aei_information2_o		=>	pe_aei_shd.g_old_rec.aei_information2			,
184 	p_aei_information3_o		=>	pe_aei_shd.g_old_rec.aei_information3			,
185 	p_aei_information4_o		=>	pe_aei_shd.g_old_rec.aei_information4			,
186 	p_aei_information5_o		=>	pe_aei_shd.g_old_rec.aei_information5			,
187 	p_aei_information6_o		=>	pe_aei_shd.g_old_rec.aei_information6			,
188 	p_aei_information7_o		=>	pe_aei_shd.g_old_rec.aei_information7			,
189 	p_aei_information8_o		=>	pe_aei_shd.g_old_rec.aei_information8			,
190 	p_aei_information9_o		=>	pe_aei_shd.g_old_rec.aei_information9			,
191 	p_aei_information10_o		=>	pe_aei_shd.g_old_rec.aei_information10	,
192 	p_aei_information11_o		=>	pe_aei_shd.g_old_rec.aei_information11	,
193 	p_aei_information12_o		=>	pe_aei_shd.g_old_rec.aei_information12	,
194 	p_aei_information13_o		=>	pe_aei_shd.g_old_rec.aei_information13	,
195 	p_aei_information14_o		=>	pe_aei_shd.g_old_rec.aei_information14	,
196 	p_aei_information15_o		=>	pe_aei_shd.g_old_rec.aei_information15	,
197 	p_aei_information16_o		=>	pe_aei_shd.g_old_rec.aei_information16	,
198 	p_aei_information17_o		=>	pe_aei_shd.g_old_rec.aei_information17	,
199 	p_aei_information18_o		=>	pe_aei_shd.g_old_rec.aei_information18	,
200 	p_aei_information19_o		=>	pe_aei_shd.g_old_rec.aei_information19	,
201 	p_aei_information20_o		=>	pe_aei_shd.g_old_rec.aei_information20	,
202 	p_aei_information21_o		=>	pe_aei_shd.g_old_rec.aei_information21	,
203 	p_aei_information22_o		=>	pe_aei_shd.g_old_rec.aei_information22	,
204 	p_aei_information23_o		=>	pe_aei_shd.g_old_rec.aei_information23	,
205 	p_aei_information24_o		=>	pe_aei_shd.g_old_rec.aei_information24	,
206 	p_aei_information25_o		=>	pe_aei_shd.g_old_rec.aei_information25	,
207 	p_aei_information26_o		=>	pe_aei_shd.g_old_rec.aei_information26	,
208 	p_aei_information27_o		=>	pe_aei_shd.g_old_rec.aei_information27	,
209 	p_aei_information28_o		=>	pe_aei_shd.g_old_rec.aei_information28	,
210 	p_aei_information29_o		=>	pe_aei_shd.g_old_rec.aei_information29	,
211 	p_aei_information30_o		=>	pe_aei_shd.g_old_rec.aei_information30
212 	);
213      exception
214         when hr_api.cannot_find_prog_unit then
215              hr_api.cannot_find_prog_unit_error
216 		 (	p_module_name => 'PER_ASSIGNMENT_EXTRA_INFO'
217 			,p_hook_type  => 'AD'
218 	        );
219   end;
220   -- End of API User Hook for post_delete.
221   --
222   hr_utility.set_location(' Leaving:'||l_proc, 10);
223 End post_delete;
224 --
225 -- ----------------------------------------------------------------------------
226 -- |---------------------------------< del >----------------------------------|
227 -- ----------------------------------------------------------------------------
228 Procedure del
229   (
230   p_rec	      in pe_aei_shd.g_rec_type,
231   p_validate  in boolean default false
232   ) is
233 --
234   l_proc  varchar2(72) := g_package||'del';
235 --
236 Begin
237   hr_utility.set_location('Entering:'||l_proc, 5);
238   --
239   -- Determine if the business process is to be validated.
240   --
241   If p_validate then
242     --
243     -- Issue the savepoint.
244     --
245     SAVEPOINT del_pe_aei;
246   End If;
247   --
248   -- We must lock the row which we need to delete.
249   --
250   pe_aei_shd.lck
251 	(
252 	p_rec.assignment_extra_info_id,
253 	p_rec.object_version_number
254 	);
255   --
256   -- Call the supporting delete validate operation
257   --
258   pe_aei_bus.delete_validate(p_rec);
259   --
260   -- Call the supporting pre-delete operation
261   --
262   pre_delete(p_rec);
263   --
264   -- Delete the row.
265   --
266   delete_dml(p_rec);
267   --
268   -- Call the supporting post-delete operation
269   --
270   post_delete(p_rec);
271   --
272   -- If we are validating then raise the Validate_Enabled exception
273   --
274   If p_validate then
275     Raise HR_Api.Validate_Enabled;
276   End If;
277   --
278   hr_utility.set_location(' Leaving:'||l_proc, 10);
279 Exception
280   When HR_Api.Validate_Enabled Then
281     --
282     -- As the Validate_Enabled exception has been raised
283     -- we must rollback to the savepoint
284     --
285     ROLLBACK TO del_pe_aei;
286 End del;
287 --
288 -- ----------------------------------------------------------------------------
289 -- |---------------------------------< del >----------------------------------|
290 -- ----------------------------------------------------------------------------
291 Procedure del
292   (
293   p_assignment_extra_info_id           in number,
294   p_object_version_number              in number,
295   p_validate                           in boolean default false
296   ) is
297 --
298   l_rec	  pe_aei_shd.g_rec_type;
299   l_proc  varchar2(72) := g_package||'del';
300 --
301 Begin
302   hr_utility.set_location('Entering:'||l_proc, 5);
303   --
304   -- As the delete procedure accepts a plsql record structure we do need to
305   -- convert the  arguments into the record structure.
306   -- We don't need to call the supplied conversion argument routine as we
307   -- only need a few attributes.
308   --
309   l_rec.assignment_extra_info_id:= p_assignment_extra_info_id;
310   l_rec.object_version_number := p_object_version_number;
311   --
312   -- Having converted the arguments into the pe_aei_rec
313   -- plsql record structure we must call the corresponding entity
314   -- business process
315   --
316   del(l_rec, p_validate);
317   --
318   hr_utility.set_location(' Leaving:'||l_proc, 10);
319 End del;
320 --
321 end pe_aei_del;