DBA Data[Home] [Help]

PACKAGE BODY: APPS.PQH_PTX_DEL

Source


1 Package Body pqh_ptx_del as
2 /* $Header: pqptxrhi.pkb 120.0.12010000.2 2008/08/05 13:41:09 ubhat ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  pqh_ptx_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 --   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 --   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_ptx_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 pqh_position_transactions row.
54   --
55   delete from pqh_position_transactions
56   where position_transaction_id = p_rec.position_transaction_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     pqh_ptx_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 pqh_ptx_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 pqh_ptx_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     pqh_ptx_rkd.after_delete
158       (
159   p_position_transaction_id       =>p_rec.position_transaction_id
160  ,p_action_date_o                 =>pqh_ptx_shd.g_old_rec.action_date
161  ,p_position_id_o                 =>pqh_ptx_shd.g_old_rec.position_id
162  ,p_availability_status_id_o      =>pqh_ptx_shd.g_old_rec.availability_status_id
163  ,p_business_group_id_o           =>pqh_ptx_shd.g_old_rec.business_group_id
164  ,p_entry_step_id_o               =>pqh_ptx_shd.g_old_rec.entry_step_id
165  ,p_entry_grade_rule_id_o         =>pqh_ptx_shd.g_old_rec.entry_grade_rule_id
166  ,p_job_id_o                      =>pqh_ptx_shd.g_old_rec.job_id
167  ,p_location_id_o                 =>pqh_ptx_shd.g_old_rec.location_id
168  ,p_organization_id_o             =>pqh_ptx_shd.g_old_rec.organization_id
169  ,p_pay_freq_payroll_id_o         =>pqh_ptx_shd.g_old_rec.pay_freq_payroll_id
170  ,p_position_definition_id_o      =>pqh_ptx_shd.g_old_rec.position_definition_id
171  ,p_prior_position_id_o           =>pqh_ptx_shd.g_old_rec.prior_position_id
172  ,p_relief_position_id_o          =>pqh_ptx_shd.g_old_rec.relief_position_id
173  ,p_entry_grade_id_o              =>pqh_ptx_shd.g_old_rec.entry_grade_id
174  ,p_successor_position_id_o       =>pqh_ptx_shd.g_old_rec.successor_position_id
175  ,p_supervisor_position_id_o      =>pqh_ptx_shd.g_old_rec.supervisor_position_id
176  ,p_amendment_date_o              =>pqh_ptx_shd.g_old_rec.amendment_date
177  ,p_amendment_recommendation_o    =>pqh_ptx_shd.g_old_rec.amendment_recommendation
178  ,p_amendment_ref_number_o        =>pqh_ptx_shd.g_old_rec.amendment_ref_number
179  ,p_avail_status_prop_end_date_o  =>pqh_ptx_shd.g_old_rec.avail_status_prop_end_date
180  ,p_bargaining_unit_cd_o          =>pqh_ptx_shd.g_old_rec.bargaining_unit_cd
181  ,p_comments_o                    =>pqh_ptx_shd.g_old_rec.comments
182  ,p_country1_o                    =>pqh_ptx_shd.g_old_rec.country1
183  ,p_country2_o                    =>pqh_ptx_shd.g_old_rec.country2
184  ,p_country3_o                    =>pqh_ptx_shd.g_old_rec.country3
185  ,p_current_job_prop_end_date_o   =>pqh_ptx_shd.g_old_rec.current_job_prop_end_date
186  ,p_current_org_prop_end_date_o   =>pqh_ptx_shd.g_old_rec.current_org_prop_end_date
187  ,p_date_effective_o              =>pqh_ptx_shd.g_old_rec.date_effective
188  ,p_date_end_o                    =>pqh_ptx_shd.g_old_rec.date_end
189  ,p_earliest_hire_date_o          =>pqh_ptx_shd.g_old_rec.earliest_hire_date
190  ,p_fill_by_date_o                =>pqh_ptx_shd.g_old_rec.fill_by_date
191  ,p_frequency_o                   =>pqh_ptx_shd.g_old_rec.frequency
192  ,p_fte_o                         =>pqh_ptx_shd.g_old_rec.fte
193  ,p_fte_capacity_o                =>pqh_ptx_shd.g_old_rec.fte_capacity
194  ,p_location1_o                   =>pqh_ptx_shd.g_old_rec.location1
195  ,p_location2_o                   =>pqh_ptx_shd.g_old_rec.location2
196  ,p_location3_o                   =>pqh_ptx_shd.g_old_rec.location3
197  ,p_max_persons_o                 =>pqh_ptx_shd.g_old_rec.max_persons
198  ,p_name_o                        =>pqh_ptx_shd.g_old_rec.name
199  ,p_other_requirements_o          =>pqh_ptx_shd.g_old_rec.other_requirements
200  ,p_overlap_period_o              =>pqh_ptx_shd.g_old_rec.overlap_period
201  ,p_overlap_unit_cd_o             =>pqh_ptx_shd.g_old_rec.overlap_unit_cd
202  ,p_passport_required_o           =>pqh_ptx_shd.g_old_rec.passport_required
203  ,p_pay_term_end_day_cd_o         =>pqh_ptx_shd.g_old_rec.pay_term_end_day_cd
204  ,p_pay_term_end_month_cd_o       =>pqh_ptx_shd.g_old_rec.pay_term_end_month_cd
205  ,p_permanent_temporary_flag_o    =>pqh_ptx_shd.g_old_rec.permanent_temporary_flag
206  ,p_permit_recruitment_flag_o     =>pqh_ptx_shd.g_old_rec.permit_recruitment_flag
207  ,p_position_type_o               =>pqh_ptx_shd.g_old_rec.position_type
208  ,p_posting_description_o         =>pqh_ptx_shd.g_old_rec.posting_description
209  ,p_probation_period_o            =>pqh_ptx_shd.g_old_rec.probation_period
210  ,p_probation_period_unit_cd_o    =>pqh_ptx_shd.g_old_rec.probation_period_unit_cd
211  ,p_relocate_domestically_o       =>pqh_ptx_shd.g_old_rec.relocate_domestically
212  ,p_relocate_internationally_o    =>pqh_ptx_shd.g_old_rec.relocate_internationally
213  ,p_replacement_required_flag_o   =>pqh_ptx_shd.g_old_rec.replacement_required_flag
214  ,p_review_flag_o                 =>pqh_ptx_shd.g_old_rec.review_flag
215  ,p_seasonal_flag_o               =>pqh_ptx_shd.g_old_rec.seasonal_flag
216  ,p_security_requirements_o       =>pqh_ptx_shd.g_old_rec.security_requirements
217  ,p_service_minimum_o             =>pqh_ptx_shd.g_old_rec.service_minimum
218  ,p_term_start_day_cd_o           =>pqh_ptx_shd.g_old_rec.term_start_day_cd
219  ,p_term_start_month_cd_o         =>pqh_ptx_shd.g_old_rec.term_start_month_cd
220  ,p_time_normal_finish_o          =>pqh_ptx_shd.g_old_rec.time_normal_finish
221  ,p_time_normal_start_o           =>pqh_ptx_shd.g_old_rec.time_normal_start
222  ,p_transaction_status_o          =>pqh_ptx_shd.g_old_rec.transaction_status
223  ,p_travel_required_o             =>pqh_ptx_shd.g_old_rec.travel_required
224  ,p_working_hours_o               =>pqh_ptx_shd.g_old_rec.working_hours
225  ,p_works_council_approval_fla_o =>pqh_ptx_shd.g_old_rec.works_council_approval_flag
226  ,p_work_any_country_o            =>pqh_ptx_shd.g_old_rec.work_any_country
227  ,p_work_any_location_o           =>pqh_ptx_shd.g_old_rec.work_any_location
228  ,p_work_period_type_cd_o         =>pqh_ptx_shd.g_old_rec.work_period_type_cd
229  ,p_work_schedule_o               =>pqh_ptx_shd.g_old_rec.work_schedule
230  ,p_work_duration_o               =>pqh_ptx_shd.g_old_rec.work_duration
231  ,p_work_term_end_day_cd_o        =>pqh_ptx_shd.g_old_rec.work_term_end_day_cd
232  ,p_work_term_end_month_cd_o      =>pqh_ptx_shd.g_old_rec.work_term_end_month_cd
233  ,p_proposed_fte_for_layoff_o     =>pqh_ptx_shd.g_old_rec.proposed_fte_for_layoff
234  ,p_proposed_date_for_layoff_o    =>pqh_ptx_shd.g_old_rec.proposed_date_for_layoff
235  ,p_information1_o                =>pqh_ptx_shd.g_old_rec.information1
236  ,p_information2_o                =>pqh_ptx_shd.g_old_rec.information2
237  ,p_information3_o                =>pqh_ptx_shd.g_old_rec.information3
238  ,p_information4_o                =>pqh_ptx_shd.g_old_rec.information4
239  ,p_information5_o                =>pqh_ptx_shd.g_old_rec.information5
240  ,p_information6_o                =>pqh_ptx_shd.g_old_rec.information6
241  ,p_information7_o                =>pqh_ptx_shd.g_old_rec.information7
242  ,p_information8_o                =>pqh_ptx_shd.g_old_rec.information8
243  ,p_information9_o                =>pqh_ptx_shd.g_old_rec.information9
244  ,p_information10_o               =>pqh_ptx_shd.g_old_rec.information10
245  ,p_information11_o               =>pqh_ptx_shd.g_old_rec.information11
246  ,p_information12_o               =>pqh_ptx_shd.g_old_rec.information12
247  ,p_information13_o               =>pqh_ptx_shd.g_old_rec.information13
248  ,p_information14_o               =>pqh_ptx_shd.g_old_rec.information14
249  ,p_information15_o               =>pqh_ptx_shd.g_old_rec.information15
250  ,p_information16_o               =>pqh_ptx_shd.g_old_rec.information16
251  ,p_information17_o               =>pqh_ptx_shd.g_old_rec.information17
252  ,p_information18_o               =>pqh_ptx_shd.g_old_rec.information18
253  ,p_information19_o               =>pqh_ptx_shd.g_old_rec.information19
254  ,p_information20_o               =>pqh_ptx_shd.g_old_rec.information20
255  ,p_information21_o               =>pqh_ptx_shd.g_old_rec.information21
256  ,p_information22_o               =>pqh_ptx_shd.g_old_rec.information22
257  ,p_information23_o               =>pqh_ptx_shd.g_old_rec.information23
258  ,p_information24_o               =>pqh_ptx_shd.g_old_rec.information24
259  ,p_information25_o               =>pqh_ptx_shd.g_old_rec.information25
260  ,p_information26_o               =>pqh_ptx_shd.g_old_rec.information26
261  ,p_information27_o               =>pqh_ptx_shd.g_old_rec.information27
262  ,p_information28_o               =>pqh_ptx_shd.g_old_rec.information28
263  ,p_information29_o               =>pqh_ptx_shd.g_old_rec.information29
264  ,p_information30_o               =>pqh_ptx_shd.g_old_rec.information30
265  ,p_information_category_o        =>pqh_ptx_shd.g_old_rec.information_category
266  ,p_attribute1_o                  =>pqh_ptx_shd.g_old_rec.attribute1
267  ,p_attribute2_o                  =>pqh_ptx_shd.g_old_rec.attribute2
268  ,p_attribute3_o                  =>pqh_ptx_shd.g_old_rec.attribute3
269  ,p_attribute4_o                  =>pqh_ptx_shd.g_old_rec.attribute4
270  ,p_attribute5_o                  =>pqh_ptx_shd.g_old_rec.attribute5
271  ,p_attribute6_o                  =>pqh_ptx_shd.g_old_rec.attribute6
272  ,p_attribute7_o                  =>pqh_ptx_shd.g_old_rec.attribute7
273  ,p_attribute8_o                  =>pqh_ptx_shd.g_old_rec.attribute8
274  ,p_attribute9_o                  =>pqh_ptx_shd.g_old_rec.attribute9
275  ,p_attribute10_o                 =>pqh_ptx_shd.g_old_rec.attribute10
276  ,p_attribute11_o                 =>pqh_ptx_shd.g_old_rec.attribute11
277  ,p_attribute12_o                 =>pqh_ptx_shd.g_old_rec.attribute12
278  ,p_attribute13_o                 =>pqh_ptx_shd.g_old_rec.attribute13
279  ,p_attribute14_o                 =>pqh_ptx_shd.g_old_rec.attribute14
280  ,p_attribute15_o                 =>pqh_ptx_shd.g_old_rec.attribute15
281  ,p_attribute16_o                 =>pqh_ptx_shd.g_old_rec.attribute16
282  ,p_attribute17_o                 =>pqh_ptx_shd.g_old_rec.attribute17
283  ,p_attribute18_o                 =>pqh_ptx_shd.g_old_rec.attribute18
284  ,p_attribute19_o                 =>pqh_ptx_shd.g_old_rec.attribute19
285  ,p_attribute20_o                 =>pqh_ptx_shd.g_old_rec.attribute20
286  ,p_attribute21_o                 =>pqh_ptx_shd.g_old_rec.attribute21
287  ,p_attribute22_o                 =>pqh_ptx_shd.g_old_rec.attribute22
288  ,p_attribute23_o                 =>pqh_ptx_shd.g_old_rec.attribute23
289  ,p_attribute24_o                 =>pqh_ptx_shd.g_old_rec.attribute24
290  ,p_attribute25_o                 =>pqh_ptx_shd.g_old_rec.attribute25
291  ,p_attribute26_o                 =>pqh_ptx_shd.g_old_rec.attribute26
292  ,p_attribute27_o                 =>pqh_ptx_shd.g_old_rec.attribute27
293  ,p_attribute28_o                 =>pqh_ptx_shd.g_old_rec.attribute28
294  ,p_attribute29_o                 =>pqh_ptx_shd.g_old_rec.attribute29
295  ,p_attribute30_o                 =>pqh_ptx_shd.g_old_rec.attribute30
296  ,p_attribute_category_o          =>pqh_ptx_shd.g_old_rec.attribute_category
297  ,p_object_version_number_o       =>pqh_ptx_shd.g_old_rec.object_version_number
298  ,p_pay_basis_id_o		  =>pqh_ptx_shd.g_old_rec.pay_basis_id
299  ,p_supervisor_id_o		  =>pqh_ptx_shd.g_old_rec.supervisor_id
300  ,p_wf_transaction_category_id_o  =>pqh_ptx_shd.g_old_rec.wf_transaction_category_id
301       );
302     --
303   exception
304     --
305     when hr_api.cannot_find_prog_unit then
306       --
307       hr_api.cannot_find_prog_unit_error
308         (p_module_name => 'pqh_position_transactions'
309         ,p_hook_type   => 'AD');
310       --
311   end;
312   --
313   -- End of API User Hook for post_delete.
314   --
315   --
316   hr_utility.set_location(' Leaving:'||l_proc, 10);
317 End post_delete;
318 --
319 -- ----------------------------------------------------------------------------
320 -- |---------------------------------< del >----------------------------------|
321 -- ----------------------------------------------------------------------------
322 Procedure del
323   (
324   p_effective_date in date,
325   p_rec	      in pqh_ptx_shd.g_rec_type
326   ) is
327 --
328   l_proc  varchar2(72) := g_package||'del';
329 --
330 Begin
331   hr_utility.set_location('Entering:'||l_proc, 5);
332   --
333   -- We must lock the row which we need to delete.
334   --
335   pqh_ptx_shd.lck
336 	(
337 	p_rec.position_transaction_id,
338 	p_rec.object_version_number
339 	);
340   --
341   -- Call the supporting delete validate operation
342   --
343   pqh_ptx_bus.delete_validate(p_rec
344   ,p_effective_date);
345   --
346   -- Call the supporting pre-delete operation
347   --
348   pre_delete(p_rec);
349   --
350   -- Delete the row.
351   --
352   delete_dml(p_rec);
353   --
354   -- Call the supporting post-delete operation
355   --
356   post_delete(
357 p_effective_date,p_rec);
358 End del;
359 --
360 -- ----------------------------------------------------------------------------
361 -- |---------------------------------< del >----------------------------------|
362 -- ----------------------------------------------------------------------------
363 Procedure del
364   (
365  p_effective_date in date,
366   p_position_transaction_id            in number,
367   p_object_version_number              in number
368   ) is
369 --
370   l_rec	  pqh_ptx_shd.g_rec_type;
371   l_proc  varchar2(72) := g_package||'del';
372 --
373 Begin
374   hr_utility.set_location('Entering:'||l_proc, 5);
375   --
376   -- As the delete procedure accepts a plsql record structure we do need to
377   -- convert the  arguments into the record structure.
378   -- We don't need to call the supplied conversion argument routine as we
379   -- only need a few attributes.
380   --
381   l_rec.position_transaction_id:= p_position_transaction_id;
382   l_rec.object_version_number := p_object_version_number;
383   --
384   -- Having converted the arguments into the pqh_ptx_rec
385   -- plsql record structure we must call the corresponding entity
386   -- business process
387   --
388   del(
389     p_effective_date,l_rec);
390   --
391   hr_utility.set_location(' Leaving:'||l_proc, 10);
392 End del;
393 --
394 end pqh_ptx_del;