[Home] [Help]
PACKAGE BODY: APPS.BEN_XDF_SHD
Source
1 Package Body ben_xdf_shd as
2 /* $Header: bexdfrhi.pkb 120.6 2006/07/10 21:53:55 tjesumic ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' ben_xdf_shd.'; -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |------------------------< return_api_dml_status >-------------------------|
12 -- ----------------------------------------------------------------------------
13 Function return_api_dml_status Return Boolean Is
14 --
15 l_proc varchar2(72) := g_package||'return_api_dml_status';
16 --
17 Begin
18 hr_utility.set_location('Entering:'||l_proc, 5);
19 --
20 Return (nvl(g_api_dml, false));
21 --
22 hr_utility.set_location(' Leaving:'||l_proc, 10);
23 End return_api_dml_status;
24 --
25 -- ----------------------------------------------------------------------------
26 -- |---------------------------< constraint_error >---------------------------|
27 -- ----------------------------------------------------------------------------
28 Procedure constraint_error
29 (p_constraint_name in all_constraints.constraint_name%TYPE) Is
30 --
31 l_proc varchar2(72) := g_package||'constraint_error';
32 --
33 Begin
34 hr_utility.set_location('Entering:'||l_proc, 5);
35 --
36 If (p_constraint_name = 'BEN_EXT_DFN_FK1') Then
37 hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
38 hr_utility.set_message_token('PROCEDURE', l_proc);
39 hr_utility.set_message_token('STEP','5');
40 hr_utility.raise_error;
41 ElsIf (p_constraint_name = 'BEN_EXT_DFN_FK2') Then
42 hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
43 hr_utility.set_message_token('PROCEDURE', l_proc);
44 hr_utility.set_message_token('STEP','10');
45 hr_utility.raise_error;
46 ElsIf (p_constraint_name = 'BEN_EXT_DFN_PK') Then
47 hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
48 hr_utility.set_message_token('PROCEDURE', l_proc);
49 hr_utility.set_message_token('STEP','15');
50 hr_utility.raise_error;
51 Else
52 hr_utility.set_message(801, 'HR_7877_API_INVALID_CONSTRAINT');
53 hr_utility.set_message_token('PROCEDURE', l_proc);
54 hr_utility.set_message_token('CONSTRAINT_NAME', p_constraint_name);
55 hr_utility.raise_error;
56 End If;
57 --
58 hr_utility.set_location(' Leaving:'||l_proc, 10);
59 End constraint_error;
60 --
61 -- ----------------------------------------------------------------------------
62 -- |-----------------------------< api_updating >-----------------------------|
63 -- ----------------------------------------------------------------------------
64 Function api_updating
65 (
66 p_ext_dfn_id in number,
67 p_object_version_number in number
68 ) Return Boolean Is
69 --
70 --
71 -- Cursor selects the 'current' row from the HR Schema
72 --
73 Cursor C_Sel1 is
74 select
75 ext_dfn_id,
76 name,
77 xml_tag_name,
78 xdo_template_id,
79 data_typ_cd,
80 ext_typ_cd,
81 output_name,
82 output_type,
83 apnd_rqst_id_flag,
84 prmy_sort_cd,
85 scnd_sort_cd,
86 strt_dt,
87 end_dt,
88 ext_crit_prfl_id,
89 ext_file_id,
90 business_group_id,
91 legislation_code,
92 xdf_attribute_category,
93 xdf_attribute1,
94 xdf_attribute2,
95 xdf_attribute3,
96 xdf_attribute4,
97 xdf_attribute5,
98 xdf_attribute6,
99 xdf_attribute7,
100 xdf_attribute8,
101 xdf_attribute9,
102 xdf_attribute10,
103 xdf_attribute11,
104 xdf_attribute12,
105 xdf_attribute13,
106 xdf_attribute14,
107 xdf_attribute15,
108 xdf_attribute16,
109 xdf_attribute17,
110 xdf_attribute18,
111 xdf_attribute19,
112 xdf_attribute20,
113 xdf_attribute21,
114 xdf_attribute22,
115 xdf_attribute23,
116 xdf_attribute24,
117 xdf_attribute25,
118 xdf_attribute26,
119 xdf_attribute27,
120 xdf_attribute28,
121 xdf_attribute29,
122 xdf_attribute30,
123 last_update_date,
124 creation_date,
125 last_updated_by,
126 last_update_login,
127 created_by ,
128 object_version_number,
129 drctry_name,
130 kickoff_wrt_prc_flag,
131 upd_cm_sent_dt_flag,
132 spcl_hndl_flag,
133 ext_global_flag,
134 cm_display_flag,
135 use_eff_dt_for_chgs_flag,
136 ext_post_prcs_rl
137 from ben_ext_dfn
138 where ext_dfn_id = p_ext_dfn_id;
139 --
140 l_proc varchar2(72) := g_package||'api_updating';
141 l_fct_ret boolean;
142 --
143 Begin
144 hr_utility.set_location('Entering:'||l_proc, 5);
145 --
146 If (
147 p_ext_dfn_id is null and
148 p_object_version_number is null
149 ) Then
150 --
151 -- One of the primary key arguments is null therefore we must
152 -- set the returning function value to false
153 --
154 l_fct_ret := false;
155 Else
156 If (
157 p_ext_dfn_id = g_old_rec.ext_dfn_id and
158 p_object_version_number = g_old_rec.object_version_number
159 ) Then
160 hr_utility.set_location(l_proc, 10);
161 --
162 -- The g_old_rec is current therefore we must
163 -- set the returning function to true
164 --
165 l_fct_ret := true;
166 Else
167 --
168 -- Select the current row into g_old_rec
169 --
170 Open C_Sel1;
171 Fetch C_Sel1 Into g_old_rec;
172 If C_Sel1%notfound Then
173 Close C_Sel1;
174 --
175 -- The primary key is invalid therefore we must error
176 --
177 hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
178 hr_utility.raise_error;
179 End If;
180 Close C_Sel1;
181 If (p_object_version_number <> g_old_rec.object_version_number) Then
182 hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
183 hr_utility.raise_error;
184 End If;
185 hr_utility.set_location(l_proc, 15);
186 l_fct_ret := true;
187 End If;
188 End If;
189 hr_utility.set_location(' Leaving:'||l_proc, 20);
190 Return (l_fct_ret);
191 --
192 End api_updating;
193 --
194 -- ----------------------------------------------------------------------------
195 -- |---------------------------------< lck >----------------------------------|
196 -- ----------------------------------------------------------------------------
197 Procedure lck
198 (
199 p_ext_dfn_id in number,
200 p_object_version_number in number
201 ) is
202 --
203 -- Cursor selects the 'current' row from the HR Schema
204 --
205 Cursor C_Sel1 is
206 select ext_dfn_id,
207 name,
208 xml_tag_name,
209 xdo_template_id,
210 data_typ_cd,
211 ext_typ_cd,
212 output_name,
213 output_type,
214 apnd_rqst_id_flag,
215 prmy_sort_cd,
216 scnd_sort_cd,
217 strt_dt,
218 end_dt,
219 ext_crit_prfl_id,
220 ext_file_id,
221 business_group_id,
222 legislation_code,
223 xdf_attribute_category,
224 xdf_attribute1,
225 xdf_attribute2,
226 xdf_attribute3,
227 xdf_attribute4,
228 xdf_attribute5,
229 xdf_attribute6,
230 xdf_attribute7,
231 xdf_attribute8,
232 xdf_attribute9,
233 xdf_attribute10,
234 xdf_attribute11,
235 xdf_attribute12,
236 xdf_attribute13,
237 xdf_attribute14,
238 xdf_attribute15,
239 xdf_attribute16,
240 xdf_attribute17,
241 xdf_attribute18,
242 xdf_attribute19,
243 xdf_attribute20,
244 xdf_attribute21,
245 xdf_attribute22,
246 xdf_attribute23,
247 xdf_attribute24,
248 xdf_attribute25,
249 xdf_attribute26,
250 xdf_attribute27,
251 xdf_attribute28,
252 xdf_attribute29,
253 xdf_attribute30,
254 last_update_date,
255 creation_date,
256 last_updated_by,
257 last_update_login,
258 created_by ,
259 object_version_number,
260 drctry_name,
261 kickoff_wrt_prc_flag,
262 upd_cm_sent_dt_flag,
263 spcl_hndl_flag,
264 ext_global_flag,
265 cm_display_flag,
266 use_eff_dt_for_chgs_flag,
267 ext_post_prcs_rl
268 from ben_ext_dfn
269 where ext_dfn_id = p_ext_dfn_id
270 for update nowait;
271 --
272 l_proc varchar2(72) := g_package||'lck';
273 --
274 Begin
275 hr_utility.set_location('Entering:'||l_proc, 5);
276 --
277 -- Add any mandatory argument checking here:
278 -- Example:
279 -- hr_api.mandatory_arg_error
280 -- (p_api_name => l_proc,
281 -- p_argument => 'object_version_number',
282 -- p_argument_value => p_object_version_number);
283 --
284 Open C_Sel1;
285 Fetch C_Sel1 Into g_old_rec;
286 If C_Sel1%notfound then
287 Close C_Sel1;
288 --
289 -- The primary key is invalid therefore we must error
290 --
291 hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
292 hr_utility.raise_error;
293 End If;
294 Close C_Sel1;
295 If (p_object_version_number <> g_old_rec.object_version_number) Then
296 hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
297 hr_utility.raise_error;
298 End If;
299 --
300 hr_utility.set_location(' Leaving:'||l_proc, 10);
301 --
302 -- We need to trap the ORA LOCK exception
303 --
304 Exception
305 When HR_Api.Object_Locked then
306 --
307 -- The object is locked therefore we need to supply a meaningful
308 -- error message.
309 --
310 hr_utility.set_message(801, 'HR_7165_OBJECT_LOCKED');
311 hr_utility.set_message_token('TABLE_NAME', 'ben_ext_dfn');
312 hr_utility.raise_error;
313 End lck;
314 --
315 -- ----------------------------------------------------------------------------
316 -- |-----------------------------< convert_args >-----------------------------|
317 -- ----------------------------------------------------------------------------
318 Function convert_args
319 (
320 p_ext_dfn_id in number,
321 p_name in varchar2,
322 p_xml_tag_name in varchar2,
323 p_xdo_template_id in number,
324 p_data_typ_cd in varchar2,
325 p_ext_typ_cd in varchar2,
326 p_output_name in varchar2,
327 p_output_type in varchar2,
328 p_apnd_rqst_id_flag in varchar2,
329 p_prmy_sort_cd in varchar2,
330 p_scnd_sort_cd in varchar2,
331 p_strt_dt in varchar2,
332 p_end_dt in varchar2,
333 p_ext_crit_prfl_id in number,
334 p_ext_file_id in number,
335 p_business_group_id in number,
336 p_legislation_code in varchar2,
337 p_xdf_attribute_category in varchar2,
338 p_xdf_attribute1 in varchar2,
339 p_xdf_attribute2 in varchar2,
340 p_xdf_attribute3 in varchar2,
341 p_xdf_attribute4 in varchar2,
342 p_xdf_attribute5 in varchar2,
343 p_xdf_attribute6 in varchar2,
344 p_xdf_attribute7 in varchar2,
345 p_xdf_attribute8 in varchar2,
346 p_xdf_attribute9 in varchar2,
347 p_xdf_attribute10 in varchar2,
348 p_xdf_attribute11 in varchar2,
349 p_xdf_attribute12 in varchar2,
350 p_xdf_attribute13 in varchar2,
351 p_xdf_attribute14 in varchar2,
352 p_xdf_attribute15 in varchar2,
353 p_xdf_attribute16 in varchar2,
354 p_xdf_attribute17 in varchar2,
355 p_xdf_attribute18 in varchar2,
356 p_xdf_attribute19 in varchar2,
357 p_xdf_attribute20 in varchar2,
358 p_xdf_attribute21 in varchar2,
359 p_xdf_attribute22 in varchar2,
360 p_xdf_attribute23 in varchar2,
361 p_xdf_attribute24 in varchar2,
362 p_xdf_attribute25 in varchar2,
363 p_xdf_attribute26 in varchar2,
364 p_xdf_attribute27 in varchar2,
365 p_xdf_attribute28 in varchar2,
366 p_xdf_attribute29 in varchar2,
367 p_xdf_attribute30 in varchar2,
368 p_last_update_date in date,
369 p_creation_date in date,
370 p_last_updated_by in number,
371 p_last_update_login in number,
372 p_created_by in number,
373 p_object_version_number in number,
374 p_drctry_name in varchar2,
375 p_kickoff_wrt_prc_flag in varchar2,
376 p_upd_cm_sent_dt_flag in varchar2,
377 p_spcl_hndl_flag in varchar2,
378 p_ext_global_flag in varchar2,
379 p_cm_display_flag in varchar2,
380 p_use_eff_dt_for_chgs_flag in varchar2,
381 p_ext_post_prcs_rl in number
382 )
383 Return g_rec_type is
384 --
385 l_rec g_rec_type;
386 l_proc varchar2(72) := g_package||'convert_args';
387 --
388 Begin
389 --
390 hr_utility.set_location('Entering:'||l_proc, 5);
391 --
392 -- Convert arguments into local l_rec structure.
393 --
394 l_rec.ext_dfn_id := p_ext_dfn_id;
395 l_rec.name := p_name;
396 l_rec.xml_tag_name := p_xml_tag_name;
397 l_rec.xdo_template_id := p_xdo_template_id;
398 l_rec.data_typ_cd := p_data_typ_cd;
399 l_rec.ext_typ_cd := p_ext_typ_cd;
400 l_rec.output_name := p_output_name;
401 l_rec.output_type := p_output_type;
402 l_rec.apnd_rqst_id_flag := p_apnd_rqst_id_flag;
403 l_rec.prmy_sort_cd := p_prmy_sort_cd;
404 l_rec.scnd_sort_cd := p_scnd_sort_cd;
405 l_rec.strt_dt := p_strt_dt;
406 l_rec.end_dt := p_end_dt;
407 l_rec.ext_crit_prfl_id := p_ext_crit_prfl_id;
408 l_rec.ext_file_id := p_ext_file_id;
409 l_rec.business_group_id := p_business_group_id;
410 l_rec.legislation_code := p_legislation_code;
411 l_rec.xdf_attribute_category := p_xdf_attribute_category;
412 l_rec.xdf_attribute1 := p_xdf_attribute1;
413 l_rec.xdf_attribute2 := p_xdf_attribute2;
414 l_rec.xdf_attribute3 := p_xdf_attribute3;
415 l_rec.xdf_attribute4 := p_xdf_attribute4;
416 l_rec.xdf_attribute5 := p_xdf_attribute5;
417 l_rec.xdf_attribute6 := p_xdf_attribute6;
418 l_rec.xdf_attribute7 := p_xdf_attribute7;
419 l_rec.xdf_attribute8 := p_xdf_attribute8;
420 l_rec.xdf_attribute9 := p_xdf_attribute9;
421 l_rec.xdf_attribute10 := p_xdf_attribute10;
422 l_rec.xdf_attribute11 := p_xdf_attribute11;
423 l_rec.xdf_attribute12 := p_xdf_attribute12;
424 l_rec.xdf_attribute13 := p_xdf_attribute13;
425 l_rec.xdf_attribute14 := p_xdf_attribute14;
426 l_rec.xdf_attribute15 := p_xdf_attribute15;
427 l_rec.xdf_attribute16 := p_xdf_attribute16;
428 l_rec.xdf_attribute17 := p_xdf_attribute17;
429 l_rec.xdf_attribute18 := p_xdf_attribute18;
430 l_rec.xdf_attribute19 := p_xdf_attribute19;
431 l_rec.xdf_attribute20 := p_xdf_attribute20;
432 l_rec.xdf_attribute21 := p_xdf_attribute21;
433 l_rec.xdf_attribute22 := p_xdf_attribute22;
434 l_rec.xdf_attribute23 := p_xdf_attribute23;
435 l_rec.xdf_attribute24 := p_xdf_attribute24;
436 l_rec.xdf_attribute25 := p_xdf_attribute25;
437 l_rec.xdf_attribute26 := p_xdf_attribute26;
438 l_rec.xdf_attribute27 := p_xdf_attribute27;
439 l_rec.xdf_attribute28 := p_xdf_attribute28;
440 l_rec.xdf_attribute29 := p_xdf_attribute29;
441 l_rec.xdf_attribute30 := p_xdf_attribute30;
442 l_rec.last_update_date := p_last_update_date;
443 l_rec.creation_date := p_creation_date;
444 l_rec.last_updated_by := p_last_updated_by;
445 l_rec.last_update_login := p_last_update_login;
446 l_rec.created_by := p_created_by;
447 l_rec.object_version_number := p_object_version_number;
448 l_rec.drctry_name := p_drctry_name;
449 l_rec.kickoff_wrt_prc_flag := p_kickoff_wrt_prc_flag;
450 l_rec.upd_cm_sent_dt_flag := p_upd_cm_sent_dt_flag;
451 l_rec.spcl_hndl_flag := p_spcl_hndl_flag;
452 l_rec.ext_global_flag := p_ext_global_flag;
453 l_rec.cm_display_flag := p_cm_display_flag;
454 l_rec.use_eff_dt_for_chgs_flag := p_use_eff_dt_for_chgs_flag;
455 l_rec.ext_post_prcs_rl := p_ext_post_prcs_rl;
456 --
457 -- Return the plsql record structure.
458 --
459 hr_utility.set_location(' Leaving:'||l_proc, 10);
460 Return(l_rec);
461 --
462 End convert_args;
463 --
464 end ben_xdf_shd;