[Home] [Help]
Skip to content
PACKAGE BODY: APPS.BEN_DPNT_EGD_SHD
Source
4 --
1 Package Body ben_dpnt_egd_shd as
2 /* $Header: beecdrhi.pkb 120.1 2010/05/17 12:10:04 sgnanama noship $ */
3
5 -- ----------------------------------------------------------------------------
6 -- | Private Global Definitions |
7 -- ----------------------------------------------------------------------------
8 --
9 g_package varchar2(33) := ' ben_dpnt_egd_shd.'; -- Global package name
10 --
11 -- ----------------------------------------------------------------------------
12 -- |------------------------< return_api_dml_status >-------------------------|
13 -- ----------------------------------------------------------------------------
14 Function return_api_dml_status Return Boolean Is
15 --
16 l_proc varchar2(72) := g_package||'return_api_dml_status';
17 --
18 Begin
19 hr_utility.set_location('Entering:'||l_proc, 5);
20 --
21 Return (nvl(g_api_dml, false));
22 --
23 hr_utility.set_location(' Leaving:'||l_proc, 10);
24 End return_api_dml_status;
25 --
26 -- ----------------------------------------------------------------------------
27 -- |---------------------------< constraint_error >---------------------------|
28 -- ----------------------------------------------------------------------------
29 Procedure constraint_error
30 (p_constraint_name in all_constraints.constraint_name%TYPE) Is
31 --
32 l_proc varchar2(72) := g_package||'constraint_error';
33 --
34 Begin
35 hr_utility.set_location('Entering:'||l_proc, 5);
36 --
37 If (p_constraint_name = 'BEN_dpnt_eligy_criteria_FK1') Then
38 hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
39 hr_utility.set_message_token('PROCEDURE', l_proc);
40 hr_utility.set_message_token('STEP','5');
41 hr_utility.raise_error;
42 ElsIf (p_constraint_name = 'BEN_dpnt_eligy_criteria_PK') Then
43 hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
44 hr_utility.set_message_token('PROCEDURE', l_proc);
45 hr_utility.set_message_token('STEP','10');
46 hr_utility.raise_error;
47
48 Else
49 hr_utility.set_message(801, 'HR_7877_API_INVALID_CONSTRAINT');
50 hr_utility.set_message_token('PROCEDURE', l_proc);
51 hr_utility.set_message_token('CONSTRAINT_NAME', p_constraint_name);
52 hr_utility.raise_error;
53 End If;
54 --
55 hr_utility.set_location(' Leaving:'||l_proc, 10);
56 End constraint_error;
57 --
58 -- ----------------------------------------------------------------------------
59 -- |-----------------------------< api_updating >-----------------------------|
60 -- ----------------------------------------------------------------------------
61 Function api_updating
62 (
63 p_eligy_criteria_dpnt_id in number,
64 p_object_version_number in number
65 ) Return Boolean Is
66 --
67 --
68 -- Cursor selects the 'current' row from the HR Schema
69 --
70 Cursor C_Sel1 is
71 select
72 eligy_criteria_dpnt_id,
73 name,
74 short_code,
75 description,
76 criteria_type,
77 crit_col1_val_type_cd,
78 crit_col1_datatype,
79 col1_lookup_type,
80 col1_value_set_id,
81 access_table_name1,
82 access_column_name1,
83 time_entry_access_table_name1,
84 time_entry_access_col_name1,
85 crit_col2_val_type_cd,
86 crit_col2_datatype,
87 col2_lookup_type,
88 col2_value_set_id,
89 access_table_name2,
90 access_column_name2,
91 time_entry_access_table_name2,
92 time_entry_access_col_name2,
93 allow_range_validation_flag,
94 user_defined_flag,
95 business_group_id,
96 egd_attribute_category,
97 egd_attribute1,
98 egd_attribute2,
99 egd_attribute3,
100 egd_attribute4,
101 egd_attribute5,
102 egd_attribute6,
103 egd_attribute7,
104 egd_attribute8,
105 egd_attribute9,
106 egd_attribute10,
107 egd_attribute11,
108 egd_attribute12,
109 egd_attribute13,
110 egd_attribute14,
111 egd_attribute15,
112 egd_attribute16,
113 egd_attribute17,
114 egd_attribute18,
115 egd_attribute19,
116 egd_attribute20,
117 egd_attribute21,
118 egd_attribute22,
119 egd_attribute23,
120 egd_attribute24,
121 egd_attribute25,
122 egd_attribute26,
123 egd_attribute27,
124 egd_attribute28,
125 egd_attribute29,
126 egd_attribute30,
127 object_version_number,
128 allow_range_validation_flag2,
129 time_access_calc_rule1,
130 time_access_calc_rule2
131 from ben_eligy_criteria_dpnt
132 where eligy_criteria_dpnt_id = p_eligy_criteria_dpnt_id;
133 --
134 l_proc varchar2(72) := g_package||'api_updating';
135 l_fct_ret boolean;
136 --
137 Begin
138 hr_utility.set_location('Entering:'||l_proc, 5);
139 --
140 If (
141 p_eligy_criteria_dpnt_id is null and
142 p_object_version_number is null
143 ) Then
144 --
145 -- One of the primary key arguments is null therefore we must
146 -- set the returning function value to false
147 --
148 l_fct_ret := false;
149 Else
150 If (
151 p_eligy_criteria_dpnt_id = g_old_rec.eligy_criteria_dpnt_id and
152 p_object_version_number = g_old_rec.object_version_number
153 ) Then
154
155 --
156 -- The g_old_rec is current therefore we must
157 -- set the returning function to true
158 --
162 -- Select the current row into g_old_rec
159 l_fct_ret := true;
160 Else
161 --
163 --
164 Open C_Sel1;
165 Fetch C_Sel1 Into g_old_rec;
166 If C_Sel1%notfound Then
167 Close C_Sel1;
168 --
169 -- The primary key is invalid therefore we must error
170 --
171 hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
172 hr_utility.raise_error;
173 End If;
174 Close C_Sel1;
175 If (p_object_version_number <> g_old_rec.object_version_number) Then
176 hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
177 hr_utility.raise_error;
178 End If;
179
180 l_fct_ret := true;
181 End If;
182 End If;
183 hr_utility.set_location(' Leaving:'||l_proc, 20);
184 Return (l_fct_ret);
185 --
186 End api_updating;
187 --
188 -- ----------------------------------------------------------------------------
189 -- |---------------------------------< lck >----------------------------------|
190 -- ----------------------------------------------------------------------------
191 Procedure lck
192 (
193 p_eligy_criteria_dpnt_id in number,
197 -- Cursor selects the 'current' row from the HR Schema
194 p_object_version_number in number
195 ) is
196 --
198 --
199 Cursor C_Sel1 is
200 select
201 eligy_criteria_dpnt_id,
202 name,
203 short_code,
204 description,
205 criteria_type,
206 crit_col1_val_type_cd,
207 crit_col1_datatype,
208 col1_lookup_type,
209 col1_value_set_id,
210 access_table_name1,
211 access_column_name1,
212 time_entry_access_table_name1,
213 time_entry_access_col_name1,
214 crit_col2_val_type_cd,
215 crit_col2_datatype,
216 col2_lookup_type,
217 col2_value_set_id,
218 access_table_name2,
219 access_column_name2,
220 time_entry_access_table_name2,
221 time_entry_access_col_name2,
222 allow_range_validation_flag,
223 user_defined_flag,
224 business_group_id,
225 egd_attribute_category,
226 egd_attribute1,
227 egd_attribute2,
228 egd_attribute3,
229 egd_attribute4,
230 egd_attribute5,
231 egd_attribute6,
232 egd_attribute7,
233 egd_attribute8,
234 egd_attribute9,
235 egd_attribute10,
236 egd_attribute11,
237 egd_attribute12,
238 egd_attribute13,
239 egd_attribute14,
240 egd_attribute15,
241 egd_attribute16,
242 egd_attribute17,
243 egd_attribute18,
244 egd_attribute19,
245 egd_attribute20,
246 egd_attribute21,
247 egd_attribute22,
248 egd_attribute23,
249 egd_attribute24,
250 egd_attribute25,
251 egd_attribute26,
252 egd_attribute27,
253 egd_attribute28,
254 egd_attribute29,
255 egd_attribute30,
256 object_version_number,
257 allow_range_validation_flag2,
258 time_access_calc_rule1,
259 time_access_calc_rule2
260 from ben_eligy_criteria_dpnt
261 where eligy_criteria_dpnt_id = p_eligy_criteria_dpnt_id
262 for update nowait;
263 --
264 l_proc varchar2(72) := g_package||'lck';
265 --
266 Begin
267 hr_utility.set_location('Entering:'||l_proc, 5);
268 --
269
270 -- Add any mandatory argument checking here:
271 -- Example:
272 hr_api.mandatory_arg_error
273 (p_api_name => l_proc,
274 p_argument => 'object_version_number',
275 p_argument_value => p_object_version_number);
279 Fetch C_Sel1 Into g_old_rec;
276 --
277
278 Open C_Sel1;
280 If C_Sel1%notfound then
281 Close C_Sel1;
282 --
283 -- The primary key is invalid therefore we must error
284 --
285
286 hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
287 hr_utility.raise_error;
288 End If;
289 Close C_Sel1;
290
291 If (p_object_version_number <> g_old_rec.object_version_number) Then
292 hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
293 hr_utility.raise_error;
294 End If;
295 --
296 hr_utility.set_location(' Leaving:'||l_proc, 10);
297 --
298 -- We need to trap the ORA LOCK exception
299 --
300 Exception
301 When HR_Api.Object_Locked then
302 --
303 -- The object is locked therefore we need to supply a meaningful
304 -- error message.
305 --
306 hr_utility.set_message(801, 'HR_7165_OBJECT_LOCKED');
307 hr_utility.set_message_token('TABLE_NAME', 'ben_eligy_criteria_dpnt');
308 hr_utility.raise_error;
309 End lck;
310 --
311 -- ----------------------------------------------------------------------------
312 -- |-----------------------------< convert_args >-----------------------------|
313 -- ----------------------------------------------------------------------------
314 Function convert_args
315 (
316 p_eligy_criteria_dpnt_id in number,
317 p_name in varchar2,
318 p_short_code in varchar2,
319 p_description in varchar2,
320 p_criteria_type in varchar2,
321 p_crit_col1_val_type_cd in varchar2,
322 p_crit_col1_datatype in varchar2,
323 p_col1_lookup_type in varchar2,
324 p_col1_value_set_id in number,
325 p_access_table_name1 in varchar2,
326 p_access_column_name1 in varchar2,
327 p_time_entry_access_tab_nam1 in varchar2,
328 p_time_entry_access_col_nam1 in varchar2,
329 p_crit_col2_val_type_cd in varchar2,
330 p_crit_col2_datatype in varchar2,
331 p_col2_lookup_type in varchar2,
332 p_col2_value_set_id in number,
333 p_access_table_name2 in varchar2,
334 p_access_column_name2 in varchar2,
335 p_time_entry_access_tab_nam2 in varchar2,
336 p_time_entry_access_col_nam2 in varchar2,
337 p_allow_range_validation_flg in varchar2,
338 p_user_defined_flag in varchar2,
339 p_business_group_id in number,
340 p_egd_attribute_category in varchar2,
341 p_egd_attribute1 in varchar2,
342 p_egd_attribute2 in varchar2,
343 p_egd_attribute3 in varchar2,
344 p_egd_attribute4 in varchar2,
345 p_egd_attribute5 in varchar2,
346 p_egd_attribute6 in varchar2,
347 p_egd_attribute7 in varchar2,
348 p_egd_attribute8 in varchar2,
349 p_egd_attribute9 in varchar2,
350 p_egd_attribute10 in varchar2,
351 p_egd_attribute11 in varchar2,
352 p_egd_attribute12 in varchar2,
353 p_egd_attribute13 in varchar2,
354 p_egd_attribute14 in varchar2,
355 p_egd_attribute15 in varchar2,
356 p_egd_attribute16 in varchar2,
357 p_egd_attribute17 in varchar2,
358 p_egd_attribute18 in varchar2,
359 p_egd_attribute19 in varchar2,
360 p_egd_attribute20 in varchar2,
361 p_egd_attribute21 in varchar2,
362 p_egd_attribute22 in varchar2,
363 p_egd_attribute23 in varchar2,
364 p_egd_attribute24 in varchar2,
365 p_egd_attribute25 in varchar2,
366 p_egd_attribute26 in varchar2,
367 p_egd_attribute27 in varchar2,
368 p_egd_attribute28 in varchar2,
369 p_egd_attribute29 in varchar2,
370 p_egd_attribute30 in varchar2,
371 p_object_version_number in number ,
372 p_allow_range_validation_flag2 in varchar2,
376 Return g_rec_type is
373 p_time_access_calc_rule1 in number,
374 p_time_access_calc_rule2 in number
375 )
377 --
378 l_rec g_rec_type;
379 l_proc varchar2(72) := g_package||'convert_args';
380 --
381 Begin
382 --
383 hr_utility.set_location('Entering:'||l_proc, 5);
384 --
385 -- Convert arguments into local l_rec structure.
386 --
387 l_rec.eligy_criteria_dpnt_id := p_eligy_criteria_dpnt_id;
388 l_rec.name := p_name;
389 l_rec.short_code := p_short_code;
390 l_rec.description := p_description;
391 l_rec.criteria_type := p_criteria_type;
392 l_rec.crit_col1_val_type_cd := p_crit_col1_val_type_cd;
393 l_rec.crit_col1_datatype := p_crit_col1_datatype;
394 l_rec.col1_lookup_type := p_col1_lookup_type;
395 l_rec.col1_value_set_id := p_col1_value_set_id;
396 l_rec.access_table_name1 := p_access_table_name1;
397 l_rec.access_column_name1 := p_access_column_name1;
398 l_rec.time_entry_access_tab_nam1 := p_time_entry_access_tab_nam1;
399 l_rec.time_entry_access_col_nam1 := p_time_entry_access_col_nam1;
400 l_rec.crit_col2_val_type_cd := p_crit_col2_val_type_cd;
401 l_rec.crit_col2_datatype := p_crit_col2_datatype;
402 l_rec.col2_lookup_type := p_col2_lookup_type;
403 l_rec.col2_value_set_id := p_col2_value_set_id;
404 l_rec.access_table_name2 := p_access_table_name2;
405 l_rec.access_column_name2 := p_access_column_name2;
406 l_rec.time_entry_access_tab_nam2 := p_time_entry_access_tab_nam2;
407 l_rec.time_entry_access_col_nam2 := p_time_entry_access_col_nam2;
408 l_rec.allow_range_validation_flg := p_allow_range_validation_flg;
409 l_rec.user_defined_flag := p_user_defined_flag;
410 l_rec.business_group_id := p_business_group_id;
411 l_rec.egd_attribute_category := p_egd_attribute_category;
412 l_rec.egd_attribute1 := p_egd_attribute1;
413 l_rec.egd_attribute2 := p_egd_attribute2;
414 l_rec.egd_attribute3 := p_egd_attribute3;
415 l_rec.egd_attribute4 := p_egd_attribute4;
416 l_rec.egd_attribute5 := p_egd_attribute5;
417 l_rec.egd_attribute6 := p_egd_attribute6;
418 l_rec.egd_attribute7 := p_egd_attribute7;
419 l_rec.egd_attribute8 := p_egd_attribute8;
420 l_rec.egd_attribute9 := p_egd_attribute9;
421 l_rec.egd_attribute10 := p_egd_attribute10;
422 l_rec.egd_attribute11 := p_egd_attribute11;
423 l_rec.egd_attribute12 := p_egd_attribute12;
424 l_rec.egd_attribute13 := p_egd_attribute13;
425 l_rec.egd_attribute14 := p_egd_attribute14;
426 l_rec.egd_attribute15 := p_egd_attribute15;
427 l_rec.egd_attribute16 := p_egd_attribute16;
428 l_rec.egd_attribute17 := p_egd_attribute17;
429 l_rec.egd_attribute18 := p_egd_attribute18;
430 l_rec.egd_attribute19 := p_egd_attribute19;
431 l_rec.egd_attribute20 := p_egd_attribute20;
432 l_rec.egd_attribute21 := p_egd_attribute21;
433 l_rec.egd_attribute22 := p_egd_attribute22;
434 l_rec.egd_attribute23 := p_egd_attribute23;
435 l_rec.egd_attribute24 := p_egd_attribute24;
436 l_rec.egd_attribute25 := p_egd_attribute25;
437 l_rec.egd_attribute26 := p_egd_attribute26;
438 l_rec.egd_attribute27 := p_egd_attribute27;
439 l_rec.egd_attribute28 := p_egd_attribute28;
440 l_rec.egd_attribute29 := p_egd_attribute29;
441 l_rec.egd_attribute30 := p_egd_attribute30;
442 l_rec.object_version_number := p_object_version_number;
443 l_rec.allow_range_validation_flag2 := p_allow_range_validation_flag2;
444 l_Rec.time_access_calc_rule1 := p_time_access_calc_rule1;
445 l_rec.time_access_calc_rule2 := p_time_access_calc_rule2;
446
447 --
448 -- Return the plsql record structure.
449 --
450 hr_utility.set_location(' Leaving:'||l_proc, 10);
451 Return(l_rec);
452 --
453 End convert_args;
454 --
455 end ben_dpnt_egd_shd;
456