1 Package Body per_cag_del as
2 /* $Header: pecagrhi.pkb 120.1 2006/10/18 08:42:10 grreddy noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' per_cag_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 -- (Note: Philippe 4/20/99 Removed the need for setting g_api_dml as this is a new
21 -- table and therefore there is no ovn trigger to use it).
22 -- 2) To delete the specified row from the schema using the primary key in
23 -- the predicates.
24 -- 3) To trap any constraint violations that may have occurred.
25 -- 4) To raise any other errors.
26 --
27 -- Prerequisites:
28 -- This is an internal private procedure which must be called from the del
29 -- procedure.
30 --
31 -- In Parameters:
32 -- A Pl/Sql record structre.
33 --
34 -- Post Success:
35 -- The specified row will be delete from the schema.
36 --
37 -- Post Failure:
38 -- On the delete dml failure it is important to note that we always reset the
39 -- g_api_dml status to false.
40 -- If a child integrity constraint violation is raised the
41 -- constraint_error procedure will be called.
42 -- If any other error is reported, the error will be raised after the
43 -- g_api_dml status is reset.
44 --
45 -- Developer Implementation Notes:
46 -- None.
47 --
48 -- Access Status:
49 -- Internal Row Handler Use Only.
50 --
51 -- {End Of Comments}
52 -- ----------------------------------------------------------------------------
53 Procedure delete_dml(p_rec in per_cag_shd.g_rec_type) is
54 --
55 l_proc varchar2(72) := g_package||'delete_dml';
56 --
57 Begin
58 hr_utility.set_location('Entering:'||l_proc, 5);
59 --
60 --
61 -- Delete the per_collective_agreements row.
62 --
63 delete from per_collective_agreements
64 where collective_agreement_id = p_rec.collective_agreement_id;
65 --
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 per_cag_shd.constraint_error
73 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
74 When Others Then
75 Raise;
76 End delete_dml;
77 --
78 -- ----------------------------------------------------------------------------
79 -- |------------------------------< pre_delete >------------------------------|
80 -- ----------------------------------------------------------------------------
81 -- {Start Of Comments}
82 --
83 -- Description:
84 -- This private procedure contains any processing which is required before
85 -- the delete dml.
86 --
87 -- Prerequisites:
88 -- This is an internal procedure which is called from the del procedure.
89 --
90 -- In Parameters:
91 -- A Pl/Sql record structre.
92 --
93 -- Post Success:
94 -- Processing continues.
95 --
96 -- Post Failure:
97 -- If an error has occurred, an error message and exception will be raised
98 -- but not handled.
99 --
100 -- Developer Implementation Notes:
101 -- Any pre-processing required before the delete dml is issued should be
102 -- coded within this procedure. It is important to note that any 3rd party
103 -- maintenance should be reviewed before placing in this procedure.
104 --
105 -- Access Status:
106 -- Internal Row Handler Use Only.
107 --
108 -- {End Of Comments}
109 -- ----------------------------------------------------------------------------
110 Procedure pre_delete(p_rec in per_cag_shd.g_rec_type) is
111 --
112 l_proc varchar2(72) := g_package||'pre_delete';
113 --
114 Begin
115 hr_utility.set_location('Entering:'||l_proc, 5);
116 --
117 hr_utility.set_location(' Leaving:'||l_proc, 10);
118 End pre_delete;
119 --
120 -- ----------------------------------------------------------------------------
121 -- |-----------------------------< post_delete >------------------------------|
122 -- ----------------------------------------------------------------------------
123 -- {Start Of Comments}
124 --
125 -- Description:
126 -- This private procedure contains any processing which is required after the
127 -- delete dml.
128 --
129 -- Prerequisites:
130 -- This is an internal procedure which is called from the del procedure.
131 --
132 -- In Parameters:
133 -- A Pl/Sql record structre.
134 --
135 -- Post Success:
136 -- Processing continues.
137 --
138 -- Post Failure:
139 -- If an error has occurred, an error message and exception will be raised
140 -- but not handled.
141 --
142 -- Developer Implementation Notes:
143 -- Any post-processing required after the delete dml is issued should be
144 -- coded within this procedure. It is important to note that any 3rd party
145 -- maintenance should be reviewed before placing in this procedure.
146 --
147 -- Access Status:
148 -- Internal table Handler Use Only.
149 --
150 -- {End Of Comments}
151 -- ----------------------------------------------------------------------------
152 Procedure post_delete(p_rec in per_cag_shd.g_rec_type) is
153 --
154 l_proc varchar2(72) := g_package||'post_delete';
155 --
156 Begin
157 hr_utility.set_location('Entering:'||l_proc, 5);
158 --
159 --
160 --
161 -- Start of API User Hook for post_delete.
162 --
163 begin
164 --
165 per_cag_rkd.after_delete
166 ( p_collective_agreement_id =>p_rec.collective_agreement_id,
167 p_business_group_id =>per_cag_shd.g_old_rec.business_group_id,
168 p_object_version_number =>per_cag_shd.g_old_rec.object_version_number,
169 p_name =>per_cag_shd.g_old_rec.name,
170 p_status =>per_cag_shd.g_old_rec.status,
171 p_cag_number =>per_cag_shd.g_old_rec.cag_number,
172 p_description =>per_cag_shd.g_old_rec.description,
173 p_start_date =>per_cag_shd.g_old_rec.start_date,
174 p_end_date =>per_cag_shd.g_old_rec.end_date,
175 p_employer_organization_id =>per_cag_shd.g_old_rec.employer_organization_id,
176 p_employer_signatory =>per_cag_shd.g_old_rec.employer_signatory,
177 p_bargaining_organization_id =>per_cag_shd.g_old_rec.bargaining_organization_id,
178 p_bargaining_unit_signatory =>per_cag_shd.g_old_rec.bargaining_unit_signatory,
179 p_jurisdiction =>per_cag_shd.g_old_rec.jurisdiction,
180 p_authorizing_body =>per_cag_shd.g_old_rec.authorizing_body,
181 p_authorized_date =>per_cag_shd.g_old_rec.authorized_date,
182 p_cag_information_category =>per_cag_shd.g_old_rec.cag_information_category,
183 p_cag_information1 =>per_cag_shd.g_old_rec.cag_information1,
184 p_cag_information2 =>per_cag_shd.g_old_rec.cag_information2,
185 p_cag_information3 =>per_cag_shd.g_old_rec.cag_information3,
186 p_cag_information4 =>per_cag_shd.g_old_rec.cag_information4,
187 p_cag_information5 =>per_cag_shd.g_old_rec.cag_information5,
188 p_cag_information6 =>per_cag_shd.g_old_rec.cag_information6,
189 p_cag_information7 =>per_cag_shd.g_old_rec.cag_information7,
190 p_cag_information8 =>per_cag_shd.g_old_rec.cag_information8,
191 p_cag_information9 =>per_cag_shd.g_old_rec.cag_information9,
192 p_cag_information10 =>per_cag_shd.g_old_rec.cag_information10,
193 p_cag_information11 =>per_cag_shd.g_old_rec.cag_information11,
194 p_cag_information12 =>per_cag_shd.g_old_rec.cag_information12,
195 p_cag_information13 =>per_cag_shd.g_old_rec.cag_information13,
196 p_cag_information14 =>per_cag_shd.g_old_rec.cag_information14,
197 p_cag_information15 =>per_cag_shd.g_old_rec.cag_information15,
198 p_cag_information16 =>per_cag_shd.g_old_rec.cag_information16,
199 p_cag_information17 =>per_cag_shd.g_old_rec.cag_information17,
200 p_cag_information18 =>per_cag_shd.g_old_rec.cag_information18,
201 p_cag_information19 =>per_cag_shd.g_old_rec.cag_information19,
202 p_cag_information20 =>per_cag_shd.g_old_rec.cag_information20,
203 p_attribute_category =>per_cag_shd.g_old_rec.attribute_category,
204 p_attribute1 =>per_cag_shd.g_old_rec.attribute1,
205 p_attribute2 =>per_cag_shd.g_old_rec.attribute2,
206 p_attribute3 =>per_cag_shd.g_old_rec.attribute3,
207 p_attribute4 =>per_cag_shd.g_old_rec.attribute4,
208 p_attribute5 =>per_cag_shd.g_old_rec.attribute5,
209 p_attribute6 =>per_cag_shd.g_old_rec.attribute6,
210 p_attribute7 =>per_cag_shd.g_old_rec.attribute7,
211 p_attribute8 =>per_cag_shd.g_old_rec.attribute8,
212 p_attribute9 =>per_cag_shd.g_old_rec.attribute9,
213 p_attribute10 =>per_cag_shd.g_old_rec.attribute10,
214 p_attribute11 =>per_cag_shd.g_old_rec.attribute11,
215 p_attribute12 =>per_cag_shd.g_old_rec.attribute12,
216 p_attribute13 =>per_cag_shd.g_old_rec.attribute13,
217 p_attribute14 =>per_cag_shd.g_old_rec.attribute14,
218 p_attribute15 =>per_cag_shd.g_old_rec.attribute15,
219 p_attribute16 =>per_cag_shd.g_old_rec.attribute16,
220 p_attribute17 =>per_cag_shd.g_old_rec.attribute17,
221 p_attribute18 =>per_cag_shd.g_old_rec.attribute18,
222 p_attribute19 =>per_cag_shd.g_old_rec.attribute19,
223 p_attribute20 =>per_cag_shd.g_old_rec.attribute20
224 );
225 --
226 exception
227 --
228 when hr_api.cannot_find_prog_unit then
229 --
230 hr_api.cannot_find_prog_unit_error
231 (p_module_name => 'per_collective_agreements'
232 ,p_hook_type => 'AD');
233 --
234 end;
235 --
236 -- End of API User Hook for post_delete.
237 --
238 --
239 hr_utility.set_location(' Leaving:'||l_proc, 10);
240 End post_delete;
241 --
242 -- ----------------------------------------------------------------------------
243 -- |---------------------------------< del >----------------------------------|
244 -- ----------------------------------------------------------------------------
245 Procedure del
246 (
247 p_rec in per_cag_shd.g_rec_type
248 ) is
249 --
250 l_proc varchar2(72) := g_package||'del';
251 --
252 Begin
253 hr_utility.set_location('Entering:'||l_proc, 5);
254 --
255 -- We must lock the row which we need to delete.
256 --
257 per_cag_shd.lck
258 (
259 p_rec.collective_agreement_id,
260 p_rec.object_version_number
261 );
262 --
263 -- Call the supporting delete validate operation
264 --
265 per_cag_bus.delete_validate(p_rec);
266 --
267 -- Call the supporting pre-delete operation
268 --
269 pre_delete(p_rec);
270 --
271 -- Delete the row.
272 --
273 delete_dml(p_rec);
274 --
275 -- Call the supporting post-delete operation
276 --
277 post_delete(p_rec);
278 End del;
279 --
280 -- ----------------------------------------------------------------------------
281 -- |---------------------------------< del >----------------------------------|
282 -- ----------------------------------------------------------------------------
283 Procedure del
284 (
285 p_collective_agreement_id in number,
286 p_object_version_number in number
287 ) is
288 --
289 l_rec per_cag_shd.g_rec_type;
290 l_proc varchar2(72) := g_package||'del';
291 --
292 Begin
293 hr_utility.set_location('Entering:'||l_proc, 5);
294 --
295 -- As the delete procedure accepts a plsql record structure we do need to
296 -- convert the arguments into the record structure.
297 -- We don't need to call the supplied conversion argument routine as we
298 -- only need a few attributes.
299 --
300 l_rec.collective_agreement_id:= p_collective_agreement_id;
301 l_rec.object_version_number := p_object_version_number;
302 --
303 -- Having converted the arguments into the per_cag_rec
304 -- plsql record structure we must call the corresponding entity
305 -- business process
306 --
307 del(l_rec);
308 --
309 hr_utility.set_location(' Leaving:'||l_proc, 10);
310 End del;
311 --
312 end per_cag_del;