DBA Data[Home] [Help]

PACKAGE BODY: APPS.HXC_TAT_DEL

Source


1 package body hxc_tat_del as
2 /* $Header: hxtatrhi.pkb 120.2 2005/09/23 07:03:57 rchennur noship $ */
3 -- --------------------------------------------------------------------------
4 -- |                     Private Global Definitions                         |
5 -- --------------------------------------------------------------------------
6 g_package  varchar2(33)	:= '  hxc_tat_del.';  -- global package name
7 g_debug boolean := hr_utility.debug_enabled;
8 -- --------------------------------------------------------------------------
9 -- |------------------------------< delete_dml >----------------------------|
10 -- --------------------------------------------------------------------------
11 -- {Start Of Comments}
12 --
13 -- Description:
14 --   This procedure controls the actual dml delete logic. The functions of
15 --   this procedure are as follows:
16 --   1) To set and unset the g_api_dml status as required (as we are about to
17 --      perform dml).
18 --   2) To delete the specified row from the schema using the primary key in
19 --      the predicates.
20 --   3) To trap any constraint violations that may have occurred.
21 --   4) 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 --   On the delete dml failure it is important to note that we always reset the
35 --   g_api_dml status to false.
36 --   if a child integrity constraint violation is raised the
37 --   constraint_error procedure will be called.
38 --   if any other error is reported, the error will be raised after the
39 --   g_api_dml status is reset.
40 --
41 -- Developer Implementation Notes:
42 --   None.
43 --
44 -- Access Status:
45 --   Internal Row Handler Use Only.
46 --
47 -- {end Of Comments}
48 -- --------------------------------------------------------------------------
49 procedure delete_dml
50   (p_rec in hxc_tat_shd.g_rec_type
51   ) is
52 
53 l_proc  varchar2(72) ;
54 
55 begin
56 
57   if g_debug then
58   	l_proc := g_package||'delete_dml';
59   	hr_utility.set_location('Entering:'||l_proc, 5);
60   end if;
61 
62   -- delete the hxc_time_attributes row.
63 
64   delete from hxc_time_attributes
65   where time_attribute_id = p_rec.time_attribute_id;
66 
67   if g_debug then
68   	hr_utility.set_location(' Leaving:'||l_proc, 10);
69   end if;
70 
71 exception
72   when hr_api.child_integrity_violated then
73     hxc_tat_shd.constraint_error
74       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
75   when others then
76     raise;
77 
78 end delete_dml;
79 
80 -- --------------------------------------------------------------------------
81 -- |------------------------------< pre_delete >----------------------------|
82 -- --------------------------------------------------------------------------
83 -- {Start Of Comments}
84 --
85 -- Description:
86 --   This private procedure contains any processing which is required before
87 --   the delete dml.
88 --
89 -- Prerequisites:
90 --   This is an internal procedure which is called from the del procedure.
91 --
92 -- In Parameters:
93 --   A Pl/Sql record structre.
94 --
95 -- Post Success:
96 --   processing continues.
97 --
98 -- Post Failure:
99 --   if an error has occurred, an error message and exception will be raised
100 --   but not handled.
101 --
102 -- Developer Implementation Notes:
103 --   Any pre-processing required before the delete dml is issued should be
104 --   coded within this procedure. It is important to note that any 3rd party
105 --   maintenance should be reviewed before placing in this procedure.
106 --
107 -- Access Status:
108 --   Internal Row Handler Use Only.
109 --
110 -- {end Of Comments}
111 -- --------------------------------------------------------------------------
112 procedure pre_delete(p_rec in hxc_tat_shd.g_rec_type) is
113 
114 l_proc  varchar2(72) ;
115 
116 begin
117 
118   if g_debug then
119   	l_proc := g_package||'pre_delete';
120   	hr_utility.set_location('Entering:'||l_proc, 5);
121    	hr_utility.set_location(' Leaving:'||l_proc, 10);
122   end if;
123 
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 the
133 --   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 hxc_tat_shd.g_rec_type) is
159 
160 l_proc  varchar2(72) ;
161 
162 begin
163 
164   if g_debug then
165   	l_proc := g_package||'post_delete';
166   	hr_utility.set_location('Entering:'||l_proc, 5);
167   end if;
168 
169     begin
170 
171     hxc_tat_rkd.after_delete
172       (p_time_attribute_id
173       => p_rec.time_attribute_id
174       ,p_object_version_number_o
175       => hxc_tat_shd.g_old_rec.object_version_number
176       ,p_attribute_category_o
177       => hxc_tat_shd.g_old_rec.attribute_category
178       ,p_attribute1_o
179       => hxc_tat_shd.g_old_rec.attribute1
180       ,p_attribute2_o
181       => hxc_tat_shd.g_old_rec.attribute2
182       ,p_attribute3_o
183       => hxc_tat_shd.g_old_rec.attribute3
184       ,p_attribute4_o
185       => hxc_tat_shd.g_old_rec.attribute4
186       ,p_attribute5_o
187       => hxc_tat_shd.g_old_rec.attribute5
188       ,p_attribute6_o
189       => hxc_tat_shd.g_old_rec.attribute6
190       ,p_attribute7_o
191       => hxc_tat_shd.g_old_rec.attribute7
192       ,p_attribute8_o
193       => hxc_tat_shd.g_old_rec.attribute8
194       ,p_attribute9_o
195       => hxc_tat_shd.g_old_rec.attribute9
196       ,p_attribute10_o
197       => hxc_tat_shd.g_old_rec.attribute10
198       ,p_attribute11_o
199       => hxc_tat_shd.g_old_rec.attribute11
200       ,p_attribute12_o
201       => hxc_tat_shd.g_old_rec.attribute12
202       ,p_attribute13_o
203       => hxc_tat_shd.g_old_rec.attribute13
204       ,p_attribute14_o
205       => hxc_tat_shd.g_old_rec.attribute14
206       ,p_attribute15_o
207       => hxc_tat_shd.g_old_rec.attribute15
208       ,p_attribute16_o
209       => hxc_tat_shd.g_old_rec.attribute16
210       ,p_attribute17_o
211       => hxc_tat_shd.g_old_rec.attribute17
212       ,p_attribute18_o
213       => hxc_tat_shd.g_old_rec.attribute18
214       ,p_attribute19_o
215       => hxc_tat_shd.g_old_rec.attribute19
216       ,p_attribute20_o
217       => hxc_tat_shd.g_old_rec.attribute20
218       ,p_attribute21_o
219       => hxc_tat_shd.g_old_rec.attribute21
220       ,p_attribute22_o
221       => hxc_tat_shd.g_old_rec.attribute22
222       ,p_attribute23_o
223       => hxc_tat_shd.g_old_rec.attribute23
224       ,p_attribute24_o
225       => hxc_tat_shd.g_old_rec.attribute24
226       ,p_attribute25_o
227       => hxc_tat_shd.g_old_rec.attribute25
228       ,p_attribute26_o
229       => hxc_tat_shd.g_old_rec.attribute26
230       ,p_attribute27_o
231       => hxc_tat_shd.g_old_rec.attribute27
232       ,p_attribute28_o
233       => hxc_tat_shd.g_old_rec.attribute28
234       ,p_attribute29_o
235       => hxc_tat_shd.g_old_rec.attribute29
236       ,p_attribute30_o
237       => hxc_tat_shd.g_old_rec.attribute30
238       ,p_bld_blk_info_type_id_o
239       => hxc_tat_shd.g_old_rec.bld_blk_info_type_id
240       );
241 
242   exception
243     when hr_api.cannot_find_prog_unit then
244       hr_api.cannot_find_prog_unit_error
245         (p_module_name => 'HXC_TIME_ATTRIBUTES'
246         ,p_hook_type   => 'AD');
247   end;
248 
249   if g_debug then
250   	hr_utility.set_location(' Leaving:'||l_proc, 10);
251   end if;
252 
253 end post_delete;
254 
255 -- --------------------------------------------------------------------------
256 -- |---------------------------------< del >--------------------------------|
257 -- --------------------------------------------------------------------------
258 procedure del
259   (p_rec in hxc_tat_shd.g_rec_type
260   ) is
261 
262 l_proc  varchar2(72) ;
263 
264 begin
265   g_debug :=hr_utility.debug_enabled;
266   if g_debug then
267   	l_proc := g_package||'del';
268   	hr_utility.set_location('Entering:'||l_proc, 5);
269   end if;
270 
271   -- we must lock the row which we need to delete.
272 
273   hxc_tat_shd.lck
274     (p_rec.time_attribute_id
275     ,p_rec.object_version_number
276     );
277 
278   -- call the supporting delete validate operation
279 
280   hxc_tat_bus.delete_validate(p_rec);
281 
282   -- call the supporting pre-delete operation
283 
284   hxc_tat_del.pre_delete(p_rec);
285 
286   -- delete the row.
287 
288   hxc_tat_del.delete_dml(p_rec);
289 
290   -- call the supporting post-delete operation
291 
292   hxc_tat_del.post_delete(p_rec);
293 
294 end del;
295 
296 -- --------------------------------------------------------------------------
297 -- |---------------------------------< del >--------------------------------|
298 -- --------------------------------------------------------------------------
299 procedure del
300   (p_time_attribute_id     in number
301   ,p_object_version_number in number
302   ) is
303 
304 l_rec  hxc_tat_shd.g_rec_type;
305 l_proc varchar2(72) ;
306 
307 begin
308   g_debug :=hr_utility.debug_enabled;
309   if g_debug then
310   	l_proc := g_package||'del';
311   	hr_utility.set_location('Entering:'||l_proc, 5);
312   end if;
313 
314   l_rec.time_attribute_id := p_time_attribute_id;
315   l_rec.object_version_number := p_object_version_number;
316 
317   -- having converted the arguments into the hxc_tat_rec
318   -- plsql record structure we must call the corresponding entity
319   -- business process
320 
321   hxc_tat_del.del(l_rec);
322 
323   if g_debug then
324   	hr_utility.set_location(' Leaving:'||l_proc, 10);
325   end if;
326 
327 end del;
328 
329 end hxc_tat_del;