DBA Data[Home] [Help]

PACKAGE BODY: APPS.HR_EAP_SHD

Source


1 Package Body hr_eap_shd as
2 /* $Header: hreaprhi.pkb 115.0 2004/01/09 00:17:50 vkarandi noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  hr_eap_shd.';  -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |---------------------------< constraint_error >---------------------------|
12 -- ----------------------------------------------------------------------------
13 Procedure constraint_error
14   (p_constraint_name in all_constraints.constraint_name%TYPE
15   ) Is
16 --
17   l_proc        varchar2(72) := g_package||'constraint_error';
18 --
19 Begin
20   --
21   If (p_constraint_name = 'HR_KI_EXT_APPLICATIONS_PK') Then
22     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
23     fnd_message.set_token('PROCEDURE', l_proc);
24     fnd_message.set_token('STEP','5');
25     fnd_message.raise_error;
26   Else
27     fnd_message.set_name('PAY', 'HR_7877_API_INVALID_CONSTRAINT');
28     fnd_message.set_token('PROCEDURE', l_proc);
29     fnd_message.set_token('CONSTRAINT_NAME', p_constraint_name);
30     fnd_message.raise_error;
31   End If;
32   --
33 End constraint_error;
34 --
35 -- ----------------------------------------------------------------------------
36 -- |-----------------------------< api_updating >-----------------------------|
37 -- ----------------------------------------------------------------------------
38 Function api_updating
39   (p_ext_application_id                   in     number
40   )
41   Return Boolean Is
42   --
43   --
44   -- Cursor selects the 'current' row from the HR Schema
45   --
46   Cursor C_Sel1 is
47     select
48        ext_application_id
49       ,external_application_name
50       ,external_application_id
51     from        hr_ki_ext_applications
52     where       ext_application_id = p_ext_application_id;
53   --
54   l_fct_ret     boolean;
55   --
56 Begin
57   --
58   If (p_ext_application_id is null
59      ) Then
60     --
61     -- One of the primary key arguments is null therefore we must
62     -- set the returning function value to false
63     --
64     l_fct_ret := false;
65   Else
66     If (p_ext_application_id
67         = hr_eap_shd.g_old_rec.ext_application_id
68        ) Then
69       --
70       -- The g_old_rec is current therefore we must
71       -- set the returning function to true
72       --
73       l_fct_ret := true;
74     Else
75       --
76       -- Select the current row into g_old_rec
77       --
78       Open C_Sel1;
79       Fetch C_Sel1 Into hr_eap_shd.g_old_rec;
80       If C_Sel1%notfound Then
81         Close C_Sel1;
82         --
83         -- The primary key is invalid therefore we must error
84         --
85         fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
86         fnd_message.raise_error;
87       End If;
88       Close C_Sel1;
89       --
90       l_fct_ret := true;
91     End If;
92   End If;
93   Return (l_fct_ret);
94 --
95 End api_updating;
96 --
97 -- ----------------------------------------------------------------------------
98 -- |---------------------------------< lck >----------------------------------|
99 -- ----------------------------------------------------------------------------
100 Procedure lck
101   (p_ext_application_id                   in     number
102   ) is
103 --
104 -- Cursor selects the 'current' row from the HR Schema
105 --
106   Cursor C_Sel1 is
107     select
108        ext_application_id
109       ,external_application_name
110       ,external_application_id
111     from        hr_ki_ext_applications
112     where       ext_application_id = p_ext_application_id
113     for update nowait;
114 --
115   l_proc        varchar2(72) := g_package||'lck';
116 --
117 Begin
118   hr_utility.set_location('Entering:'||l_proc, 5);
119   --
120   hr_api.mandatory_arg_error
121     (p_api_name           => l_proc
122     ,p_argument           => 'EXT_APPLICATION_ID'
123     ,p_argument_value     => p_ext_application_id
124     );
125   --
126   Open  C_Sel1;
127   Fetch C_Sel1 Into hr_eap_shd.g_old_rec;
128   If C_Sel1%notfound then
129     Close C_Sel1;
130     --
131     -- The primary key is invalid therefore we must error
132     --
133     fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
134     fnd_message.raise_error;
135   End If;
136   Close C_Sel1;
137   --
138   --
139   hr_utility.set_location(' Leaving:'||l_proc, 10);
140   --
141   -- We need to trap the ORA LOCK exception
142   --
143 Exception
144   When HR_Api.Object_Locked then
145     --
146     -- The object is locked therefore we need to supply a meaningful
147     -- error message.
148     --
149     fnd_message.set_name('PAY', 'HR_7165_OBJECT_LOCKED');
150     fnd_message.set_token('TABLE_NAME', 'hr_ki_ext_applications');
151     fnd_message.raise_error;
152 End lck;
153 --
154 -- ----------------------------------------------------------------------------
155 -- |-----------------------------< convert_args >-----------------------------|
156 -- ----------------------------------------------------------------------------
157 Function convert_args
158   (p_ext_application_id             in number
159   ,p_external_application_name      in varchar2
160   ,p_external_application_id        in varchar2
161   )
162   Return g_rec_type is
163 --
164   l_rec   g_rec_type;
165 --
166 Begin
167   --
168   -- Convert arguments into local l_rec structure.
169   --
170   l_rec.ext_application_id               := p_ext_application_id;
171   l_rec.external_application_name        := p_external_application_name;
172   l_rec.external_application_id          := p_external_application_id;
173   --
174   -- Return the plsql record structure.
175   --
176   Return(l_rec);
177 --
178 End convert_args;
179 --
180 end hr_eap_shd;