DBA Data[Home] [Help]

PACKAGE BODY: APPS.GHR_PDH_API

Source


1 Package Body ghr_pdh_api as
2 /* $Header: ghpdhapi.pkb 115.2 99/10/14 12:11:09 porting ship  $ */
3 --
4 -- Package Variables
5 g_package  varchar2(33)	:= 'ghr_pdh_api.';
6 
7 
8 -- ----------------------------------------------------------------------------
9 -- |--------------------------< upd_date_notif_sent>--------------------------|
10 -- ----------------------------------------------------------------------------
11 
12   procedure upd_date_notif_sent
13   (p_validate                        in      boolean   default false,
14    p_position_description_id                   in      number,
15    p_date_notification_sent          in      date      default trunc(sysdate)
16    )is
17 
18   l_proc                         varchar2(72) := g_package|| 'upd_date_notif_sent' ;
19   l_pdh_object_version_number    ghr_pd_routing_history.object_version_number%TYPE;
20   l_pdh_pd_routing_history_id    ghr_pd_routing_history.pd_routing_history_id%TYPE;
21   l_action_taken                 ghr_pd_routing_history.action_taken%type;
22 
23 
24   cursor     C_routing_history_id is
25     select   pdh.pd_routing_history_id,
26              pdh.object_version_number,
27              pdh.action_taken
28     from     ghr_pd_routing_history pdh
29     where    pdh.position_description_id = p_position_description_id
30     order by pdh.pd_routing_history_id desc;
31 
32 begin
33     hr_utility.set_location('Entering:'|| l_proc, 5);
34   --
35   -- Issue a savepoint if operating in validation only mode.
36   --
37 
38 --    if p_validate then
39       savepoint upd_date_notif_sent;
40 --    end if;
41     hr_utility.set_location(l_proc, 6);
42 
43 
44    for cur_routing_history in C_routing_history_id loop
45         l_pdh_pd_routing_history_id     :=  cur_routing_history.pd_routing_history_id;
46         l_pdh_object_version_number     :=  cur_routing_history.object_version_number;
47         l_action_taken                  :=  cur_routing_history.action_taken;
48         exit;
49    end loop;
50 
51 --  if  nvl(l_action_taken,hr_api.g_varchar2) = hr_api.g_varchar2 then
52      ghr_pdh_upd.upd
53        (p_pd_routing_history_id      => l_pdh_pd_routing_history_id
54        ,p_date_notification_sent     => p_date_notification_sent
55        ,p_object_version_number      => l_pdh_object_version_number
56        ,p_validate                   => p_validate
57        );
58 --   else
59 --     hr_utility.set_message(8301,'GHR_38112_INVALID_API');
60 --     hr_utility.raise_error;
61 --   end if;
62 
63    if p_validate then
64      raise hr_api.validate_enabled;
65    end if;
66 
67  -- Set all output arguments
68  --
69    hr_utility.set_location(' Leaving:'||l_proc, 11);
70   exception
71     when hr_api.validate_enabled then
72     --
73     -- As the Validate_Enabled exception has been raised
74     -- we must rollback to the savepoint
75     --
76     ROLLBACK TO upd_date_notif_sent;
77     --
78     -- Only set output warning arguments
79     -- (Any key or derived arguments must be set to null
80     -- when validation only mode is being used.)
81     --
82 	when others then
83            rollback to upd_date_notif_sent;
84            raise;
85 
86     hr_utility.set_location(' Leaving:'||l_proc, 12);
87 
88   end upd_date_notif_sent;
89  end ghr_pdh_api;