[Home] [Help]
PACKAGE BODY: APPS.IRC_RSE_SHD
Source
1 Package Body irc_rse_shd as
2 /* $Header: irrserhi.pkb 120.0 2005/07/26 15:17:04 mbocutt noship $ */
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 from irc_all_recruiting_sites
106 where recruiting_site_id = p_recruiting_site_id;
107 --
108 l_fct_ret boolean;
109 --
110 Begin
111 --
112 If (p_recruiting_site_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 (p_recruiting_site_id
122 = irc_rse_shd.g_old_rec.recruiting_site_id and
123 p_object_version_number
124 = irc_rse_shd.g_old_rec.object_version_number
125 ) Then
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 irc_rse_shd.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
147 <> irc_rse_shd.g_old_rec.object_version_number) Then
148 fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
149 fnd_message.raise_error;
150 End If;
151 l_fct_ret := true;
152 End If;
153 End If;
154 Return (l_fct_ret);
155 --
156 End api_updating;
157 --
158 -- ----------------------------------------------------------------------------
159 -- |---------------------------------< lck >----------------------------------|
160 -- ----------------------------------------------------------------------------
161 Procedure lck
162 (p_recruiting_site_id in number
163 ,p_object_version_number in number
164 ) is
165 --
166 -- Cursor selects the 'current' row from the HR Schema
167 --
168 Cursor C_Sel1 is
169 select
170 recruiting_site_id
171 ,date_from
172 ,date_to
173 ,posting_username
174 ,posting_password
175 ,internal
176 ,external
177 ,third_party
178 ,posting_cost
179 ,posting_cost_period
180 ,posting_cost_currency
181 ,stylesheet
182 ,attribute_category
183 ,attribute1
184 ,attribute2
185 ,attribute3
186 ,attribute4
187 ,attribute5
188 ,attribute6
189 ,attribute7
190 ,attribute8
191 ,attribute9
192 ,attribute10
193 ,attribute11
194 ,attribute12
195 ,attribute13
196 ,attribute14
197 ,attribute15
198 ,attribute16
199 ,attribute17
200 ,attribute18
201 ,attribute19
202 ,attribute20
203 ,attribute21
204 ,attribute22
205 ,attribute23
206 ,attribute24
207 ,attribute25
208 ,attribute26
209 ,attribute27
210 ,attribute28
211 ,attribute29
212 ,attribute30
213 ,object_version_number
214 ,internal_name
215 from irc_all_recruiting_sites
216 where recruiting_site_id = p_recruiting_site_id
217 for update nowait;
218 --
219 l_proc varchar2(72) := g_package||'lck';
220 --
221 Begin
222 hr_utility.set_location('Entering:'||l_proc, 5);
223 --
224 hr_api.mandatory_arg_error
225 (p_api_name => l_proc
226 ,p_argument => 'RECRUITING_SITE_ID'
227 ,p_argument_value => p_recruiting_site_id
228 );
229 hr_utility.set_location(l_proc,6);
230 hr_api.mandatory_arg_error
231 (p_api_name => l_proc
232 ,p_argument => 'OBJECT_VERSION_NUMBER'
233 ,p_argument_value => p_object_version_number
234 );
235 --
236 Open C_Sel1;
237 Fetch C_Sel1 Into irc_rse_shd.g_old_rec;
238 If C_Sel1%notfound then
239 Close C_Sel1;
240 --
241 -- The primary key is invalid therefore we must error
242 --
243 fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
244 fnd_message.raise_error;
245 End If;
246 Close C_Sel1;
247 If (p_object_version_number
248 <> irc_rse_shd.g_old_rec.object_version_number) Then
249 fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
250 fnd_message.raise_error;
251 End If;
252 --
253 hr_utility.set_location(' Leaving:'||l_proc, 10);
254 --
255 -- We need to trap the ORA LOCK exception
256 --
257 Exception
258 When HR_Api.Object_Locked then
259 --
260 -- The object is locked therefore we need to supply a meaningful
261 -- error message.
262 --
263 fnd_message.set_name('PAY', 'HR_7165_OBJECT_LOCKED');
264 fnd_message.set_token('TABLE_NAME', 'irc_all_recruiting_sites');
265 fnd_message.raise_error;
266 End lck;
267 --
268 -- ----------------------------------------------------------------------------
269 -- |-----------------------------< convert_args >-----------------------------|
270 -- ----------------------------------------------------------------------------
271 Function convert_args
272 (p_recruiting_site_id in number
273 ,p_date_from in date
274 ,p_date_to in date
275 ,p_posting_username in varchar2
276 ,p_posting_password in varchar2
277 ,p_internal in varchar2
278 ,p_external in varchar2
279 ,p_third_party in varchar2
280 ,p_posting_cost in number
281 ,p_posting_cost_period in varchar2
282 ,p_posting_cost_currency in varchar2
283 ,p_stylesheet in varchar2
284 ,p_attribute_category in varchar2
285 ,p_attribute1 in varchar2
286 ,p_attribute2 in varchar2
287 ,p_attribute3 in varchar2
288 ,p_attribute4 in varchar2
289 ,p_attribute5 in varchar2
290 ,p_attribute6 in varchar2
291 ,p_attribute7 in varchar2
292 ,p_attribute8 in varchar2
293 ,p_attribute9 in varchar2
294 ,p_attribute10 in varchar2
295 ,p_attribute11 in varchar2
296 ,p_attribute12 in varchar2
297 ,p_attribute13 in varchar2
298 ,p_attribute14 in varchar2
299 ,p_attribute15 in varchar2
300 ,p_attribute16 in varchar2
301 ,p_attribute17 in varchar2
302 ,p_attribute18 in varchar2
303 ,p_attribute19 in varchar2
304 ,p_attribute20 in varchar2
305 ,p_attribute21 in varchar2
306 ,p_attribute22 in varchar2
307 ,p_attribute23 in varchar2
308 ,p_attribute24 in varchar2
309 ,p_attribute25 in varchar2
310 ,p_attribute26 in varchar2
311 ,p_attribute27 in varchar2
312 ,p_attribute28 in varchar2
313 ,p_attribute29 in varchar2
314 ,p_attribute30 in varchar2
315 ,p_object_version_number in number
316 ,p_internal_name in varchar2
317 )
318 Return g_rec_type is
319 --
320 l_rec g_rec_type;
321 --
322 Begin
323 --
324 -- Convert arguments into local l_rec structure.
325 --
326 l_rec.recruiting_site_id := p_recruiting_site_id;
327 l_rec.date_from := p_date_from;
328 l_rec.date_to := p_date_to;
329 l_rec.posting_username := p_posting_username;
330 l_rec.posting_password := p_posting_password;
331 l_rec.internal := p_internal;
332 l_rec.external := p_external;
333 l_rec.third_party := p_third_party;
334 l_rec.posting_cost := p_posting_cost;
335 l_rec.posting_cost_period := p_posting_cost_period;
336 l_rec.posting_cost_currency := p_posting_cost_currency;
337 l_rec.stylesheet := p_stylesheet;
338 l_rec.attribute_category := p_attribute_category;
339 l_rec.attribute1 := p_attribute1;
340 l_rec.attribute2 := p_attribute2;
341 l_rec.attribute3 := p_attribute3;
342 l_rec.attribute4 := p_attribute4;
343 l_rec.attribute5 := p_attribute5;
344 l_rec.attribute6 := p_attribute6;
345 l_rec.attribute7 := p_attribute7;
346 l_rec.attribute8 := p_attribute8;
347 l_rec.attribute9 := p_attribute9;
348 l_rec.attribute10 := p_attribute10;
349 l_rec.attribute11 := p_attribute11;
350 l_rec.attribute12 := p_attribute12;
351 l_rec.attribute13 := p_attribute13;
352 l_rec.attribute14 := p_attribute14;
353 l_rec.attribute15 := p_attribute15;
354 l_rec.attribute16 := p_attribute16;
355 l_rec.attribute17 := p_attribute17;
356 l_rec.attribute18 := p_attribute18;
357 l_rec.attribute19 := p_attribute19;
358 l_rec.attribute20 := p_attribute20;
359 l_rec.attribute21 := p_attribute21;
360 l_rec.attribute22 := p_attribute22;
361 l_rec.attribute23 := p_attribute23;
362 l_rec.attribute24 := p_attribute24;
363 l_rec.attribute25 := p_attribute25;
364 l_rec.attribute26 := p_attribute26;
365 l_rec.attribute27 := p_attribute27;
366 l_rec.attribute28 := p_attribute28;
367 l_rec.attribute29 := p_attribute29;
368 l_rec.attribute30 := p_attribute30;
369 l_rec.object_version_number := p_object_version_number;
370 l_rec.internal_name := p_internal_name;
371 --
372 -- Return the plsql record structure.
373 --
374 Return(l_rec);
375 --
376 End convert_args;
377 --
378 end irc_rse_shd;