[Home] [Help]
PACKAGE BODY: APPS.HXC_EGC_SHD
Source
1 Package Body hxc_egc_shd as
2 /* $Header: hxcegcrhi.pkb 120.2 2005/09/23 10:39:50 sechandr noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' hxc_egc_shd.'; -- Global package name
9 g_debug boolean := hr_utility.debug_enabled;
10 --
11 -- ----------------------------------------------------------------------------
12 -- |------------------------< return_api_dml_status >-------------------------|
13 -- ----------------------------------------------------------------------------
14 Function return_api_dml_status Return Boolean Is
15 --
16 Begin
17 --
18 Return (nvl(g_api_dml, false));
19 --
20 End return_api_dml_status;
21 --
22 -- ----------------------------------------------------------------------------
23 -- |---------------------------< constraint_error >---------------------------|
24 -- ----------------------------------------------------------------------------
25 Procedure constraint_error
26 (p_constraint_name in all_constraints.constraint_name%TYPE
27 ) Is
28 --
29 l_proc varchar2(72) := g_package||'constraint_error';
30 --
31 Begin
32 --
33 If (p_constraint_name = 'HXC_ENTITY_GROUP_COMPS_PK') Then
34 fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
35 fnd_message.set_token('PROCEDURE', l_proc);
36 fnd_message.set_token('STEP','5');
37 fnd_message.raise_error;
38 Else
39 fnd_message.set_name('PAY', 'HR_7877_API_INVALID_CONSTRAINT');
40 fnd_message.set_token('PROCEDURE', l_proc);
41 fnd_message.set_token('CONSTRAINT_NAME', p_constraint_name);
42 fnd_message.raise_error;
43 End If;
44 --
45 End constraint_error;
46 --
47 -- ----------------------------------------------------------------------------
48 -- |-----------------------------< api_updating >-----------------------------|
49 -- ----------------------------------------------------------------------------
50 Function api_updating
51 (p_entity_group_comp_id in number
52 ,p_object_version_number in number
53 )
54 Return Boolean Is
55 --
56 --
57 -- Cursor selects the 'current' row from the HR Schema
58 --
59 Cursor C_Sel1 is
60 select
61 entity_group_comp_id
62 ,entity_group_id
63 ,entity_id
64 ,entity_type
65 ,attribute_category
66 ,attribute1
67 ,attribute2
68 ,attribute3
69 ,attribute4
70 ,attribute5
71 ,attribute6
72 ,attribute7
73 ,attribute8
74 ,attribute9
75 ,attribute10
76 ,attribute11
77 ,attribute12
78 ,attribute13
79 ,attribute14
80 ,attribute15
81 ,attribute16
82 ,attribute17
83 ,attribute18
84 ,attribute19
85 ,attribute20
86 ,attribute21
87 ,attribute22
88 ,attribute23
89 ,attribute24
90 ,attribute25
91 ,attribute26
92 ,attribute27
93 ,attribute28
94 ,attribute29
95 ,attribute30
96 ,object_version_number
97 from hxc_entity_group_comps
98 where entity_group_comp_id = p_entity_group_comp_id;
99 --
100 l_fct_ret boolean;
101 --
102 Begin
103 --
104 If (p_entity_group_comp_id is null and
105 p_object_version_number is null
106 ) Then
107 --
108 -- One of the primary key arguments is null therefore we must
109 -- set the returning function value to false
110 --
111 l_fct_ret := false;
112 Else
113 If (p_entity_group_comp_id
114 = hxc_egc_shd.g_old_rec.entity_group_comp_id and
115 p_object_version_number
116 = hxc_egc_shd.g_old_rec.object_version_number
117 ) Then
118 --
119 -- The g_old_rec is current therefore we must
120 -- set the returning function to true
121 --
122 l_fct_ret := true;
123 Else
124 --
125 -- Select the current row into g_old_rec
126 --
127 Open C_Sel1;
128 Fetch C_Sel1 Into hxc_egc_shd.g_old_rec;
129 If C_Sel1%notfound Then
130 Close C_Sel1;
131 --
132 -- The primary key is invalid therefore we must error
133 --
134 fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
135 fnd_message.raise_error;
136 End If;
137 Close C_Sel1;
138 If (p_object_version_number
139 <> hxc_egc_shd.g_old_rec.object_version_number) Then
140 fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
141 fnd_message.raise_error;
142 End If;
143 l_fct_ret := true;
144 End If;
145 End If;
146 Return (l_fct_ret);
147 --
148 End api_updating;
149 --
150 -- ----------------------------------------------------------------------------
151 -- |---------------------------------< lck >----------------------------------|
152 -- ----------------------------------------------------------------------------
153 Procedure lck
154 (p_entity_group_comp_id in number
155 ,p_object_version_number in number
156 ) is
157 --
158 -- Cursor selects the 'current' row from the HR Schema
159 --
160 Cursor C_Sel1 is
161 select
162 entity_group_comp_id
163 ,entity_group_id
164 ,entity_id
165 ,entity_type
166 ,attribute_category
167 ,attribute1
168 ,attribute2
169 ,attribute3
170 ,attribute4
171 ,attribute5
172 ,attribute6
173 ,attribute7
174 ,attribute8
175 ,attribute9
176 ,attribute10
177 ,attribute11
178 ,attribute12
179 ,attribute13
180 ,attribute14
181 ,attribute15
182 ,attribute16
183 ,attribute17
184 ,attribute18
185 ,attribute19
186 ,attribute20
187 ,attribute21
188 ,attribute22
189 ,attribute23
190 ,attribute24
191 ,attribute25
192 ,attribute26
193 ,attribute27
194 ,attribute28
195 ,attribute29
196 ,attribute30
197 ,object_version_number
198 from hxc_entity_group_comps
199 where entity_group_comp_id = p_entity_group_comp_id
200 for update nowait;
201 --
202 l_proc varchar2(72);
203 --
204 Begin
205 g_debug:=hr_utility.debug_enabled;
206 if g_debug then
207 l_proc := g_package||'lck';
208 hr_utility.set_location('Entering:'||l_proc, 5);
209 end if;
210 --
211 hr_api.mandatory_arg_error
212 (p_api_name => l_proc
213 ,p_argument => 'ENTITY_GROUP_COMP_ID'
214 ,p_argument_value => p_entity_group_comp_id
215 );
216 --
217 Open C_Sel1;
218 Fetch C_Sel1 Into hxc_egc_shd.g_old_rec;
219 If C_Sel1%notfound then
220 Close C_Sel1;
221 --
222 -- The primary key is invalid therefore we must error
223 --
224 fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
225 fnd_message.raise_error;
226 End If;
227 Close C_Sel1;
228 If (p_object_version_number
229 <> hxc_egc_shd.g_old_rec.object_version_number) Then
230 fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
231 fnd_message.raise_error;
232 End If;
233 --
234 if g_debug then
235 hr_utility.set_location(' Leaving:'||l_proc, 10);
236 end if;
237 --
238 -- We need to trap the ORA LOCK exception
239 --
240 Exception
241 When HR_Api.Object_Locked then
242 --
243 -- The object is locked therefore we need to supply a meaningful
244 -- error message.
245 --
246 fnd_message.set_name('PAY', 'HR_7165_OBJECT_LOCKED');
247 fnd_message.set_token('TABLE_NAME', 'hxc_entity_group_comps');
248 fnd_message.raise_error;
249 End lck;
250 --
251 -- ----------------------------------------------------------------------------
252 -- |-----------------------------< convert_args >-----------------------------|
253 -- ----------------------------------------------------------------------------
254 Function convert_args
255 (p_entity_group_comp_id in number
256 ,p_entity_group_id in number
257 ,p_entity_id in number
258 ,p_entity_type in varchar2
259 ,p_attribute_category in varchar2
260 ,p_attribute1 in varchar2
261 ,p_attribute2 in varchar2
262 ,p_attribute3 in varchar2
263 ,p_attribute4 in varchar2
264 ,p_attribute5 in varchar2
265 ,p_attribute6 in varchar2
266 ,p_attribute7 in varchar2
267 ,p_attribute8 in varchar2
268 ,p_attribute9 in varchar2
269 ,p_attribute10 in varchar2
270 ,p_attribute11 in varchar2
271 ,p_attribute12 in varchar2
272 ,p_attribute13 in varchar2
273 ,p_attribute14 in varchar2
274 ,p_attribute15 in varchar2
275 ,p_attribute16 in varchar2
276 ,p_attribute17 in varchar2
277 ,p_attribute18 in varchar2
278 ,p_attribute19 in varchar2
279 ,p_attribute20 in varchar2
280 ,p_attribute21 in varchar2
281 ,p_attribute22 in varchar2
282 ,p_attribute23 in varchar2
283 ,p_attribute24 in varchar2
284 ,p_attribute25 in varchar2
285 ,p_attribute26 in varchar2
286 ,p_attribute27 in varchar2
287 ,p_attribute28 in varchar2
288 ,p_attribute29 in varchar2
289 ,p_attribute30 in varchar2
290 ,p_object_version_number in number
291 )
292 Return g_rec_type is
293 --
294 l_rec g_rec_type;
295 --
296 Begin
297 --
298 -- Convert arguments into local l_rec structure.
299 --
300 l_rec.entity_group_comp_id := p_entity_group_comp_id;
301 l_rec.entity_group_id := p_entity_group_id;
302 l_rec.entity_id := p_entity_id;
303 l_rec.entity_type := p_entity_type;
304 l_rec.attribute_category := p_attribute_category;
305 l_rec.attribute1 := p_attribute1;
306 l_rec.attribute2 := p_attribute2;
307 l_rec.attribute3 := p_attribute3;
308 l_rec.attribute4 := p_attribute4;
309 l_rec.attribute5 := p_attribute5;
310 l_rec.attribute6 := p_attribute6;
311 l_rec.attribute7 := p_attribute7;
312 l_rec.attribute8 := p_attribute8;
313 l_rec.attribute9 := p_attribute9;
314 l_rec.attribute10 := p_attribute10;
315 l_rec.attribute11 := p_attribute11;
316 l_rec.attribute12 := p_attribute12;
317 l_rec.attribute13 := p_attribute13;
318 l_rec.attribute14 := p_attribute14;
319 l_rec.attribute15 := p_attribute15;
320 l_rec.attribute16 := p_attribute16;
321 l_rec.attribute17 := p_attribute17;
322 l_rec.attribute18 := p_attribute18;
323 l_rec.attribute19 := p_attribute19;
324 l_rec.attribute20 := p_attribute20;
325 l_rec.attribute21 := p_attribute21;
326 l_rec.attribute22 := p_attribute22;
327 l_rec.attribute23 := p_attribute23;
328 l_rec.attribute24 := p_attribute24;
329 l_rec.attribute25 := p_attribute25;
330 l_rec.attribute26 := p_attribute26;
331 l_rec.attribute27 := p_attribute27;
332 l_rec.attribute28 := p_attribute28;
333 l_rec.attribute29 := p_attribute29;
334 l_rec.attribute30 := p_attribute30;
335 l_rec.object_version_number := p_object_version_number;
336 --
337 -- Return the plsql record structure.
338 --
339 Return(l_rec);
340 --
341 End convert_args;
342 --
343 end hxc_egc_shd;