DBA Data[Home] [Help]

PACKAGE BODY: APPS.PAY_AMT_DEL

Source


1 Package Body pay_amt_del as
2 /* $Header: pyamtrhi.pkb 120.0.12000000.1 2007/01/17 15:30:47 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33);  -- 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 pay_amt_shd.g_rec_type
53   ) is
54 --
55   l_proc  varchar2(72);
56 --
57 Begin
58   l_proc := g_package||'delete_dml';
59   --
60   hr_utility.set_location('Entering:'||l_proc, 5);
61   --
62   pay_amt_shd.g_api_dml := true;  -- Set the api dml status
63   --
64   -- Delete the pay_au_module_types row.
65   --
66   delete from pay_au_module_types
67   where module_type_id = p_rec.module_type_id;
68   --
69   pay_amt_shd.g_api_dml := false;   -- Unset the api dml status
70   --
71   hr_utility.set_location(' Leaving:'||l_proc, 10);
72 --
73 Exception
74   When hr_api.child_integrity_violated then
75     -- Child integrity has been violated
76     pay_amt_shd.g_api_dml := false;   -- Unset the api dml status
77     pay_amt_shd.constraint_error
78       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
79   When Others Then
80     pay_amt_shd.g_api_dml := false;   -- Unset the api dml status
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 pay_amt_shd.g_rec_type) is
117 --
118   l_proc  varchar2(72);
119 --
120 Begin
121   l_proc := g_package||'pre_delete';
122   --
123   hr_utility.set_location('Entering:'||l_proc, 5);
124   --
125   hr_utility.set_location(' Leaving:'||l_proc, 10);
126 End pre_delete;
127 --
128 -- ----------------------------------------------------------------------------
129 -- |-----------------------------< post_delete >------------------------------|
130 -- ----------------------------------------------------------------------------
131 -- {Start Of Comments}
132 --
133 -- Description:
134 --   This private procedure contains any processing which is required after
135 --   the delete dml.
136 --
137 -- Prerequistes:
138 --   This is an internal procedure which is called from the del procedure.
139 --
140 -- In Parameters:
141 --   A Pl/Sql record structure.
142 --
143 -- Post Success:
144 --   Processing continues.
145 --
146 -- Post Failure:
147 --   If an error has occurred, an error message and exception will be raised
148 --   but not handled.
149 --
150 -- Developer Implementation Notes:
151 --   Any post-processing required after the delete dml is issued should be
152 --   coded within this procedure. It is important to note that any 3rd party
153 --   maintenance should be reviewed before placing in this procedure.
154 --
155 -- Access Status:
156 --   Internal Row Handler Use Only.
157 --
158 -- {End Of Comments}
159 -- -----------------------------------------------------------------------------
160 Procedure post_delete(p_rec in pay_amt_shd.g_rec_type) is
161 --
162   l_proc  varchar2(72);
163 --
164 Begin
165   l_proc := g_package||'post_delete';
166   --
167   hr_utility.set_location('Entering:'||l_proc, 5);
168   --
169   hr_utility.set_location(' Leaving:'||l_proc, 10);
170 End post_delete;
171 --
172 -- ----------------------------------------------------------------------------
173 -- |---------------------------------< del >----------------------------------|
174 -- ----------------------------------------------------------------------------
175 Procedure del
176   (p_rec              in pay_amt_shd.g_rec_type
177   ) is
178 --
179   l_proc  varchar2(72);
180 --
181 Begin
182   l_proc := g_package||'del';
183   --
184   hr_utility.set_location('Entering:'||l_proc, 5);
185   --
186   -- We must lock the row which we need to delete.
187   --
188   pay_amt_shd.lck
189     (p_rec.module_type_id
190     ,p_rec.object_version_number
191     );
192   --
193   -- Call the supporting delete validate operation
194   --
195   pay_amt_bus.delete_validate(p_rec);
196   --
197   -- Call to raise any errors on multi-message list
198   hr_multi_message.end_validation_set;
199   --
200   -- Call the supporting pre-delete operation
201   --
202   pay_amt_del.pre_delete(p_rec);
203   --
204   -- Delete the row.
205   --
206   pay_amt_del.delete_dml(p_rec);
207   --
208   -- Call the supporting post-delete operation
209   --
210   pay_amt_del.post_delete(p_rec);
211   --
212   -- Call to raise any errors on multi-message list
213   hr_multi_message.end_validation_set;
214   --
215 End del;
216 --
217 -- ----------------------------------------------------------------------------
218 -- |---------------------------------< del >----------------------------------|
219 -- ----------------------------------------------------------------------------
220 Procedure del
221   (p_module_type_id                       in     number
222   ,p_object_version_number                in     number
223   ) is
224 --
225   l_rec   pay_amt_shd.g_rec_type;
226   l_proc  varchar2(72);
227 --
228 Begin
229   l_proc := g_package||'del';
230   --
231   hr_utility.set_location('Entering:'||l_proc, 5);
232   --
233   -- As the delete procedure accepts a plsql record structure we do need to
234   -- convert the  arguments into the record structure.
235   -- We don't need to call the supplied conversion argument routine as we
236   -- only need a few attributes.
237   --
238   l_rec.module_type_id := p_module_type_id;
239   l_rec.object_version_number := p_object_version_number;
240   --
241   -- Having converted the arguments into the pay_amt_rec
242   -- plsql record structure we must call the corresponding entity
243   -- business process
244   --
245   pay_amt_del.del(l_rec);
246   --
247   hr_utility.set_location(' Leaving:'||l_proc, 10);
248 End del;
249 --
250 begin
251   g_package  := '  pay_amt_del.';  -- Global package name
252 end pay_amt_del;