DBA Data[Home] [Help]

PACKAGE BODY: APPS.GHR_NLA_DEL

Source


1 Package Body ghr_nla_del as
2 /* $Header: ghnlarhi.pkb 115.4 1999/11/09 22:41:05 pkm ship    $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ghr_nla_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 ghr_nla_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   --
53   -- Delete the ghr_noac_las row.
54   --
55   delete from ghr_noac_las
56   where noac_la_id = p_rec.noac_la_id;
57   --
58   --
59   hr_utility.set_location(' Leaving:'||l_proc, 10);
60 --
61 Exception
62   When hr_api.child_integrity_violated then
63     -- Child integrity has been violated
64     ghr_nla_shd.constraint_error
65       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
66   When Others Then
67     Raise;
68 End delete_dml;
69 --
70 -- ----------------------------------------------------------------------------
71 -- |------------------------------< pre_delete >------------------------------|
72 -- ----------------------------------------------------------------------------
73 -- {Start Of Comments}
74 --
75 -- Description:
76 --   This private procedure contains any processing which is required before
77 --   the delete dml.
78 --
79 -- Prerequisites:
80 --   This is an internal procedure which is called from the del procedure.
81 --
82 -- In Parameters:
83 --   A Pl/Sql record structre.
84 --
85 -- Post Success:
86 --   Processing continues.
87 --
88 -- Post Failure:
89 --   If an error has occurred, an error message and exception will be raised
90 --   but not handled.
91 --
92 -- Developer Implementation Notes:
93 --   Any pre-processing required before the delete dml is issued should be
94 --   coded within this procedure. It is important to note that any 3rd party
95 --   maintenance should be reviewed before placing in this procedure.
96 --
97 -- Access Status:
98 --   Internal Row Handler Use Only.
99 --
100 -- {End Of Comments}
101 -- ----------------------------------------------------------------------------
102 Procedure pre_delete(p_rec in ghr_nla_shd.g_rec_type) is
103 --
104   l_proc  varchar2(72) := g_package||'pre_delete';
105 --
106 Begin
107   hr_utility.set_location('Entering:'||l_proc, 5);
108   --
109   hr_utility.set_location(' Leaving:'||l_proc, 10);
110 End pre_delete;
111 --
112 -- ----------------------------------------------------------------------------
113 -- |-----------------------------< post_delete >------------------------------|
114 -- ----------------------------------------------------------------------------
115 -- {Start Of Comments}
116 --
117 -- Description:
118 --   This private procedure contains any processing which is required after the
119 --   delete dml.
120 --
121 -- Prerequisites:
122 --   This is an internal procedure which is called from the del procedure.
123 --
124 -- In Parameters:
125 --   A Pl/Sql record structre.
126 --
127 -- Post Success:
128 --   Processing continues.
129 --
130 -- Post Failure:
131 --   If an error has occurred, an error message and exception will be raised
132 --   but not handled.
133 --
134 -- Developer Implementation Notes:
135 --   Any post-processing required after the delete dml is issued should be
136 --   coded within this procedure. It is important to note that any 3rd party
137 --   maintenance should be reviewed before placing in this procedure.
138 --
139 -- Access Status:
140 --   Internal table Handler Use Only.
141 --
142 -- {End Of Comments}
143 -- ----------------------------------------------------------------------------
144 Procedure post_delete(
145 p_effective_date in date,p_rec in ghr_nla_shd.g_rec_type) is
146 --
147   l_proc  varchar2(72) := g_package||'post_delete';
148 --
149 Begin
150   hr_utility.set_location('Entering:'||l_proc, 5);
151 --
152   --
153   -- Start of API User Hook for post_delete.
154   --
155   begin
156     --
157     ghr_nla_rkd.after_delete
158       (
159   p_noac_la_id                    =>p_rec.noac_la_id
160  ,p_nature_of_action_id_o         =>ghr_nla_shd.g_old_rec.nature_of_action_id
161  ,p_lac_lookup_code_o             =>ghr_nla_shd.g_old_rec.lac_lookup_code
162  ,p_enabled_flag_o                =>ghr_nla_shd.g_old_rec.enabled_flag
163  ,p_date_from_o                   =>ghr_nla_shd.g_old_rec.date_from
164  ,p_date_to_o                     =>ghr_nla_shd.g_old_rec.date_to
165  ,p_object_version_number_o       =>ghr_nla_shd.g_old_rec.object_version_number
166  ,p_valid_first_lac_flag_o        =>ghr_nla_shd.g_old_rec.valid_first_lac_flag
167  ,p_valid_second_lac_flag_o       =>ghr_nla_shd.g_old_rec.valid_second_lac_flag
168       );
169     --
170   exception
171     --
172     when hr_api.cannot_find_prog_unit then
173       --
174       hr_api.cannot_find_prog_unit_error
175         (p_module_name => 'ghr_noac_las'
176         ,p_hook_type   => 'AD');
177       --
178   end;
179   --
180   -- End of API User Hook for post_delete.
181   --
182   --
183   hr_utility.set_location(' Leaving:'||l_proc, 10);
184 End post_delete;
185 --
186 -- ----------------------------------------------------------------------------
187 -- |---------------------------------< del >----------------------------------|
188 -- ----------------------------------------------------------------------------
189 Procedure del
190   (
191   p_effective_date in date,
192   p_rec	      in ghr_nla_shd.g_rec_type
193   ) is
194 --
195   l_proc  varchar2(72) := g_package||'del';
196 --
197 Begin
198   hr_utility.set_location('Entering:'||l_proc, 5);
199   --
200   -- We must lock the row which we need to delete.
201   --
202   ghr_nla_shd.lck
203 	(
204 	p_rec.noac_la_id,
205 	p_rec.object_version_number
206 	);
207   --
208   -- Call the supporting delete validate operation
209   --
210   ghr_nla_bus.delete_validate(p_rec
211   ,p_effective_date);
212   --
213   -- Call the supporting pre-delete operation
214   --
215   pre_delete(p_rec);
216   --
217   -- Delete the row.
218   --
219   delete_dml(p_rec);
220   --
221   -- Call the supporting post-delete operation
222   --
223   post_delete(
224 p_effective_date,p_rec);
225 End del;
226 --
227 -- ----------------------------------------------------------------------------
228 -- |---------------------------------< del >----------------------------------|
229 -- ----------------------------------------------------------------------------
230 Procedure del
231   (
232   p_effective_date in date,
233   p_noac_la_id                         in number,
234   p_object_version_number              in number
235   ) is
236 --
237   l_rec	  ghr_nla_shd.g_rec_type;
238   l_proc  varchar2(72) := g_package||'del';
239 --
240 Begin
241   hr_utility.set_location('Entering:'||l_proc, 5);
242   --
243   -- As the delete procedure accepts a plsql record structure we do need to
244   -- convert the  arguments into the record structure.
245   -- We don't need to call the supplied conversion argument routine as we
246   -- only need a few attributes.
247   --
248   l_rec.noac_la_id:= p_noac_la_id;
249   l_rec.object_version_number := p_object_version_number;
250   --
251   -- Having converted the arguments into the ghr_nla_rec
252   -- plsql record structure we must call the corresponding entity
253   -- business process
254   --
255   del(
256     p_effective_date,l_rec);
257   --
258   hr_utility.set_location(' Leaving:'||l_proc, 10);
259 End del;
260 --
261 end ghr_nla_del;