DBA Data[Home] [Help]

PACKAGE BODY: APPS.HR_ELC_CONSTITUENCYS_API

Source


1 Package Body hr_elc_constituencys_api as
2 /* $Header: peecoapi.pkb 115.5 2002/12/10 16:49:18 pkakar noship $ */
3 --
4 -- Package Variables
5 --
6 g_package  varchar2(33) := '   HR_ELC_CONSTITUENCYS_API .';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |---------------------< create_election_constituency >---------------------|
10 -- ----------------------------------------------------------------------------
11 --
12 procedure create_election_constituency
13   (p_validate                      in     boolean  default false
14   ,p_effective_date                in     date
15   ,p_election_id				in	  number
16   ,p_business_group_id             in     number
17   ,p_constituency_id               in     number
18   ,p_attribute_category            in     varchar2 default null
19   ,p_attribute1                    in     varchar2 default null
20   ,p_attribute2                    in     varchar2 default null
21   ,p_attribute3                    in     varchar2 default null
22   ,p_attribute4                    in     varchar2 default null
23   ,p_attribute5                    in     varchar2 default null
24   ,p_attribute6                    in     varchar2 default null
25   ,p_attribute7                    in     varchar2 default null
26   ,p_attribute8                    in     varchar2 default null
27   ,p_attribute9                    in     varchar2 default null
28   ,p_attribute10                   in     varchar2 default null
29   ,p_attribute11                   in     varchar2 default null
30   ,p_attribute12                   in     varchar2 default null
31   ,p_attribute13                   in     varchar2 default null
32   ,p_attribute14                   in     varchar2 default null
33   ,p_attribute15                   in     varchar2 default null
34   ,p_attribute16                   in     varchar2 default null
35   ,p_attribute17                   in     varchar2 default null
36   ,p_attribute18                   in     varchar2 default null
37   ,p_attribute19                   in     varchar2 default null
38   ,p_attribute20                   in     varchar2 default null
39   ,p_attribute21                   in     varchar2 default null
40   ,p_attribute22                   in     varchar2 default null
41   ,p_attribute23                   in     varchar2 default null
42   ,p_attribute24                   in     varchar2 default null
43   ,p_attribute25                   in     varchar2 default null
44   ,p_attribute26                   in     varchar2 default null
45   ,p_attribute27                   in     varchar2 default null
46   ,p_attribute28                   in     varchar2 default null
47   ,p_attribute29                   in     varchar2 default null
48   ,p_attribute30                   in     varchar2 default null
49   ,p_election_constituency_id         out nocopy number
50   ,p_object_version_number            out nocopy number
51   ) is
52   --
53   -- Declare cursors and local variables
54   --
55   l_effective_date	date;
56   l_object_version_number 	per_election_constituencys.object_version_number%TYPE;
57   --
58   -- Declare out parameters
59   l_election_constituency_id	per_election_constituencys.election_constituency_id%TYPE;
60   --
61   l_proc   varchar2(72) := g_package||'create_election_constituency';
62   --
63 begin
64   hr_utility.set_location('Entering:'|| l_proc, 10);
65   --
66   -- Issue a savepoint
67   --
68   savepoint create_elec_con;
69   --
70   -- Check that p_election_id, p_business_group_id, p_constituency_id are not null.
71   --
72   hr_utility.set_location('Entering mandatory arg check', 20);
73   --
74   hr_api.mandatory_arg_error
75     (p_api_name       => l_proc,
76      p_argument       => 'election_id',
77      p_argument_value => p_election_id);
78   --
79   hr_api.mandatory_arg_error
80     (p_api_name       => l_proc,
81      p_argument       => 'business_group_id',
82      p_argument_value => p_business_group_id);
83   --
84   hr_api.mandatory_arg_error
85     (p_api_name       => l_proc,
86      p_argument       => 'constituency_id',
87      p_argument_value => p_constituency_id);
88   --
89   hr_api.mandatory_arg_error
90     (p_api_name       => l_proc,
91      p_argument       => 'effective_date',
92      p_argument_value => p_effective_date);
93   --
94   l_effective_date := trunc(p_effective_date);
95   --
96   hr_utility.set_location('Entering: call - create_election_constituency_b ', 30);
97   --
98   begin
99 
100 hr_elc_constituencys_api_bk1.create_election_constituency_b
101   (p_effective_date				=>	l_effective_date
102   ,p_election_id				=>	p_election_id
103   ,p_business_group_id             =>	p_business_group_id
104   ,p_constituency_id               =>	p_constituency_id
105   ,p_attribute_category            =>	p_attribute_category
106   ,p_attribute1                    =>	p_attribute1
107   ,p_attribute2                    =>   p_attribute2
108   ,p_attribute3                    =>   p_attribute3
109   ,p_attribute4                    =>   p_attribute4
110   ,p_attribute5                    =>   p_attribute5
111   ,p_attribute6                    =>   p_attribute6
112   ,p_attribute7                    =>   p_attribute7
113   ,p_attribute8                    =>   p_attribute8
114   ,p_attribute9                    =>   p_attribute9
115   ,p_attribute10                   =>   p_attribute10
116   ,p_attribute11                   =>   p_attribute11
117   ,p_attribute12                   =>   p_attribute12
118   ,p_attribute13                   =>   p_attribute13
119   ,p_attribute14                   =>   p_attribute14
120   ,p_attribute15                   =>   p_attribute15
121   ,p_attribute16                   =>   p_attribute16
122   ,p_attribute17                   =>   p_attribute17
123   ,p_attribute18                   =>   p_attribute18
124   ,p_attribute19                   =>   p_attribute19
125   ,p_attribute20                   =>   p_attribute20
126   ,p_attribute21                   =>   p_attribute21
127   ,p_attribute22                   =>   p_attribute22
128   ,p_attribute23                   =>   p_attribute23
129   ,p_attribute24                   =>   p_attribute24
130   ,p_attribute25                   =>   p_attribute25
131   ,p_attribute26                   =>   p_attribute26
132   ,p_attribute27                   =>   p_attribute27
133   ,p_attribute28                   =>   p_attribute28
134   ,p_attribute29                   =>   p_attribute29
135   ,p_attribute30                   =>   p_attribute30
136   );
137   exception
138     when hr_api.cannot_find_prog_unit then
139       hr_api.cannot_find_prog_unit_error
140         (p_module_name => 'CREATE_ELECTION_CONSTITUENCY'
141         ,p_hook_type   => 'BP'
142         );
143 
144   end;
145   --
146   hr_utility.set_location('Entering: call - per_eco_ins.ins ', 40);
147   --
148   per_eco_ins.ins
149   (p_effective_date                =>   l_effective_date
150   ,p_validate                      =>   FALSE
151   ,p_election_id				=>	p_election_id
152   ,p_business_group_id             =>   p_business_group_id
153   ,p_constituency_id               =>   p_constituency_id
154   ,p_attribute_category            =>   p_attribute_category
155   ,p_attribute1                    =>   p_attribute1
156   ,p_attribute2                    =>   p_attribute2
157   ,p_attribute3                    =>   p_attribute3
158   ,p_attribute4                    =>   p_attribute4
159   ,p_attribute5                    =>   p_attribute5
160   ,p_attribute6                    =>   p_attribute6
161   ,p_attribute7                    =>   p_attribute7
162   ,p_attribute8                    =>   p_attribute8
163   ,p_attribute9                    =>   p_attribute9
164   ,p_attribute10                   =>   p_attribute10
165   ,p_attribute11                   =>   p_attribute11
166   ,p_attribute12                   =>   p_attribute12
167   ,p_attribute13                   =>   p_attribute13
168   ,p_attribute14                   =>   p_attribute14
169   ,p_attribute15                   =>   p_attribute15
170   ,p_attribute16                   =>   p_attribute16
171   ,p_attribute17                   =>   p_attribute17
172   ,p_attribute18                   =>   p_attribute18
173   ,p_attribute19                   =>   p_attribute19
174   ,p_attribute20                   =>   p_attribute20
175   ,p_attribute21                   =>   p_attribute21
176   ,p_attribute22                   =>   p_attribute22
177   ,p_attribute23                   =>   p_attribute23
178   ,p_attribute24                   =>   p_attribute24
179   ,p_attribute25                   =>   p_attribute25
180   ,p_attribute26                   =>   p_attribute26
181   ,p_attribute27                   =>   p_attribute27
182   ,p_attribute28                   =>   p_attribute28
183   ,p_attribute29                   =>   p_attribute29
184   ,p_attribute30                   =>   p_attribute30
185   ,p_election_constituency_id		=>	l_election_constituency_id
186   ,p_object_version_number	  	=>	l_object_version_number
187   );
188   --
189   hr_utility.set_location('Entering: call - create_election_constits_a', 50);
190   --
191    begin
192 hr_elc_constituencys_api_bk1.create_election_constituency_a
193   (p_effective_date                =>   l_effective_date
194   ,p_election_id				=>	p_election_id
195   ,p_business_group_id             =>   p_business_group_id
196   ,p_constituency_id               =>   p_constituency_id
197   ,p_attribute_category            =>   p_attribute_category
198   ,p_attribute1                    =>   p_attribute1
199   ,p_attribute2                    =>   p_attribute2
200   ,p_attribute3                    =>   p_attribute3
201   ,p_attribute4                    =>   p_attribute4
202   ,p_attribute5                    =>   p_attribute5
203   ,p_attribute6                    =>   p_attribute6
204   ,p_attribute7                    =>   p_attribute7
205   ,p_attribute8                    =>   p_attribute8
206   ,p_attribute9                    =>   p_attribute9
207   ,p_attribute10                   =>   p_attribute10
208   ,p_attribute11                   =>   p_attribute11
209   ,p_attribute12                   =>   p_attribute12
210   ,p_attribute13                   =>   p_attribute13
211   ,p_attribute14                   =>   p_attribute14
212   ,p_attribute15                   =>   p_attribute15
213   ,p_attribute16                   =>   p_attribute16
214   ,p_attribute17                   =>   p_attribute17
215   ,p_attribute18                   =>   p_attribute18
216   ,p_attribute19                   =>   p_attribute19
217   ,p_attribute20                   =>   p_attribute20
218   ,p_attribute21                   =>   p_attribute21
219   ,p_attribute22                   =>   p_attribute22
220   ,p_attribute23                   =>   p_attribute23
221   ,p_attribute24                   =>   p_attribute24
222   ,p_attribute25                   =>   p_attribute25
223   ,p_attribute26                   =>   p_attribute26
224   ,p_attribute27                   =>   p_attribute27
225   ,p_attribute28                   =>   p_attribute28
226   ,p_attribute29                   =>   p_attribute29
227   ,p_attribute30                   =>   p_attribute30
228   ,p_election_constituency_id		=>	l_election_constituency_id
229   ,p_object_version_number	     =>	l_object_version_number
230   );
231 
232   exception
233     when hr_api.cannot_find_prog_unit then
234       hr_api.cannot_find_prog_unit_error
235         (p_module_name => 'CREATE_ELECTION_CONSTITUENCY'
236         ,p_hook_type   => 'AP'
237         );
238   end;
239   --
240   -- When in validation only mode raise the Validate_Enabled exception
241   --
242   if p_validate then
243     raise hr_api.validate_enabled;
244   end if;
245   --
246   -- Set all output arguments
247   --
248   p_election_constituency_id       := l_election_constituency_id;
249   p_object_version_number  		:= l_object_version_number;
250   --
251   hr_utility.set_location(' Leaving:'||l_proc, 70);
252 exception
253   when hr_api.validate_enabled then
254     --
255     -- As the Validate_Enabled exception has been raised
256     -- we must rollback to the savepoint
257     --
258     rollback to create_elec_con;
259     --
260     -- Only set output warning arguments
261     -- (Any key or derived arguments must be set to null
262     -- when validation only mode is being used.)
263     --
264     p_election_constituency_id     := null;
265     p_object_version_number  		:= null;
266     --
267     hr_utility.set_location(' Leaving:'||l_proc, 80);
268   when others then
269     --
270     -- A validation or unexpected error has occured
271     --
272     rollback to create_elec_con;
273     --
274     -- set in out parameters and set out parameters
275     --
276     p_election_constituency_id     := null;
277     p_object_version_number             := null;
278     --
279     hr_utility.set_location(' Leaving:'||l_proc, 90);
280     raise;
281 end create_election_constituency;
282 --
283 
284 -- ----------------------------------------------------------------------------
285 -- |---------------------< update_election_constituency >---------------------|
286 -- ----------------------------------------------------------------------------
287 --
288 procedure update_election_constituency
289  (p_validate                      in     boolean  default false
290   ,p_effective_date                in     date
291   ,p_election_constituency_id      in out nocopy number
292   ,p_election_id                   in     number   default hr_api.g_number
293   ,p_business_group_id             in     number   default hr_api.g_number
294   ,p_constituency_id               in     number   default hr_api.g_number
295   ,p_attribute_category            in     varchar2 default hr_api.g_varchar2
296   ,p_attribute1                    in     varchar2 default hr_api.g_varchar2
297   ,p_attribute2                    in     varchar2 default hr_api.g_varchar2
298   ,p_attribute3                    in     varchar2 default hr_api.g_varchar2
299   ,p_attribute4                    in     varchar2 default hr_api.g_varchar2
300   ,p_attribute5                    in     varchar2 default hr_api.g_varchar2
301   ,p_attribute6                    in     varchar2 default hr_api.g_varchar2
302   ,p_attribute7                    in     varchar2 default hr_api.g_varchar2
303   ,p_attribute8                    in     varchar2 default hr_api.g_varchar2
304   ,p_attribute9                    in     varchar2 default hr_api.g_varchar2
305   ,p_attribute10                   in     varchar2 default hr_api.g_varchar2
306   ,p_attribute11                   in     varchar2 default hr_api.g_varchar2
307   ,p_attribute12                   in     varchar2 default hr_api.g_varchar2
308   ,p_attribute13                   in     varchar2 default hr_api.g_varchar2
309   ,p_attribute14                   in     varchar2 default hr_api.g_varchar2
310   ,p_attribute15                   in     varchar2 default hr_api.g_varchar2
311   ,p_attribute16                   in     varchar2 default hr_api.g_varchar2
312   ,p_attribute17                   in     varchar2 default hr_api.g_varchar2
313   ,p_attribute18                   in     varchar2 default hr_api.g_varchar2
314   ,p_attribute19                   in     varchar2 default hr_api.g_varchar2
315   ,p_attribute20                   in     varchar2 default hr_api.g_varchar2
316   ,p_attribute21                   in     varchar2 default hr_api.g_varchar2
317   ,p_attribute22                   in     varchar2 default hr_api.g_varchar2
318   ,p_attribute23                   in     varchar2 default hr_api.g_varchar2
319   ,p_attribute24                   in     varchar2 default hr_api.g_varchar2
320   ,p_attribute25                   in     varchar2 default hr_api.g_varchar2
321   ,p_attribute26                   in     varchar2 default hr_api.g_varchar2
322   ,p_attribute27                   in     varchar2 default hr_api.g_varchar2
323   ,p_attribute28                   in     varchar2 default hr_api.g_varchar2
324   ,p_attribute29                   in     varchar2 default hr_api.g_varchar2
325   ,p_attribute30                   in     varchar2 default hr_api.g_varchar2
326   ,p_object_version_number         in out nocopy number
327   ) is
328   --
329   -- Declare cursors and local variables
330   --
331    l_object_version_number per_elections.object_version_number%TYPE;
332    l_ovn per_elections.object_version_number%TYPE := p_object_version_number;
333   --
334   -- Declare out parameters
335   l_effective_date              date;
336   --
337   l_proc                varchar2(72) := g_package||'update_election_constituency';
338   --
339 begin
340   hr_utility.set_location('Entering:'|| l_proc, 10);
341   --
342   -- Issue a savepoint
343   --
344   savepoint update_election_constituency;
345   --
346   -- Check that p_constituency_id, p_business_group_id, election_id are not null.
347   --
348   hr_utility.set_location('Entering mandatory arg check', 20);
349   --
350   hr_api.mandatory_arg_error
351     (p_api_name       => l_proc,
352      p_argument       => 'constituency_id',
353      p_argument_value => p_constituency_id);
354   --
355   hr_api.mandatory_arg_error
356     (p_api_name       => l_proc,
357      p_argument       => 'business_group_id',
358      p_argument_value => p_business_group_id);
359   --
360   hr_api.mandatory_arg_error
361     (p_api_name       => l_proc,
362      p_argument       => 'effective_date',
363      p_argument_value => p_effective_date);
364   --
365   hr_api.mandatory_arg_error
366     (p_api_name       => l_proc,
367      p_argument       => 'election_id',
368      p_argument_value => p_election_id);
369   --
370   l_effective_date := trunc(p_effective_date);
371   --
372   hr_utility.set_location('Entering: call - update_election_constituency_b ', 30);
373   --
374   begin
375 
376 hr_elc_constituencys_api_bk2.update_election_constituency_b
377   (p_effective_date                =>   l_effective_date
378   ,p_election_constituency_id		=>	p_election_constituency_id
379   ,p_election_id				=>	p_election_id
380   ,p_business_group_id             =>   p_business_group_id
381   ,p_constituency_id               =>   p_constituency_id
382   ,p_attribute_category            =>   p_attribute_category
383   ,p_attribute1                    =>   p_attribute1
384   ,p_attribute2                    =>   p_attribute2
385   ,p_attribute3                    =>   p_attribute3
386   ,p_attribute4                    =>   p_attribute4
387   ,p_attribute5                    =>   p_attribute5
388   ,p_attribute6                    =>   p_attribute6
389   ,p_attribute7                    =>   p_attribute7
390   ,p_attribute8                    =>   p_attribute8
391   ,p_attribute9                    =>   p_attribute9
392   ,p_attribute10                   =>   p_attribute10
393   ,p_attribute11                   =>   p_attribute11
394   ,p_attribute12                   =>   p_attribute12
395   ,p_attribute13                   =>   p_attribute13
396   ,p_attribute14                   =>   p_attribute14
397   ,p_attribute15                   =>   p_attribute15
398   ,p_attribute16                   =>   p_attribute16
399   ,p_attribute17                   =>   p_attribute17
400   ,p_attribute18                   =>   p_attribute18
401   ,p_attribute19                   =>   p_attribute19
402   ,p_attribute20                   =>   p_attribute20
403   ,p_attribute21                   =>   p_attribute21
404   ,p_attribute22                   =>   p_attribute22
405   ,p_attribute23                   =>   p_attribute23
406   ,p_attribute24                   =>   p_attribute24
407   ,p_attribute25                   =>   p_attribute25
408   ,p_attribute26                   =>   p_attribute26
409   ,p_attribute27                   =>   p_attribute27
410   ,p_attribute28                   =>   p_attribute28
411   ,p_attribute29                   =>   p_attribute29
412   ,p_attribute30                   =>   p_attribute30
413   ,p_object_version_number	     =>	p_object_version_number
414   );
415   exception
416     when hr_api.cannot_find_prog_unit then
417       hr_api.cannot_find_prog_unit_error
418         (p_module_name => 'UPDATE_ELECTION_CONSTITUENCY'
419         ,p_hook_type   => 'BP'
420         );
421 
422   end;
423   --
424   hr_utility.set_location('Entering: call - per_eco_upd.upd ', 40);
425   --
426   l_object_version_number := p_object_version_number;
427   --
428   --
429   per_eco_upd.upd
430   (p_effective_date                =>   l_effective_date
431   ,p_validate                      =>   FALSE
432   ,p_election_constituency_id      =>   p_election_constituency_id
433   ,p_election_id				=>	p_election_id
434   ,p_business_group_id             =>   p_business_group_id
435   ,p_constituency_id               =>   p_constituency_id
436   ,p_attribute_category            =>   p_attribute_category
437   ,p_attribute1                    =>   p_attribute1
438   ,p_attribute2                    =>   p_attribute2
439   ,p_attribute3                    =>   p_attribute3
440   ,p_attribute4                    =>   p_attribute4
441   ,p_attribute5                    =>   p_attribute5
442   ,p_attribute6                    =>   p_attribute6
443   ,p_attribute7                    =>   p_attribute7
444   ,p_attribute8                    =>   p_attribute8
445   ,p_attribute9                    =>   p_attribute9
446   ,p_attribute10                   =>   p_attribute10
447   ,p_attribute11                   =>   p_attribute11
448   ,p_attribute12                   =>   p_attribute12
449   ,p_attribute13                   =>   p_attribute13
450   ,p_attribute14                   =>   p_attribute14
451   ,p_attribute15                   =>   p_attribute15
452   ,p_attribute16                   =>   p_attribute16
453   ,p_attribute17                   =>   p_attribute17
454   ,p_attribute18                   =>   p_attribute18
455   ,p_attribute19                   =>   p_attribute19
456   ,p_attribute20                   =>   p_attribute20
457   ,p_attribute21                   =>   p_attribute21
458   ,p_attribute22                   =>   p_attribute22
459   ,p_attribute23                   =>   p_attribute23
460   ,p_attribute24                   =>   p_attribute24
461   ,p_attribute25                   =>   p_attribute25
462   ,p_attribute26                   =>   p_attribute26
463   ,p_attribute27                   =>   p_attribute27
464   ,p_attribute28                   =>   p_attribute28
465   ,p_attribute29                   =>   p_attribute29
466   ,p_attribute30                   =>   p_attribute30
467   ,p_object_version_number		=>	p_object_version_number
468   );
469   --
470   hr_utility.set_location('Entering: call - update_election_constituency_a', 50);
471   --
472   begin
473   --
474 hr_elc_constituencys_api_bk2.update_election_constituency_a
475   (p_effective_date                =>   l_effective_date
476   ,p_election_constituency_id      =>   p_election_constituency_id
477   ,p_election_id		   =>	p_election_id
478   ,p_business_group_id             =>   p_business_group_id
479   ,p_constituency_id               =>   p_constituency_id
480   ,p_attribute_category            =>   p_attribute_category
481   ,p_attribute1                    =>   p_attribute1
482   ,p_attribute2                    =>   p_attribute2
483   ,p_attribute3                    =>   p_attribute3
484   ,p_attribute4                    =>   p_attribute4
485   ,p_attribute5                    =>   p_attribute5
486   ,p_attribute6                    =>   p_attribute6
487   ,p_attribute7                    =>   p_attribute7
488   ,p_attribute8                    =>   p_attribute8
489   ,p_attribute9                    =>   p_attribute9
490   ,p_attribute10                   =>   p_attribute10
491   ,p_attribute11                   =>   p_attribute11
492   ,p_attribute12                   =>   p_attribute12
493   ,p_attribute13                   =>   p_attribute13
494   ,p_attribute14                   =>   p_attribute14
495   ,p_attribute15                   =>   p_attribute15
496   ,p_attribute16                   =>   p_attribute16
497   ,p_attribute17                   =>   p_attribute17
498   ,p_attribute18                   =>   p_attribute18
499   ,p_attribute19                   =>   p_attribute19
500   ,p_attribute20                   =>   p_attribute20
501   ,p_attribute21                   =>   p_attribute21
502   ,p_attribute22                   =>   p_attribute22
503   ,p_attribute23                   =>   p_attribute23
504   ,p_attribute24                   =>   p_attribute24
505   ,p_attribute25                   =>   p_attribute25
506   ,p_attribute26                   =>   p_attribute26
507   ,p_attribute27                   =>   p_attribute27
508   ,p_attribute28                   =>   p_attribute28
509   ,p_attribute29                   =>   p_attribute29
510   ,p_attribute30                   =>   p_attribute30
511   ,p_object_version_number		=>	p_object_version_number
512   );
513 
514   exception
515     when hr_api.cannot_find_prog_unit then
516       hr_api.cannot_find_prog_unit_error
517         (p_module_name => 'UPDATE_ELECTION_CONSTITUENCY'
518         ,p_hook_type   => 'AP'
519         );
520   end;
521   --
522   -- When in validation only mode raise the Validate_Enabled exception
523   --
524   if p_validate then
525     raise hr_api.validate_enabled;
526   end if;
527   --
528   --
529   hr_utility.set_location(' Leaving:'||l_proc, 70);
530 exception
531   when hr_api.validate_enabled then
532     --
533     -- As the Validate_Enabled exception has been raised
534     -- we must rollback to the savepoint
535     --
536     rollback to update_election_constituency;
537     --
538     -- Only set output warning arguments
539     -- (Any key or derived arguments must be set to null
540     -- when validation only mode is being used.)
541     --
542     p_object_version_number  := l_object_version_number;
543     --
544     hr_utility.set_location(' Leaving:'||l_proc, 80);
545   when others then
546     --
547     -- A validation or unexpected error has occured
548     --
549     rollback to update_election_constituency;
550     --
551     -- set in out parameters and set out parameters
552     --
553      p_object_version_number  := l_object_version_number;
554      p_election_constituency_id := null;
555     hr_utility.set_location(' Leaving:'||l_proc, 90);
556     raise;
557 end update_election_constituency;
558 --
559 -- ----------------------------------------------------------------------------
560 -- |-----------------------< delete_election_constituency >-------------------|
561 -- ----------------------------------------------------------------------------
562 --
563 procedure delete_election_constituency
564   (p_validate                       in     boolean  default false
565   ,p_election_constituency_id	    in 	   number
566   ,p_object_version_number          in     number
567   ) is
568   --
569   -- Declare cursors and local variables
570   --
571   l_proc varchar2(72) := (g_package||'delete_election_information');
572   l_object_version_number per_election_constituencys.object_version_number%TYPE;
573   l_election_id per_election_constituencys.election_id%TYPE;
574   --
575   cursor csr_get_elc_id is
576   select election_id
577   from per_election_constituencys
578   where election_constituency_id = p_election_constituency_id;
579   --
580 begin
581   --
582   hr_utility.set_location('Entering:'|| l_proc, 10);
583   --
584   -- Issue a savepoint if operating in validation only mode
585   --
586   savepoint delete_election_constituency;
587   --
588   hr_utility.set_location(l_proc, 20);
589   --
590   -- Process Logic
591   --
592   hr_api.mandatory_arg_error
593     (p_api_name       => l_proc
594     ,p_argument       => 'election_constituency_id'
595     ,p_argument_value => p_election_constituency_id
596     );
597   --
598   open csr_get_elc_id;
599   fetch csr_get_elc_id into l_election_id;
600   close csr_get_elc_id;
601   --
602 
603   l_object_version_number := p_object_version_number;
604   --
605   --
606   begin
607     --
608     -- Start of API User Hook for the before hook of delete_election_constituency
609     --
610     hr_elc_constituencys_api_bk3.delete_election_constituency_b
611       (
612        p_election_constituency_id       =>  p_election_constituency_id
613       ,p_object_version_number          =>  l_object_version_number
614       );
615   exception
616     when hr_api.cannot_find_prog_unit then
617       hr_api.cannot_find_prog_unit_error
618         (p_module_name => 'delete_election_constituency'
619         ,p_hook_type   => 'BP'
620         );
621     --
622     -- End of API User Hook for the before hook of delete_election_constituency
623     --
624   end;
625   --
626   per_eco_del.del
627     (
628      p_election_constituency_id      => p_election_constituency_id
629     ,p_election_id		     	  => l_election_id
630     ,p_validate			       => p_validate
631     ,p_object_version_number         => l_object_version_number
632     );
633   --
634   begin
635     --
636     -- Start of API User Hook for the after hook of delete_election_constituency
637     --
638     hr_elc_constituencys_api_bk3.delete_election_constituency_a
639        (p_election_constituency_id       =>  p_election_constituency_id
640       ,p_object_version_number          =>  l_object_version_number
641       );
642   exception
643     when hr_api.cannot_find_prog_unit then
644       hr_api.cannot_find_prog_unit_error
645         (p_module_name => 'delete_election_constituency'
646         ,p_hook_type   => 'AP'
647         );
648     --
649     -- End of API User Hook for the after hook of delete_election_constituency
650     --
651   end;
652   --
653   hr_utility.set_location(l_proc, 60);
654   --
655   -- When in validation only mode raise the Validate_Enabled exception
656   --
657   if p_validate then
658     raise hr_api.validate_enabled;
659   end if;
660   --
661   hr_utility.set_location(' Leaving:'||l_proc, 70);
662   --
663 exception
664   --
665   when hr_api.validate_enabled then
666     --
667     -- As the Validate_Enabled exception has been raised
668     -- we must rollback to the savepoint
669     --
670     ROLLBACK TO delete_election_constituency;
671     --
672     -- Only set output warning arguments
673     -- (Any key or derived arguments must be set to null
674     -- when validation only mode is being used.)
675     --
676     --
677   when others then
678     --
679     -- A validation or unexpected error has occured
680     --
681     ROLLBACK TO delete_election_constituency;
682     raise;
683     --
684 end delete_election_constituency;
685 --
686 --
687 end hr_elc_constituencys_api;