DBA Data[Home] [Help]

PACKAGE BODY: APPS.GHR_PRH_API

Source


1 Package Body ghr_prh_api as
2 /* $Header: ghprhapi.pkb 115.2 1999/11/09 16:03:44 pkm ship      $ */
3 --
4 -- Package Variables
5 g_package  varchar2(33)	:= '  ghr_prh_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_pa_request_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_prh_object_version_number    ghr_pa_routing_history.object_version_number%TYPE;
20   l_prh_pa_routing_history_id    ghr_pa_routing_history.pa_routing_history_id%TYPE;
21   l_action_taken                 ghr_pa_routing_history.action_taken%type;
22 
23 
24   cursor     C_routing_history_id is
25     select   prh.pa_routing_history_id,
26              prh.object_version_number,
27              prh.action_taken
28     from     ghr_pa_routing_history prh
29     where    prh.pa_request_id = p_pa_request_id
30     order by prh.pa_routing_history_id desc;
31 
32 begin
33     hr_utility.set_location('Entering:'|| l_proc, 5);
34   --
35 
36       savepoint upd_date_notif_sent;
37     hr_utility.set_location(l_proc, 6);
38 
39 
40    for cur_routing_history in C_routing_history_id loop
41         l_prh_pa_routing_history_id     :=  cur_routing_history.pa_routing_history_id;
42         l_prh_object_version_number     :=  cur_routing_history.object_version_number;
43         l_action_taken                  :=  cur_routing_history.action_taken;
44         exit;
45    end loop;
46 
47 --  if  nvl(l_action_taken,hr_api.g_varchar2) = hr_api.g_varchar2 then
48      ghr_prh_upd.upd
49        (p_pa_routing_history_id      => l_prh_pa_routing_history_id
50        ,p_date_notification_sent     => p_date_notification_sent
51        ,p_object_version_number      => l_prh_object_version_number
52        ,p_validate                   => p_validate
53        );
54 --   else
55 --     hr_utility.set_message(8301,'GHR_38112_INVALID_API');
56 --     hr_utility.raise_error;
57 --   end if;
58 
59    if p_validate then
60      raise hr_api.validate_enabled;
61    end if;
62 
63  -- Set all output arguments
64  --
65    hr_utility.set_location(' Leaving:'||l_proc, 11);
66   exception
67     when hr_api.validate_enabled then
68     --
69     -- As the Validate_Enabled exception has been raised
70     -- we must rollback to the savepoint
71     --
72     ROLLBACK TO upd_date_notif_sent;
73     --
74     -- Only set output warning arguments
75     -- (Any key or derived arguments must be set to null
76     -- when validation only mode is being used.)
77     when others then
78       ROLLBACK TO upd_date_notif_sent;
79       raise;
80 
81     hr_utility.set_location(' Leaving:'||l_proc, 12);
82 
83   end upd_date_notif_sent;
84  end ghr_prh_api;