DBA Data[Home] [Help]

PACKAGE BODY: APPS.PQH_CEC_DEL

Source


1 Package Body pqh_cec_del as
2 /* $Header: pqcecrhi.pkb 120.2 2005/10/12 20:18:10 srajakum noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  pqh_cec_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 --      perform dml).
19 --   2) To delete the specified row from the schema using the primary key in
20 --      the predicates.
21 --   3) To trap any constraint violations that may have occurred.
22 --   4) To raise any other errors.
23 --
24 -- Prerequisites:
25 --   This is an internal private procedure which must be called from the del
26 --   procedure.
27 --
28 -- In Parameters:
29 --   A Pl/Sql record structre.
30 --
31 -- Post Success:
32 --   The specified row will be delete from the schema.
33 --
34 -- Post Failure:
35 --   On the delete dml failure it is important to note that we always reset the
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 --
40 -- Developer Implementation Notes:
41 --   None.
42 --
43 -- Access Status:
44 --   Internal Row Handler Use Only.
45 --
46 -- {End Of Comments}
47 -- ----------------------------------------------------------------------------
48 Procedure delete_dml(p_rec in pqh_cec_shd.g_rec_type) is
49 --
50   l_proc  varchar2(72) := g_package||'delete_dml';
51 --
52 Begin
53   hr_utility.set_location('Entering:'||l_proc, 5);
54   --
55   --
56   -- Delete the pqh_copy_entity_contexts row.
57   --
58   delete from pqh_copy_entity_contexts
59   where context = p_rec.context;
60   --
61   --
62   hr_utility.set_location(' Leaving:'||l_proc, 10);
63 --
64 Exception
65   When hr_api.child_integrity_violated then
66     -- Child integrity has been violated
67     pqh_cec_shd.constraint_error
68       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
69   When Others Then
70     Raise;
71 End delete_dml;
72 --
73 -- ----------------------------------------------------------------------------
74 -- |------------------------------< pre_delete >------------------------------|
75 -- ----------------------------------------------------------------------------
76 -- {Start Of Comments}
77 --
78 -- Description:
79 --   This private procedure contains any processing which is required before
80 --   the delete dml.
81 --
82 -- Prerequisites:
83 --   This is an internal procedure which is called from the del procedure.
84 --
85 -- In Parameters:
86 --   A Pl/Sql record structre.
87 --
88 -- Post Success:
89 --   Processing continues.
90 --
91 -- Post Failure:
92 --   If an error has occurred, an error message and exception will be raised
93 --   but not handled.
94 --
95 -- Developer Implementation Notes:
96 --   Any pre-processing required before the delete dml is issued should be
97 --   coded within this procedure. It is important to note that any 3rd party
98 --   maintenance should be reviewed before placing in this procedure.
99 --
100 -- Access Status:
101 --   Internal Row Handler Use Only.
102 --
103 -- {End Of Comments}
104 -- ----------------------------------------------------------------------------
105 Procedure pre_delete(p_rec in pqh_cec_shd.g_rec_type) is
106 --
107   l_proc  varchar2(72) := g_package||'pre_delete';
108 --
109 Begin
110   hr_utility.set_location('Entering:'||l_proc, 5);
111   --
112   hr_utility.set_location(' Leaving:'||l_proc, 10);
113 End pre_delete;
114 --
115 -- ----------------------------------------------------------------------------
116 -- |-----------------------------< post_delete >------------------------------|
117 -- ----------------------------------------------------------------------------
118 -- {Start Of Comments}
119 --
120 -- Description:
121 --   This private procedure contains any processing which is required after the
122 --   delete dml.
123 --
124 -- Prerequisites:
125 --   This is an internal procedure which is called from the del procedure.
126 --
127 -- In Parameters:
128 --   A Pl/Sql record structre.
129 --
130 -- Post Success:
131 --   Processing continues.
132 --
133 -- Post Failure:
134 --   If an error has occurred, an error message and exception will be raised
135 --   but not handled.
136 --
137 -- Developer Implementation Notes:
138 --   Any post-processing required after the delete dml is issued should be
139 --   coded within this procedure. It is important to note that any 3rd party
140 --   maintenance should be reviewed before placing in this procedure.
141 --
142 -- Access Status:
143 --   Internal table Handler Use Only.
144 --
145 -- {End Of Comments}
146 -- ----------------------------------------------------------------------------
147 Procedure post_delete(p_rec in pqh_cec_shd.g_rec_type) is
148 --
149   l_proc  varchar2(72) := g_package||'post_delete';
150 --
151 Begin
152   hr_utility.set_location('Entering:'||l_proc, 5);
153 --
154   --
155   -- Start of API User Hook for post_delete.
156   --
157   begin
158     --
159     pqh_cec_rkd.after_delete
160       (
161   p_context                       =>p_rec.context
162  ,p_application_short_name_o      =>pqh_cec_shd.g_old_rec.application_short_name
163  ,p_legislation_code_o            =>pqh_cec_shd.g_old_rec.legislation_code
164  ,p_responsibility_key_o          =>pqh_cec_shd.g_old_rec.responsibility_key
165  ,p_transaction_short_name_o      =>pqh_cec_shd.g_old_rec.transaction_short_name
166  ,p_object_version_number_o       =>pqh_cec_shd.g_old_rec.object_version_number
167       );
168     --
169   exception
170     --
171     when hr_api.cannot_find_prog_unit then
172       --
173       hr_api.cannot_find_prog_unit_error
174         (p_module_name => 'pqh_copy_entity_contexts'
175         ,p_hook_type   => 'AD');
176       --
177   end;
178   --
179   -- End of API User Hook for post_delete.
180   --
181   --
182   hr_utility.set_location(' Leaving:'||l_proc, 10);
183 End post_delete;
184 --
185 -- ----------------------------------------------------------------------------
186 -- |---------------------------------< del >----------------------------------|
187 -- ----------------------------------------------------------------------------
188 Procedure del
189   (
190   p_rec	      in pqh_cec_shd.g_rec_type
191   ) is
192 --
193   l_proc  varchar2(72) := g_package||'del';
194 --
195 Begin
196   hr_utility.set_location('Entering:'||l_proc, 5);
197   --
198   -- We must lock the row which we need to delete.
199   --
200   pqh_cec_shd.lck
201 	(
202 	p_rec.context,
203 	p_rec.object_version_number
204 	);
205   --
206   -- Call the supporting delete validate operation
207   --
208   pqh_cec_bus.delete_validate(p_rec);
209   --
210   -- Call the supporting pre-delete operation
211   --
212   pre_delete(p_rec);
213   --
214   -- Delete the row.
215   --
216   delete_dml(p_rec);
217   --
218   -- Call the supporting post-delete operation
219   --
220   post_delete(p_rec);
221 End del;
222 --
223 -- ----------------------------------------------------------------------------
224 -- |---------------------------------< del >----------------------------------|
225 -- ----------------------------------------------------------------------------
226 Procedure del
227   (
228   p_context                            in varchar2,
229   p_object_version_number              in number
230   ) is
231 --
232   l_rec	  pqh_cec_shd.g_rec_type;
233   l_proc  varchar2(72) := g_package||'del';
234 --
235 Begin
236   hr_utility.set_location('Entering:'||l_proc, 5);
237   --
238   -- As the delete procedure accepts a plsql record structure we do need to
239   -- convert the  arguments into the record structure.
240   -- We don't need to call the supplied conversion argument routine as we
241   -- only need a few attributes.
242   --
243   l_rec.context:= p_context;
244   l_rec.object_version_number := p_object_version_number;
245   --
246   -- Having converted the arguments into the pqh_cec_rec
247   -- plsql record structure we must call the corresponding entity
248   -- business process
249   --
250   del(l_rec);
251   --
252   hr_utility.set_location(' Leaving:'||l_proc, 10);
253 End del;
254 --
255 end pqh_cec_del;