[Home] [Help]
PACKAGE BODY: APPS.BEN_PSQ_SHD
Source
1 Package Body ben_psq_shd as
2 /* $Header: bepsqrhi.pkb 120.0 2005/05/28 11:20:15 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' ben_psq_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_PYMT_SCHED_PY_FREQ_PK') Then
37 fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
38 fnd_message.set_token('PROCEDURE', l_proc);
39 fnd_message.set_token('STEP','5');
40 fnd_message.raise_error;
41 Else
42 fnd_message.set_name('PAY', 'HR_7877_API_INVALID_CONSTRAINT');
43 fnd_message.set_token('PROCEDURE', l_proc);
44 fnd_message.set_token('CONSTRAINT_NAME', p_constraint_name);
45 fnd_message.raise_error;
46 End If;
47 --
48 hr_utility.set_location(' Leaving:'||l_proc, 10);
49 End constraint_error;
50 --
51 -- ----------------------------------------------------------------------------
52 -- |-----------------------------< api_updating >-----------------------------|
53 -- ----------------------------------------------------------------------------
54 Function api_updating
55 (
56 p_pymt_sched_py_freq_id in number,
57 p_object_version_number in number
58 ) Return Boolean Is
59 --
60 --
61 -- Cursor selects the 'current' row from the HR Schema
62 --
63 Cursor C_Sel1 is
64 select
65 pymt_sched_py_freq_id,
66 py_freq_cd,
67 dflt_flag,
68 business_group_id,
69 acty_rt_pymt_sched_id,
70 psq_attribute_category,
71 psq_attribute1,
72 psq_attribute2,
73 psq_attribute3,
74 psq_attribute4,
75 psq_attribute5,
76 psq_attribute6,
77 psq_attribute7,
78 psq_attribute8,
79 psq_attribute9,
80 psq_attribute10,
81 psq_attribute11,
82 psq_attribute12,
83 psq_attribute13,
84 psq_attribute14,
85 psq_attribute15,
86 psq_attribute16,
87 psq_attribute17,
88 psq_attribute18,
89 psq_attribute19,
90 psq_attribute20,
91 psq_attribute21,
92 psq_attribute22,
93 psq_attribute23,
94 psq_attribute24,
95 psq_attribute25,
96 psq_attribute26,
97 psq_attribute27,
101 object_version_number
98 psq_attribute28,
99 psq_attribute29,
100 psq_attribute30,
102 from ben_pymt_sched_py_freq
103 where pymt_sched_py_freq_id = p_pymt_sched_py_freq_id;
104 --
105 l_proc varchar2(72) := g_package||'api_updating';
106 l_fct_ret boolean;
107 --
108 Begin
109 hr_utility.set_location('Entering:'||l_proc, 5);
110 --
111 If (
112 p_pymt_sched_py_freq_id is null and
113 p_object_version_number is null
114 ) Then
115 --
116 -- One of the primary key arguments is null therefore we must
117 -- set the returning function value to false
118 --
119 l_fct_ret := false;
120 Else
121 If (
122 p_pymt_sched_py_freq_id = g_old_rec.pymt_sched_py_freq_id and
123 p_object_version_number = g_old_rec.object_version_number
124 ) Then
125 hr_utility.set_location(l_proc, 10);
126 --
127 -- The g_old_rec is current therefore we must
128 -- set the returning function to true
129 --
130 l_fct_ret := true;
131 Else
132 --
133 -- Select the current row into g_old_rec
134 --
135 Open C_Sel1;
136 Fetch C_Sel1 Into g_old_rec;
137 If C_Sel1%notfound Then
138 Close C_Sel1;
139 --
140 -- The primary key is invalid therefore we must error
141 --
142 fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
143 fnd_message.raise_error;
144 End If;
145 Close C_Sel1;
146 If (p_object_version_number <> g_old_rec.object_version_number) Then
147 fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
148 fnd_message.raise_error;
149 End If;
150 hr_utility.set_location(l_proc, 15);
151 l_fct_ret := true;
152 End If;
153 End If;
154 hr_utility.set_location(' Leaving:'||l_proc, 20);
155 Return (l_fct_ret);
156 --
157 End api_updating;
158 --
159 -- ----------------------------------------------------------------------------
160 -- |---------------------------------< lck >----------------------------------|
161 -- ----------------------------------------------------------------------------
162 Procedure lck
163 (
164 p_pymt_sched_py_freq_id in number,
165 p_object_version_number in number
166 ) is
167 --
168 -- Cursor selects the 'current' row from the HR Schema
169 --
170 Cursor C_Sel1 is
171 select pymt_sched_py_freq_id,
172 py_freq_cd,
173 dflt_flag,
174 business_group_id,
175 acty_rt_pymt_sched_id,
176 psq_attribute_category,
177 psq_attribute1,
178 psq_attribute2,
179 psq_attribute3,
180 psq_attribute4,
181 psq_attribute5,
182 psq_attribute6,
183 psq_attribute7,
184 psq_attribute8,
185 psq_attribute9,
186 psq_attribute10,
187 psq_attribute11,
188 psq_attribute12,
189 psq_attribute13,
190 psq_attribute14,
191 psq_attribute15,
192 psq_attribute16,
193 psq_attribute17,
194 psq_attribute18,
195 psq_attribute19,
196 psq_attribute20,
197 psq_attribute21,
198 psq_attribute22,
199 psq_attribute23,
200 psq_attribute24,
201 psq_attribute25,
202 psq_attribute26,
203 psq_attribute27,
204 psq_attribute28,
205 psq_attribute29,
206 psq_attribute30,
207 object_version_number
208 from ben_pymt_sched_py_freq
209 where pymt_sched_py_freq_id = p_pymt_sched_py_freq_id
210 for update nowait;
211 --
212 l_proc varchar2(72) := g_package||'lck';
213 --
214 Begin
215 hr_utility.set_location('Entering:'||l_proc, 5);
216 --
217 -- Add any mandatory argument checking here:
218 -- Example:
219 -- hr_api.mandatory_arg_error
220 -- (p_api_name => l_proc,
221 -- p_argument => 'object_version_number',
222 -- p_argument_value => p_object_version_number);
223 --
224 Open C_Sel1;
225 Fetch C_Sel1 Into g_old_rec;
226 If C_Sel1%notfound then
227 Close C_Sel1;
228 --
229 -- The primary key is invalid therefore we must error
230 --
231 fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
232 fnd_message.raise_error;
233 End If;
234 Close C_Sel1;
235 If (p_object_version_number <> g_old_rec.object_version_number) Then
236 fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
237 fnd_message.raise_error;
238 End If;
239 --
240 hr_utility.set_location(' Leaving:'||l_proc, 10);
241 --
242 -- We need to trap the ORA LOCK exception
243 --
244 Exception
245 When HR_Api.Object_Locked then
246 --
247 -- The object is locked therefore we need to supply a meaningful
248 -- error message.
249 --
250 fnd_message.set_name('PAY', 'HR_7165_OBJECT_LOCKED');
251 fnd_message.set_token('TABLE_NAME', 'ben_pymt_sched_py_freq');
252 fnd_message.raise_error;
253 End lck;
254 --
255 -- ----------------------------------------------------------------------------
256 -- |-----------------------------< convert_args >-----------------------------|
257 -- ----------------------------------------------------------------------------
258 Function convert_args
259 (
260 p_pymt_sched_py_freq_id in number,
261 p_py_freq_cd in varchar2,
262 p_dflt_flag in varchar2,
263 p_business_group_id in number,
264 p_acty_rt_pymt_sched_id in number,
265 p_psq_attribute_category in varchar2,
266 p_psq_attribute1 in varchar2,
270 p_psq_attribute5 in varchar2,
267 p_psq_attribute2 in varchar2,
268 p_psq_attribute3 in varchar2,
269 p_psq_attribute4 in varchar2,
271 p_psq_attribute6 in varchar2,
272 p_psq_attribute7 in varchar2,
273 p_psq_attribute8 in varchar2,
274 p_psq_attribute9 in varchar2,
275 p_psq_attribute10 in varchar2,
276 p_psq_attribute11 in varchar2,
277 p_psq_attribute12 in varchar2,
278 p_psq_attribute13 in varchar2,
279 p_psq_attribute14 in varchar2,
280 p_psq_attribute15 in varchar2,
281 p_psq_attribute16 in varchar2,
282 p_psq_attribute17 in varchar2,
283 p_psq_attribute18 in varchar2,
284 p_psq_attribute19 in varchar2,
285 p_psq_attribute20 in varchar2,
286 p_psq_attribute21 in varchar2,
287 p_psq_attribute22 in varchar2,
288 p_psq_attribute23 in varchar2,
289 p_psq_attribute24 in varchar2,
290 p_psq_attribute25 in varchar2,
291 p_psq_attribute26 in varchar2,
292 p_psq_attribute27 in varchar2,
293 p_psq_attribute28 in varchar2,
294 p_psq_attribute29 in varchar2,
295 p_psq_attribute30 in varchar2,
296 p_object_version_number in number
297 )
298 Return g_rec_type is
299 --
300 l_rec g_rec_type;
301 l_proc varchar2(72) := g_package||'convert_args';
302 --
303 Begin
304 --
305 hr_utility.set_location('Entering:'||l_proc, 5);
306 --
307 -- Convert arguments into local l_rec structure.
308 --
309 l_rec.pymt_sched_py_freq_id := p_pymt_sched_py_freq_id;
310 l_rec.py_freq_cd := p_py_freq_cd;
311 l_rec.dflt_flag := p_dflt_flag;
312 l_rec.business_group_id := p_business_group_id;
313 l_rec.acty_rt_pymt_sched_id := p_acty_rt_pymt_sched_id;
314 l_rec.psq_attribute_category := p_psq_attribute_category;
315 l_rec.psq_attribute1 := p_psq_attribute1;
316 l_rec.psq_attribute2 := p_psq_attribute2;
317 l_rec.psq_attribute3 := p_psq_attribute3;
318 l_rec.psq_attribute4 := p_psq_attribute4;
319 l_rec.psq_attribute5 := p_psq_attribute5;
320 l_rec.psq_attribute6 := p_psq_attribute6;
321 l_rec.psq_attribute7 := p_psq_attribute7;
322 l_rec.psq_attribute8 := p_psq_attribute8;
323 l_rec.psq_attribute9 := p_psq_attribute9;
324 l_rec.psq_attribute10 := p_psq_attribute10;
325 l_rec.psq_attribute11 := p_psq_attribute11;
326 l_rec.psq_attribute12 := p_psq_attribute12;
327 l_rec.psq_attribute13 := p_psq_attribute13;
328 l_rec.psq_attribute14 := p_psq_attribute14;
329 l_rec.psq_attribute15 := p_psq_attribute15;
330 l_rec.psq_attribute16 := p_psq_attribute16;
331 l_rec.psq_attribute17 := p_psq_attribute17;
332 l_rec.psq_attribute18 := p_psq_attribute18;
333 l_rec.psq_attribute19 := p_psq_attribute19;
334 l_rec.psq_attribute20 := p_psq_attribute20;
335 l_rec.psq_attribute21 := p_psq_attribute21;
336 l_rec.psq_attribute22 := p_psq_attribute22;
337 l_rec.psq_attribute23 := p_psq_attribute23;
338 l_rec.psq_attribute24 := p_psq_attribute24;
339 l_rec.psq_attribute25 := p_psq_attribute25;
340 l_rec.psq_attribute26 := p_psq_attribute26;
341 l_rec.psq_attribute27 := p_psq_attribute27;
342 l_rec.psq_attribute28 := p_psq_attribute28;
343 l_rec.psq_attribute29 := p_psq_attribute29;
344 l_rec.psq_attribute30 := p_psq_attribute30;
345 l_rec.object_version_number := p_object_version_number;
346 --
347 -- Return the plsql record structure.
348 --
349 hr_utility.set_location(' Leaving:'||l_proc, 10);
350 Return(l_rec);
351 --
352 End convert_args;
353 --
354 end ben_psq_shd;