DBA Data[Home] [Help]

PACKAGE BODY: APPS.IRC_ISC_DEL

Source


1 Package Body irc_isc_del as
2 /* $Header: iriscrhi.pkb 120.0 2005/07/26 15:11:17 mbocutt noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  irc_isc_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
52   (p_rec in irc_isc_shd.g_rec_type
53   ) 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   irc_isc_shd.g_api_dml := true;  -- Set the api dml status
61   --
62   -- Delete the irc_search_criteria row.
63   --
64   delete from irc_search_criteria
65   where search_criteria_id = p_rec.search_criteria_id;
66   --
67   irc_isc_shd.g_api_dml := false;  -- Unset the api dml status
68   --
69   hr_utility.set_location(' Leaving:'||l_proc, 10);
70 --
71 Exception
72   When hr_api.child_integrity_violated then
73     -- Child integrity has been violated
74     irc_isc_shd.g_api_dml := false;  -- Unset the api dml status
75     --
76     irc_isc_shd.constraint_error
77       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
78   When Others Then
79     irc_isc_shd.g_api_dml := false;  -- Unset the api dml status
80     --
81     Raise;
82 End delete_dml;
83 --
84 -- ----------------------------------------------------------------------------
85 -- |------------------------------< pre_delete >------------------------------|
86 -- ----------------------------------------------------------------------------
87 -- {Start Of Comments}
88 --
89 -- Description:
90 --   This private procedure contains any processing which is required before
91 --   the delete dml.
92 --
93 -- Prerequisites:
94 --   This is an internal procedure which is called from the del procedure.
95 --
96 -- In Parameters:
97 --   A Pl/Sql record structre.
98 --
99 -- Post Success:
100 --   Processing continues.
101 --
102 -- Post Failure:
103 --   If an error has occurred, an error message and exception will be raised
104 --   but not handled.
105 --
106 -- Developer Implementation Notes:
107 --   Any pre-processing required before the delete dml is issued should be
108 --   coded within this procedure. It is important to note that any 3rd party
109 --   maintenance should be reviewed before placing in this procedure.
110 --
111 -- Access Status:
112 --   Internal Row Handler Use Only.
113 --
114 -- {End Of Comments}
115 -- ----------------------------------------------------------------------------
116 Procedure pre_delete(p_rec in irc_isc_shd.g_rec_type) is
117 --
118   l_proc  varchar2(72) := g_package||'pre_delete';
119 --
120 Begin
121   hr_utility.set_location('Entering:'||l_proc, 5);
122   --
123   hr_utility.set_location(' Leaving:'||l_proc, 10);
124 End pre_delete;
125 --
126 -- ----------------------------------------------------------------------------
127 -- |-----------------------------< post_delete >------------------------------|
128 -- ----------------------------------------------------------------------------
129 -- {Start Of Comments}
130 --
131 -- Description:
132 --   This private procedure contains any processing which is required after
133 --   the delete dml.
134 --
135 -- Prerequistes:
136 --   This is an internal procedure which is called from the del procedure.
137 --
138 -- In Parameters:
139 --   A Pl/Sql record structure.
140 --
141 -- Post Success:
142 --   Processing continues.
143 --
144 -- Post Failure:
145 --   If an error has occurred, an error message and exception will be raised
146 --   but not handled.
147 --
148 -- Developer Implementation Notes:
149 --   Any post-processing required after the delete dml is issued should be
150 --   coded within this procedure. It is important to note that any 3rd party
151 --   maintenance should be reviewed before placing in this procedure.
152 --
153 -- Access Status:
154 --   Internal Row Handler Use Only.
155 --
156 -- {End Of Comments}
157 -- -----------------------------------------------------------------------------
158 Procedure post_delete(p_rec in irc_isc_shd.g_rec_type) is
159 --
160   l_proc  varchar2(72) := g_package||'post_delete';
161 --
162 Begin
163   hr_utility.set_location('Entering:'||l_proc, 5);
164   begin
165     --
166     irc_isc_rkd.after_delete
167       (p_search_criteria_id
168       => p_rec.search_criteria_id
169       ,p_object_id_o
170       => irc_isc_shd.g_old_rec.object_id
171       ,p_object_type_o
172       => irc_isc_shd.g_old_rec.object_type
173       ,p_search_name_o
174       => irc_isc_shd.g_old_rec.search_name
175       ,p_search_type_o
176       => irc_isc_shd.g_old_rec.search_type
177       ,p_location_o
178       => irc_isc_shd.g_old_rec.location
179       ,p_distance_to_location_o
180       => irc_isc_shd.g_old_rec.distance_to_location
181       ,p_geocode_location_o
182       =>irc_isc_shd.g_old_rec.geocode_location
183       ,p_geocode_country_o
184       =>irc_isc_shd.g_old_rec.geocode_country
185       ,p_derived_location_o
186       =>irc_isc_shd.g_old_rec.derived_location
187       ,p_location_id_o
188       =>irc_isc_shd.g_old_rec.location_id
189       ,p_longitude_o
190       =>irc_isc_shd.g_old_rec.longitude
191       ,p_latitude_o
192       =>irc_isc_shd.g_old_rec.latitude
193       ,p_employee_o
194       => irc_isc_shd.g_old_rec.employee
195       ,p_contractor_o
196       => irc_isc_shd.g_old_rec.contractor
197       ,p_employment_category_o
198       => irc_isc_shd.g_old_rec.employment_category
199       ,p_keywords_o
200       => irc_isc_shd.g_old_rec.keywords
201       ,p_travel_percentage_o
202       => irc_isc_shd.g_old_rec.travel_percentage
203       ,p_min_salary_o
204       => irc_isc_shd.g_old_rec.min_salary
205       ,p_max_salary_o
206       => irc_isc_shd.g_old_rec.max_salary
207       ,p_salary_currency_o
208       => irc_isc_shd.g_old_rec.salary_currency
209       ,p_salary_period_o
210       => irc_isc_shd.g_old_rec.salary_period
211       ,p_match_competence_o
212       => irc_isc_shd.g_old_rec.match_competence
213       ,p_match_qualification_o
214       => irc_isc_shd.g_old_rec.match_qualification
215       ,p_job_title_o
216       => irc_isc_shd.g_old_rec.job_title
217       ,p_department_o
218       => irc_isc_shd.g_old_rec.department
219       ,p_professional_area_o
220       => irc_isc_shd.g_old_rec.professional_area
221       ,p_work_at_home_o
222       => irc_isc_shd.g_old_rec.work_at_home
223       ,p_min_qual_level_o
224       => irc_isc_shd.g_old_rec.min_qual_level
225       ,p_max_qual_level_o
226       => irc_isc_shd.g_old_rec.max_qual_level
227       ,p_use_for_matching_o
228       => irc_isc_shd.g_old_rec.use_for_matching
229       ,p_description_o
230       => irc_isc_shd.g_old_rec.description
231       ,p_attribute_category_o
232       => irc_isc_shd.g_old_rec.attribute_category
233       ,p_attribute1_o
234       => irc_isc_shd.g_old_rec.attribute1
235       ,p_attribute2_o
236       => irc_isc_shd.g_old_rec.attribute2
237       ,p_attribute3_o
238       => irc_isc_shd.g_old_rec.attribute3
239       ,p_attribute4_o
240       => irc_isc_shd.g_old_rec.attribute4
241       ,p_attribute5_o
242       => irc_isc_shd.g_old_rec.attribute5
243       ,p_attribute6_o
244       => irc_isc_shd.g_old_rec.attribute6
245       ,p_attribute7_o
246       => irc_isc_shd.g_old_rec.attribute7
247       ,p_attribute8_o
248       => irc_isc_shd.g_old_rec.attribute8
249       ,p_attribute9_o
250       => irc_isc_shd.g_old_rec.attribute9
251       ,p_attribute10_o
252       => irc_isc_shd.g_old_rec.attribute10
253       ,p_attribute11_o
254       => irc_isc_shd.g_old_rec.attribute11
255       ,p_attribute12_o
256       => irc_isc_shd.g_old_rec.attribute12
257       ,p_attribute13_o
258       => irc_isc_shd.g_old_rec.attribute13
259       ,p_attribute14_o
260       => irc_isc_shd.g_old_rec.attribute14
261       ,p_attribute15_o
262       => irc_isc_shd.g_old_rec.attribute15
263       ,p_attribute16_o
264       => irc_isc_shd.g_old_rec.attribute16
265       ,p_attribute17_o
266       => irc_isc_shd.g_old_rec.attribute17
267       ,p_attribute18_o
268       => irc_isc_shd.g_old_rec.attribute18
269       ,p_attribute19_o
270       => irc_isc_shd.g_old_rec.attribute19
271       ,p_attribute20_o
272       => irc_isc_shd.g_old_rec.attribute20
273       ,p_attribute21_o
274       => irc_isc_shd.g_old_rec.attribute21
275       ,p_attribute22_o
276       => irc_isc_shd.g_old_rec.attribute22
277       ,p_attribute23_o
278       => irc_isc_shd.g_old_rec.attribute23
279       ,p_attribute24_o
280       => irc_isc_shd.g_old_rec.attribute24
281       ,p_attribute25_o
282       => irc_isc_shd.g_old_rec.attribute25
283       ,p_attribute26_o
284       => irc_isc_shd.g_old_rec.attribute26
285       ,p_attribute27_o
286       => irc_isc_shd.g_old_rec.attribute27
287       ,p_attribute28_o
288       => irc_isc_shd.g_old_rec.attribute28
289       ,p_attribute29_o
290       => irc_isc_shd.g_old_rec.attribute29
291       ,p_attribute30_o
292       => irc_isc_shd.g_old_rec.attribute30
293       ,p_isc_information_category_o
294       => irc_isc_shd.g_old_rec.isc_information_category
295       ,p_isc_information1_o
296       => irc_isc_shd.g_old_rec.isc_information1
297       ,p_isc_information2_o
298       => irc_isc_shd.g_old_rec.isc_information2
299       ,p_isc_information3_o
300       => irc_isc_shd.g_old_rec.isc_information3
301       ,p_isc_information4_o
302       => irc_isc_shd.g_old_rec.isc_information4
303       ,p_isc_information5_o
304       => irc_isc_shd.g_old_rec.isc_information5
305       ,p_isc_information6_o
306       => irc_isc_shd.g_old_rec.isc_information6
307       ,p_isc_information7_o
308       => irc_isc_shd.g_old_rec.isc_information7
309       ,p_isc_information8_o
310       => irc_isc_shd.g_old_rec.isc_information8
311       ,p_isc_information9_o
312       => irc_isc_shd.g_old_rec.isc_information9
313       ,p_isc_information10_o
314       => irc_isc_shd.g_old_rec.isc_information10
315       ,p_isc_information11_o
316       => irc_isc_shd.g_old_rec.isc_information11
317       ,p_isc_information12_o
318       => irc_isc_shd.g_old_rec.isc_information12
319       ,p_isc_information13_o
320       => irc_isc_shd.g_old_rec.isc_information13
321       ,p_isc_information14_o
322       => irc_isc_shd.g_old_rec.isc_information14
323       ,p_isc_information15_o
324       => irc_isc_shd.g_old_rec.isc_information15
325       ,p_isc_information16_o
326       => irc_isc_shd.g_old_rec.isc_information16
327       ,p_isc_information17_o
328       => irc_isc_shd.g_old_rec.isc_information17
329       ,p_isc_information18_o
330       => irc_isc_shd.g_old_rec.isc_information18
331       ,p_isc_information19_o
332       => irc_isc_shd.g_old_rec.isc_information19
333       ,p_isc_information20_o
334       => irc_isc_shd.g_old_rec.isc_information20
335       ,p_isc_information21_o
336       => irc_isc_shd.g_old_rec.isc_information21
337       ,p_isc_information22_o
338       => irc_isc_shd.g_old_rec.isc_information22
339       ,p_isc_information23_o
340       => irc_isc_shd.g_old_rec.isc_information23
341       ,p_isc_information24_o
342       => irc_isc_shd.g_old_rec.isc_information24
343       ,p_isc_information25_o
344       => irc_isc_shd.g_old_rec.isc_information25
345       ,p_isc_information26_o
346       => irc_isc_shd.g_old_rec.isc_information26
347       ,p_isc_information27_o
348       => irc_isc_shd.g_old_rec.isc_information27
349       ,p_isc_information28_o
350       => irc_isc_shd.g_old_rec.isc_information28
351       ,p_isc_information29_o
352       => irc_isc_shd.g_old_rec.isc_information29
353       ,p_isc_information30_o
354       => irc_isc_shd.g_old_rec.isc_information30
355       ,p_object_version_number_o
356       => irc_isc_shd.g_old_rec.object_version_number
357       ,p_date_posted_o
358       => irc_isc_shd.g_old_rec.date_posted
359       );
360     --
361   exception
362     --
363     when hr_api.cannot_find_prog_unit then
364       --
365       hr_api.cannot_find_prog_unit_error
366         (p_module_name => 'IRC_SEARCH_CRITERIA'
367         ,p_hook_type   => 'AD');
368       --
369   end;
370   --
371   hr_utility.set_location(' Leaving:'||l_proc, 10);
372 End post_delete;
373 --
374 -- ----------------------------------------------------------------------------
375 -- |---------------------------------< del >----------------------------------|
376 -- ----------------------------------------------------------------------------
377 Procedure del
378   (p_rec              in irc_isc_shd.g_rec_type
379   ) is
380 --
381   l_proc  varchar2(72) := g_package||'del';
382 --
383 Begin
384   hr_utility.set_location('Entering:'||l_proc, 5);
385   --
386   -- We must lock the row which we need to delete.
387   --
388   irc_isc_shd.lck
389     (p_rec.search_criteria_id
390     ,p_rec.object_version_number
391     );
392   --
393   -- Call the supporting delete validate operation
394   --
395   irc_isc_bus.delete_validate(p_rec);
396   --
397   -- Call to raise any errors on multi-message list
398   hr_multi_message.end_validation_set;
399   --
400   -- Call the supporting pre-delete operation
401   --
402   irc_isc_del.pre_delete(p_rec);
403   --
404   -- Delete the row.
405   --
406   irc_isc_del.delete_dml(p_rec);
407   --
408   -- Call the supporting post-delete operation
409   --
410   irc_isc_del.post_delete(p_rec);
411   --
412   -- Call to raise any errors on multi-message list
413   hr_multi_message.end_validation_set;
414   --
415 End del;
416 --
417 -- ----------------------------------------------------------------------------
418 -- |---------------------------------< del >----------------------------------|
419 -- ----------------------------------------------------------------------------
420 Procedure del
421   (p_search_criteria_id                   in     number
422   ,p_object_version_number                in     number
423   ) is
424 --
425   l_rec   irc_isc_shd.g_rec_type;
426   l_proc  varchar2(72) := g_package||'del';
427 --
428 Begin
429   hr_utility.set_location('Entering:'||l_proc, 5);
430   --
431   -- As the delete procedure accepts a plsql record structure we do need to
432   -- convert the  arguments into the record structure.
433   -- We don't need to call the supplied conversion argument routine as we
434   -- only need a few attributes.
435   --
436   l_rec.search_criteria_id := p_search_criteria_id;
437   l_rec.object_version_number := p_object_version_number;
438   --
439   -- Having converted the arguments into the irc_isc_rec
440   -- plsql record structure we must call the corresponding entity
441   -- business process
442   --
443   irc_isc_del.del(l_rec);
444   --
445   hr_utility.set_location(' Leaving:'||l_proc, 10);
446 End del;
447 --
448 end irc_isc_del;