DBA Data[Home] [Help]

PACKAGE BODY: APPS.PQH_TCT_DEL

Source


1 Package Body pqh_tct_del as
2 /* $Header: pqtctrhi.pkb 120.7 2011/04/28 09:34:04 sidsaxen ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  pqh_tct_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 pqh_tct_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   -- Added the following code as a part of Zero Downtime Patching Project.
54   -- Code Starts Here.
55   --
56   PER_RIC_PKG.chk_integrity (
57     p_entity_name=>'PQH_TRANSACTION_CATEGORIES',
58     p_ref_entity_info=>
59       PER_RIC_PKG.ref_entity_tbl(
60         PER_RIC_PKG.ref_info_rec('PQH_TEMPLATES',PER_RIC_PKG.column_info_tbl(
61           PER_RIC_PKG.col_info_rec('TRANSACTION_CATEGORY_ID',NULL, p_rec.transaction_category_id,NULL))),
62         PER_RIC_PKG.ref_info_rec('PQH_TXN_CATEGORY_ATTRIBUTES',PER_RIC_PKG.column_info_tbl(
63           PER_RIC_PKG.col_info_rec('TRANSACTION_CATEGORY_ID',NULL, p_rec.transaction_category_id,NULL)))),
64     p_ref_type=>'DEL');
65   --
66   --
67   -- Code Ends Here
68   --
69   -- Delete the pqh_transaction_categories row.
70   --
71   delete from pqh_transaction_categories
72   where transaction_category_id = p_rec.transaction_category_id;
73   --
74   --
75   hr_utility.set_location(' Leaving:'||l_proc, 10);
76 --
77 Exception
78   When hr_api.child_integrity_violated then
79     -- Child integrity has been violated
80     pqh_tct_shd.constraint_error
81       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
82   When Others Then
83     Raise;
84 End delete_dml;
85 --
86 -- ----------------------------------------------------------------------------
87 -- |------------------------------< pre_delete >------------------------------|
88 -- ----------------------------------------------------------------------------
89 -- {Start Of Comments}
90 --
91 -- Description:
92 --   This private procedure contains any processing which is required before
93 --   the delete dml.
94 --
95 -- Prerequisites:
96 --   This is an internal procedure which is called from the del procedure.
97 --
98 -- In Parameters:
99 --   A Pl/Sql record structre.
100 --
101 -- Post Success:
102 --   Processing continues.
103 --
104 -- Post Failure:
105 --   If an error has occurred, an error message and exception will be raised
106 --   but not handled.
107 --
108 -- Developer Implementation Notes:
109 --   Any pre-processing required before the delete dml is issued should be
110 --   coded within this procedure. It is important to note that any 3rd party
111 --   maintenance should be reviewed before placing in this procedure.
112 --
113 -- Access Status:
114 --   Internal Row Handler Use Only.
115 --
116 -- {End Of Comments}
117 -- ----------------------------------------------------------------------------
118 Procedure pre_delete(p_rec in pqh_tct_shd.g_rec_type) is
119 --
120   l_proc  varchar2(72) := g_package||'pre_delete';
121 --
122 Begin
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 the
135 --   delete dml.
136 --
137 -- Prerequisites:
138 --   This is an internal procedure which is called from the del procedure.
139 --
140 -- In Parameters:
141 --   A Pl/Sql record structre.
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 table Handler Use Only.
157 --
158 -- {End Of Comments}
159 -- ----------------------------------------------------------------------------
160 Procedure post_delete(
161 p_effective_date in date,p_rec in pqh_tct_shd.g_rec_type) is
162 --
163   l_proc  varchar2(72) := g_package||'post_delete';
164 --
165 Begin
166   hr_utility.set_location('Entering:'||l_proc, 5);
167 --
168   --
169   -- Start of API User Hook for post_delete.
170   --
171   begin
172     --
173     pqh_tct_rkd.after_delete
174       (
175   p_transaction_category_id       =>p_rec.transaction_category_id
176  ,p_custom_wf_process_name_o      =>pqh_tct_shd.g_old_rec.custom_wf_process_name
177  ,p_custom_workflow_name_o        =>pqh_tct_shd.g_old_rec.custom_workflow_name
178  ,p_form_name_o                   =>pqh_tct_shd.g_old_rec.form_name
179  ,p_freeze_status_cd_o            =>pqh_tct_shd.g_old_rec.freeze_status_cd
180  ,p_future_action_cd_o            =>pqh_tct_shd.g_old_rec.future_action_cd
181  ,p_member_cd_o                   =>pqh_tct_shd.g_old_rec.member_cd
182  ,p_name_o                        =>pqh_tct_shd.g_old_rec.name
183  ,p_short_name_o                  =>pqh_tct_shd.g_old_rec.short_name
184  ,p_post_style_cd_o               =>pqh_tct_shd.g_old_rec.post_style_cd
185  ,p_post_txn_function_o           =>pqh_tct_shd.g_old_rec.post_txn_function
186  ,p_route_validated_txn_flag_o    =>pqh_tct_shd.g_old_rec.route_validated_txn_flag
187  ,p_prevent_approver_skip_o       =>pqh_tct_shd.g_old_rec.prevent_approver_skip
188  ,p_workflow_enable_flag_o    =>pqh_tct_shd.g_old_rec.workflow_enable_flag
189  ,p_enable_flag_o    =>pqh_tct_shd.g_old_rec.enable_flag
190  ,p_timeout_days_o                =>pqh_tct_shd.g_old_rec.timeout_days
191  ,p_object_version_number_o       =>pqh_tct_shd.g_old_rec.object_version_number
192  ,p_consolidated_table_route_i_o =>pqh_tct_shd.g_old_rec.consolidated_table_route_id
193  ,p_business_group_id_o    => pqh_tct_shd.g_old_rec.business_group_id
194  ,p_setup_type_cd_o        => pqh_tct_shd.g_old_rec.setup_type_cd
195  ,p_master_table_route_i_o =>pqh_tct_shd.g_old_rec.master_table_route_id
196       );
197     --
198   exception
199     --
200     when hr_api.cannot_find_prog_unit then
201       --
202       hr_api.cannot_find_prog_unit_error
203         (p_module_name => 'pqh_transaction_categories'
204         ,p_hook_type   => 'AD');
205       --
206   end;
207   --
208   -- End of API User Hook for post_delete.
209   --
210   --
211   hr_utility.set_location(' Leaving:'||l_proc, 10);
212 End post_delete;
213 --
214 -- ----------------------------------------------------------------------------
215 -- |---------------------------------< del >----------------------------------|
216 -- ----------------------------------------------------------------------------
217 Procedure del
218   (
219   p_effective_date in date,
220   p_rec	      in pqh_tct_shd.g_rec_type
221   ) is
222 --
223   l_proc  varchar2(72) := g_package||'del';
224 --
225 Begin
226   hr_utility.set_location('Entering:'||l_proc, 5);
227   --
228   -- We must lock the row which we need to delete.
229   --
230   pqh_tct_shd.lck
231 	(
232 	p_rec.transaction_category_id,
233 	p_rec.object_version_number
234 	);
235   --
236   -- Call the supporting delete validate operation
237   --
238   pqh_tct_bus.delete_validate(p_rec
239   ,p_effective_date);
240   --
241   -- Call the supporting pre-delete operation
242   --
243   pre_delete(p_rec);
244   --
245   -- Delete the row.
246   --
247   delete_dml(p_rec);
248   --
249   -- Call the supporting post-delete operation
250   --
251   post_delete(
252 p_effective_date,p_rec);
253 End del;
254 --
255 -- ----------------------------------------------------------------------------
256 -- |---------------------------------< del >----------------------------------|
257 -- ----------------------------------------------------------------------------
258 Procedure del
259   (
260   p_effective_date in date,
261   p_transaction_category_id            in number,
262   p_object_version_number              in number
263   ) is
264 --
265   l_rec	  pqh_tct_shd.g_rec_type;
266   l_proc  varchar2(72) := g_package||'del';
267 --
268 Begin
269   hr_utility.set_location('Entering:'||l_proc, 5);
270   --
271   -- As the delete procedure accepts a plsql record structure we do need to
272   -- convert the  arguments into the record structure.
273   -- We don't need to call the supplied conversion argument routine as we
274   -- only need a few attributes.
275   --
276   l_rec.transaction_category_id:= p_transaction_category_id;
277   l_rec.object_version_number := p_object_version_number;
278   --
279   -- Having converted the arguments into the pqh_tct_rec
280   -- plsql record structure we must call the corresponding entity
281   -- business process
282   --
283   del(
284     p_effective_date,l_rec);
285   --
286   hr_utility.set_location(' Leaving:'||l_proc, 10);
287 End del;
288 --
289 end pqh_tct_del;