1 Package Body per_pdm_del as
2 /* $Header: pepdmrhi.pkb 115.8 2002/12/09 14:33:06 pkakar ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' per_pdm_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 per_pdm_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_person_dlvry_methods row.
53 --
54 delete from per_person_dlvry_methods
55 where delivery_method_id = p_rec.delivery_method_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 per_pdm_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 per_pdm_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(p_rec in per_pdm_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 --
150 -- Start of API User Hook for post_delete.
151 --
152 begin
153 --
154 per_pdm_rkd.after_delete
155 (
156 p_delivery_method_id =>p_rec.delivery_method_id
157 ,p_date_start_o =>per_pdm_shd.g_old_rec.date_start
158 ,p_date_end_o =>per_pdm_shd.g_old_rec.date_end
159 ,p_person_id_o =>per_pdm_shd.g_old_rec.person_id
160 ,p_comm_dlvry_method_o =>per_pdm_shd.g_old_rec.comm_dlvry_method
161 ,p_preferred_flag_o =>per_pdm_shd.g_old_rec.preferred_flag
162 ,p_object_version_number_o =>per_pdm_shd.g_old_rec.object_version_number
163 ,p_request_id_o =>per_pdm_shd.g_old_rec.request_id
164 ,p_program_update_date_o =>per_pdm_shd.g_old_rec.program_update_date
165 ,p_program_application_id_o =>per_pdm_shd.g_old_rec.program_application_id
166 ,p_program_id_o =>per_pdm_shd.g_old_rec.program_id
167 ,p_attribute_category_o =>per_pdm_shd.g_old_rec.attribute_category
168 ,p_attribute1_o =>per_pdm_shd.g_old_rec.attribute1
169 ,p_attribute2_o =>per_pdm_shd.g_old_rec.attribute2
170 ,p_attribute3_o =>per_pdm_shd.g_old_rec.attribute3
171 ,p_attribute4_o =>per_pdm_shd.g_old_rec.attribute4
172 ,p_attribute5_o =>per_pdm_shd.g_old_rec.attribute5
173 ,p_attribute6_o =>per_pdm_shd.g_old_rec.attribute6
174 ,p_attribute7_o =>per_pdm_shd.g_old_rec.attribute7
175 ,p_attribute8_o =>per_pdm_shd.g_old_rec.attribute8
176 ,p_attribute9_o =>per_pdm_shd.g_old_rec.attribute9
177 ,p_attribute10_o =>per_pdm_shd.g_old_rec.attribute10
178 ,p_attribute11_o =>per_pdm_shd.g_old_rec.attribute11
179 ,p_attribute12_o =>per_pdm_shd.g_old_rec.attribute12
180 ,p_attribute13_o =>per_pdm_shd.g_old_rec.attribute13
181 ,p_attribute14_o =>per_pdm_shd.g_old_rec.attribute14
182 ,p_attribute15_o =>per_pdm_shd.g_old_rec.attribute15
183 ,p_attribute16_o =>per_pdm_shd.g_old_rec.attribute16
184 ,p_attribute17_o =>per_pdm_shd.g_old_rec.attribute17
185 ,p_attribute18_o =>per_pdm_shd.g_old_rec.attribute18
186 ,p_attribute19_o =>per_pdm_shd.g_old_rec.attribute19
187 ,p_attribute20_o =>per_pdm_shd.g_old_rec.attribute20
188 );
189 --
190 exception
191 --
192 when hr_api.cannot_find_prog_unit then
193 --
194 hr_api.cannot_find_prog_unit_error
195 (p_module_name => 'PER_PERSON_DLVRY_METHODS'
196 ,p_hook_type => 'AD');
197 --
198 end;
199 --
200 -- End of API User Hook for post_delete.
201 --
202 --
203 hr_utility.set_location(' Leaving:'||l_proc, 10);
204 End post_delete;
205 --
206 -- ----------------------------------------------------------------------------
207 -- |---------------------------------< del >----------------------------------|
208 -- ----------------------------------------------------------------------------
209 Procedure del
210 (
211 p_rec in per_pdm_shd.g_rec_type
212 ) is
213 --
214 l_proc varchar2(72) := g_package||'del';
215 --
216 Begin
217 hr_utility.set_location('Entering:'||l_proc, 5);
218 --
219 -- We must lock the row which we need to delete.
220 --
221 per_pdm_shd.lck
222 (
223 p_rec.delivery_method_id,
224 p_rec.object_version_number
225 );
226 --
227 -- Call the supporting delete validate operation
228 --
229 per_pdm_bus.delete_validate(p_rec);
230 --
231 -- Call the supporting pre-delete operation
232 --
233 pre_delete(p_rec);
234 --
235 -- Delete the row.
236 --
237 delete_dml(p_rec);
238 --
239 -- Call the supporting post-delete operation
240 --
241 post_delete(p_rec);
242 End del;
243 --
244 -- ----------------------------------------------------------------------------
245 -- |---------------------------------< del >----------------------------------|
246 -- ----------------------------------------------------------------------------
247 Procedure del
248 (
249 p_delivery_method_id in number,
250 p_object_version_number in number
251 ) is
252 --
253 l_rec per_pdm_shd.g_rec_type;
254 l_proc varchar2(72) := g_package||'del';
255 --
256 Begin
257 hr_utility.set_location('Entering:'||l_proc, 5);
258 --
259 -- As the delete procedure accepts a plsql record structure we do need to
260 -- convert the arguments into the record structure.
261 -- We don't need to call the supplied conversion argument routine as we
262 -- only need a few attributes.
263 --
264 l_rec.delivery_method_id:= p_delivery_method_id;
265 l_rec.object_version_number := p_object_version_number;
266 --
267 -- Having converted the arguments into the per_pdm_rec
268 -- plsql record structure we must call the corresponding entity
269 -- business process
270 --
271 del(l_rec);
272 --
273 hr_utility.set_location(' Leaving:'||l_proc, 10);
274 End del;
275 --
276 end per_pdm_del;