DBA Data[Home] [Help]

PACKAGE BODY: APPS.HXC_ULQ_DEL

Source


1 Package Body hxc_ulq_del as
2 /* $Header: hxculqrhi.pkb 120.2 2005/09/23 06:26:40 rchennur noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  hxc_ulq_del.';  -- Global package name
9 g_debug boolean := hr_utility.debug_enabled;
10 --
11 -- ----------------------------------------------------------------------------
12 -- |------------------------------< delete_dml >------------------------------|
13 -- ----------------------------------------------------------------------------
14 -- {Start Of Comments}
15 --
16 -- Description:
17 --   This procedure controls the actual dml delete logic. The functions of
18 --   this procedure are as follows:
19 --   1) To set and unset the g_api_dml status as required (as we are about to
20 --      perform dml).
21 --   2) To delete the specified row from the schema using the primary key in
22 --      the predicates.
23 --   3) To trap any constraint violations that may have occurred.
24 --   4) To raise any other errors.
25 --
26 -- Prerequisites:
27 --   This is an internal private procedure which must be called from the del
28 --   procedure.
29 --
30 -- In Parameters:
31 --   A Pl/Sql record structre.
32 --
33 -- Post Success:
34 --   The specified row will be delete from the schema.
35 --
36 -- Post Failure:
37 --   On the delete dml failure it is important to note that we always reset the
38 --   g_api_dml status to false.
39 --   If a child integrity constraint violation is raised the
40 --   constraint_error procedure will be called.
41 --   If any other error is reported, the error will be raised after the
42 --   g_api_dml status is reset.
43 --
44 -- Developer Implementation Notes:
45 --   None.
46 --
47 -- Access Status:
48 --   Internal Row Handler Use Only.
49 --
50 -- {End Of Comments}
51 -- ----------------------------------------------------------------------------
52 Procedure delete_dml
53   (p_rec in hxc_ulq_shd.g_rec_type
54   ) is
55 --
56   l_proc  varchar2(72) ;
57 --
58 Begin
59 
60   if g_debug then
61   	l_proc := g_package||'delete_dml';
62   	hr_utility.set_location('Entering:'||l_proc, 5);
63   end if;
64   --
65   --
66   --
67   -- Delete the hxc_layout_comp_qualifiers row.
68   --
69   delete from hxc_layout_comp_qualifiers
70   where layout_comp_qualifier_id = p_rec.layout_comp_qualifier_id;
71   --
72   --
73   --
74   if g_debug then
75   	hr_utility.set_location(' Leaving:'||l_proc, 10);
76   end if;
77 --
78 Exception
79   When hr_api.child_integrity_violated then
80     -- Child integrity has been violated
81     --
82     hxc_ulq_shd.constraint_error
83       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
84   When Others Then
85     --
86     Raise;
87 End delete_dml;
88 --
89 -- ----------------------------------------------------------------------------
90 -- |------------------------------< pre_delete >------------------------------|
91 -- ----------------------------------------------------------------------------
92 -- {Start Of Comments}
93 --
94 -- Description:
95 --   This private procedure contains any processing which is required before
96 --   the delete dml.
97 --
98 -- Prerequisites:
99 --   This is an internal procedure which is called from the del procedure.
100 --
101 -- In Parameters:
102 --   A Pl/Sql record structre.
103 --
104 -- Post Success:
105 --   Processing continues.
106 --
107 -- Post Failure:
108 --   If an error has occurred, an error message and exception will be raised
109 --   but not handled.
110 --
111 -- Developer Implementation Notes:
112 --   Any pre-processing required before the delete dml is issued should be
113 --   coded within this procedure. It is important to note that any 3rd party
114 --   maintenance should be reviewed before placing in this procedure.
115 --
116 -- Access Status:
117 --   Internal Row Handler Use Only.
118 --
119 -- {End Of Comments}
120 -- ----------------------------------------------------------------------------
121 Procedure pre_delete(p_rec in hxc_ulq_shd.g_rec_type) is
122 --
123   l_proc  varchar2(72) ;
124 --
125 Begin
126 
127   if g_debug then
128   	l_proc := g_package||'pre_delete';
129   	hr_utility.set_location('Entering:'||l_proc, 5);
130   	hr_utility.set_location(' Leaving:'||l_proc, 10);
131   end if;
132 End pre_delete;
133 --
134 -- ----------------------------------------------------------------------------
135 -- |-----------------------------< post_delete >------------------------------|
136 -- ----------------------------------------------------------------------------
137 -- {Start Of Comments}
138 --
139 -- Description:
140 --   This private procedure contains any processing which is required after the
141 --   delete dml.
142 --
143 -- Prerequistes:
144 --   This is an internal procedure which is called from the del procedure.
145 --
146 -- In Parameters:
147 --   A Pl/Sql record structure.
148 --
149 -- Post Success:
150 --   Processing continues.
151 --
152 -- Post Failure:
153 --   If an error has occurred, an error message and exception will be raised
154 --   but not handled.
155 --
156 -- Developer Implementation Notes:
157 --   Any post-processing required after the delete dml is issued should be
158 --   coded within this procedure. It is important to note that any 3rd party
159 --   maintenance should be reviewed before placing in this procedure.
160 --
161 -- Access Status:
162 --   Internal Row Handler Use Only.
163 --
164 -- {End Of Comments}
165 -- -----------------------------------------------------------------------------
166 Procedure post_delete(p_rec in hxc_ulq_shd.g_rec_type) is
167 --
168   l_proc  varchar2(72) ;
169 --
170 Begin
171 
172   if g_debug then
173   	l_proc := g_package||'post_delete';
174   	hr_utility.set_location('Entering:'||l_proc, 5);
175   end if;
176     begin
177     --
178     hxc_ulq_rkd.after_delete
179       (p_layout_comp_qualifier_id
180       => p_rec.layout_comp_qualifier_id
181       ,p_layout_component_id_o
182       => hxc_ulq_shd.g_old_rec.layout_component_id
183       ,p_qualifier_name_o
184       => hxc_ulq_shd.g_old_rec.qualifier_name
185       ,p_qualifier_attribute_catego_o
186       => hxc_ulq_shd.g_old_rec.qualifier_attribute_category
187       ,p_qualifier_attribute1_o
188       => hxc_ulq_shd.g_old_rec.qualifier_attribute1
189       ,p_qualifier_attribute2_o
190       => hxc_ulq_shd.g_old_rec.qualifier_attribute2
191       ,p_qualifier_attribute3_o
192       => hxc_ulq_shd.g_old_rec.qualifier_attribute3
193       ,p_qualifier_attribute4_o
194       => hxc_ulq_shd.g_old_rec.qualifier_attribute4
195       ,p_qualifier_attribute5_o
196       => hxc_ulq_shd.g_old_rec.qualifier_attribute5
197       ,p_qualifier_attribute6_o
198       => hxc_ulq_shd.g_old_rec.qualifier_attribute6
199       ,p_qualifier_attribute7_o
200       => hxc_ulq_shd.g_old_rec.qualifier_attribute7
201       ,p_qualifier_attribute8_o
202       => hxc_ulq_shd.g_old_rec.qualifier_attribute8
203       ,p_qualifier_attribute9_o
204       => hxc_ulq_shd.g_old_rec.qualifier_attribute9
205       ,p_qualifier_attribute10_o
206       => hxc_ulq_shd.g_old_rec.qualifier_attribute10
207       ,p_qualifier_attribute11_o
208       => hxc_ulq_shd.g_old_rec.qualifier_attribute11
209       ,p_qualifier_attribute12_o
210       => hxc_ulq_shd.g_old_rec.qualifier_attribute12
211       ,p_qualifier_attribute13_o
212       => hxc_ulq_shd.g_old_rec.qualifier_attribute13
213       ,p_qualifier_attribute14_o
214       => hxc_ulq_shd.g_old_rec.qualifier_attribute14
215       ,p_qualifier_attribute15_o
216       => hxc_ulq_shd.g_old_rec.qualifier_attribute15
217       ,p_qualifier_attribute16_o
218       => hxc_ulq_shd.g_old_rec.qualifier_attribute16
219       ,p_qualifier_attribute17_o
220       => hxc_ulq_shd.g_old_rec.qualifier_attribute17
221       ,p_qualifier_attribute18_o
222       => hxc_ulq_shd.g_old_rec.qualifier_attribute18
223       ,p_qualifier_attribute19_o
224       => hxc_ulq_shd.g_old_rec.qualifier_attribute19
225       ,p_qualifier_attribute20_o
226       => hxc_ulq_shd.g_old_rec.qualifier_attribute20
227       ,p_qualifier_attribute21_o
228       => hxc_ulq_shd.g_old_rec.qualifier_attribute21
229       ,p_qualifier_attribute22_o
230       => hxc_ulq_shd.g_old_rec.qualifier_attribute22
231       ,p_qualifier_attribute23_o
232       => hxc_ulq_shd.g_old_rec.qualifier_attribute23
233       ,p_qualifier_attribute24_o
234       => hxc_ulq_shd.g_old_rec.qualifier_attribute24
235       ,p_qualifier_attribute25_o
236       => hxc_ulq_shd.g_old_rec.qualifier_attribute25
237       ,p_qualifier_attribute26_o
238       => hxc_ulq_shd.g_old_rec.qualifier_attribute26
239       ,p_qualifier_attribute27_o
240       => hxc_ulq_shd.g_old_rec.qualifier_attribute27
241       ,p_qualifier_attribute28_o
242       => hxc_ulq_shd.g_old_rec.qualifier_attribute28
243       ,p_qualifier_attribute29_o
244       => hxc_ulq_shd.g_old_rec.qualifier_attribute29
245       ,p_qualifier_attribute30_o
246       => hxc_ulq_shd.g_old_rec.qualifier_attribute30
247       ,p_object_version_number_o
248       => hxc_ulq_shd.g_old_rec.object_version_number
249       );
250     --
251   exception
252     --
253     when hr_api.cannot_find_prog_unit then
254       --
255       hr_api.cannot_find_prog_unit_error
256         (p_module_name => 'HXC_LAYOUT_COMP_QUALIFIERS'
257         ,p_hook_type   => 'AD');
258       --
259   end;
260   --
261   if g_debug then
262   	hr_utility.set_location(' Leaving:'||l_proc, 10);
263   end if;
264 End post_delete;
265 --
266 -- ----------------------------------------------------------------------------
267 -- |---------------------------------< del >----------------------------------|
268 -- ----------------------------------------------------------------------------
269 Procedure del
270   (p_rec	      in hxc_ulq_shd.g_rec_type
271   ) is
272 --
273   l_proc  varchar2(72) ;
274 --
275 Begin
276   g_debug :=hr_utility.debug_enabled;
277   if g_debug then
278   	l_proc := g_package||'del';
279   	hr_utility.set_location('Entering:'||l_proc, 5);
280   end if;
281   --
282   -- We must lock the row which we need to delete.
283   --
284   hxc_ulq_shd.lck
285     (p_rec.layout_comp_qualifier_id
286     ,p_rec.object_version_number
287     );
288   --
289   -- Call the supporting delete validate operation
290   --
291   hxc_ulq_bus.delete_validate(p_rec);
292   --
296   --
293   -- Call the supporting pre-delete operation
294   --
295   hxc_ulq_del.pre_delete(p_rec);
297   -- Delete the row.
298   --
299   hxc_ulq_del.delete_dml(p_rec);
300   --
301   -- Call the supporting post-delete operation
302   --
303   hxc_ulq_del.post_delete(p_rec);
304   --
305 End del;
306 --
307 -- ----------------------------------------------------------------------------
308 -- |---------------------------------< del >----------------------------------|
309 -- ----------------------------------------------------------------------------
310 Procedure del
311   (p_layout_comp_qualifier_id             in     number
312   ,p_object_version_number                in     number
313   ) is
314 --
315   l_rec	  hxc_ulq_shd.g_rec_type;
316   l_proc  varchar2(72) ;
317 --
318 Begin
319   g_debug :=hr_utility.debug_enabled;
320   if g_debug then
321   	l_proc := g_package||'del';
322   	hr_utility.set_location('Entering:'||l_proc, 5);
323   end if;
324   --
325   -- As the delete procedure accepts a plsql record structure we do need to
326   -- convert the  arguments into the record structure.
327   -- We don't need to call the supplied conversion argument routine as we
328   -- only need a few attributes.
329   --
330   l_rec.layout_comp_qualifier_id := p_layout_comp_qualifier_id;
331   l_rec.object_version_number := p_object_version_number;
332   --
333   -- Having converted the arguments into the hxc_ulq_rec
334   -- plsql record structure we must call the corresponding entity
335   -- business process
336   --
337   hxc_ulq_del.del(l_rec);
338   --
339   if g_debug then
340   	hr_utility.set_location(' Leaving:'||l_proc, 10);
341   end if;
342 End del;
343 --
344 end hxc_ulq_del;