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