[Home] [Help]
PACKAGE BODY: APPS.OTA_CFS_SHD
Source
1 Package Body ota_cfs_shd as
2 /* $Header: otcfsrhi.pkb 120.2 2005/08/24 09:49 dhmulia noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' ota_cfs_shd.'; -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |---------------------------< constraint_error >---------------------------|
12 -- ----------------------------------------------------------------------------
13 Procedure constraint_error
14 (p_constraint_name in all_constraints.constraint_name%TYPE
15 ) Is
16 --
17 l_proc varchar2(72) := g_package||'constraint_error';
18 --
19 Begin
20 --
21 If (p_constraint_name = 'OTA_CONFERENCE_SERVERS_PK') Then
22 fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
23 fnd_message.set_token('PROCEDURE', l_proc);
24 fnd_message.set_token('STEP','5');
25 fnd_message.raise_error;
26 Else
27 fnd_message.set_name('PAY', 'HR_7877_API_INVALID_CONSTRAINT');
28 fnd_message.set_token('PROCEDURE', l_proc);
29 fnd_message.set_token('CONSTRAINT_NAME', p_constraint_name);
30 fnd_message.raise_error;
31 End If;
32 --
33 End constraint_error;
34 --
35 -- ----------------------------------------------------------------------------
36 -- |-----------------------------< api_updating >-----------------------------|
37 -- ----------------------------------------------------------------------------
38 Function api_updating
39 (p_conference_server_id in number
40 ,p_object_version_number in number
41 )
42 Return Boolean Is
43 --
44 --
45 -- Cursor selects the 'current' row from the HR Schema
46 --
47 Cursor C_Sel1 is
48 select
49 conference_server_id
50 ,url
51 ,type
52 ,owc_site_id
53 ,owc_auth_token
54 ,end_date_active
55 ,object_version_number
56 ,business_group_id
57 ,attribute_category
58 ,attribute1
59 ,attribute2
60 ,attribute3
61 ,attribute4
62 ,attribute5
63 ,attribute6
64 ,attribute7
65 ,attribute8
66 ,attribute9
67 ,attribute10
68 ,attribute11
69 ,attribute12
70 ,attribute13
71 ,attribute14
72 ,attribute15
73 ,attribute16
74 ,attribute17
75 ,attribute18
76 ,attribute19
77 ,attribute20
78 from ota_conference_servers_b
79 where conference_server_id = p_conference_server_id;
80 --
81 l_fct_ret boolean;
82 --
83 Begin
84 --
85 If (p_conference_server_id is null and
86 p_object_version_number is null
87 ) Then
88 --
89 -- One of the primary key arguments is null therefore we must
90 -- set the returning function value to false
91 --
92 l_fct_ret := false;
93 Else
94 If (p_conference_server_id
95 = ota_cfs_shd.g_old_rec.conference_server_id and
96 p_object_version_number
97 = ota_cfs_shd.g_old_rec.object_version_number
98 ) Then
99 --
100 -- The g_old_rec is current therefore we must
101 -- set the returning function to true
102 --
103 l_fct_ret := true;
104 Else
105 --
106 -- Select the current row into g_old_rec
107 --
108 Open C_Sel1;
109 Fetch C_Sel1 Into ota_cfs_shd.g_old_rec;
110 If C_Sel1%notfound Then
111 Close C_Sel1;
112 --
113 -- The primary key is invalid therefore we must error
114 --
115 fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
116 fnd_message.raise_error;
117 End If;
118 Close C_Sel1;
119 If (p_object_version_number
120 <> ota_cfs_shd.g_old_rec.object_version_number) Then
121 fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
122 fnd_message.raise_error;
123 End If;
124 l_fct_ret := true;
125 End If;
126 End If;
127 Return (l_fct_ret);
128 --
129 End api_updating;
130 --
131 -- ----------------------------------------------------------------------------
132 -- |---------------------------------< lck >----------------------------------|
133 -- ----------------------------------------------------------------------------
134 Procedure lck
135 (p_conference_server_id in number
136 ,p_object_version_number in number
137 ) is
138 --
139 -- Cursor selects the 'current' row from the HR Schema
140 --
141 Cursor C_Sel1 is
142 select
143 conference_server_id
144 ,url
145 ,type
146 ,owc_site_id
147 ,owc_auth_token
148 ,end_date_active
149 ,object_version_number
150 ,business_group_id
151 ,attribute_category
152 ,attribute1
153 ,attribute2
154 ,attribute3
155 ,attribute4
156 ,attribute5
157 ,attribute6
158 ,attribute7
159 ,attribute8
160 ,attribute9
161 ,attribute10
162 ,attribute11
163 ,attribute12
164 ,attribute13
165 ,attribute14
166 ,attribute15
167 ,attribute16
168 ,attribute17
169 ,attribute18
170 ,attribute19
171 ,attribute20
172 from ota_conference_servers_b
173 where conference_server_id = p_conference_server_id
174 for update nowait;
175 --
176 l_proc varchar2(72) := g_package||'lck';
177 --
178 Begin
179 hr_utility.set_location('Entering:'||l_proc, 5);
180 --
181 hr_api.mandatory_arg_error
182 (p_api_name => l_proc
183 ,p_argument => 'CONFERENCE_SERVER_ID'
184 ,p_argument_value => p_conference_server_id
185 );
186 hr_utility.set_location(l_proc,6);
187 hr_api.mandatory_arg_error
188 (p_api_name => l_proc
189 ,p_argument => 'OBJECT_VERSION_NUMBER'
190 ,p_argument_value => p_object_version_number
191 );
192 --
193 Open C_Sel1;
194 Fetch C_Sel1 Into ota_cfs_shd.g_old_rec;
195 If C_Sel1%notfound then
196 Close C_Sel1;
197 --
198 -- The primary key is invalid therefore we must error
199 --
200 fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
201 fnd_message.raise_error;
202 End If;
203 Close C_Sel1;
204 If (p_object_version_number
205 <> ota_cfs_shd.g_old_rec.object_version_number) Then
206 fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
207 fnd_message.raise_error;
208 End If;
209 --
210 hr_utility.set_location(' Leaving:'||l_proc, 10);
211 --
212 -- We need to trap the ORA LOCK exception
213 --
214 Exception
215 When HR_Api.Object_Locked then
216 --
217 -- The object is locked therefore we need to supply a meaningful
218 -- error message.
219 --
220 fnd_message.set_name('PAY', 'HR_7165_OBJECT_LOCKED');
221 fnd_message.set_token('TABLE_NAME', 'ota_conference_servers');
222 fnd_message.raise_error;
223 End lck;
224 --
225 -- ----------------------------------------------------------------------------
226 -- |-----------------------------< convert_args >-----------------------------|
227 -- ----------------------------------------------------------------------------
228 Function convert_args
229 (p_conference_server_id in number
230 ,p_name in varchar2
231 ,p_description in varchar2
232 ,p_url in varchar2
233 ,p_type in varchar2
234 ,p_owc_site_id in varchar2
235 ,p_owc_auth_token in varchar2
236 ,p_end_date_active in date
237 ,p_object_version_number in number
238 ,p_business_group_id in number
239 ,p_attribute_category in varchar2
240 ,p_attribute1 in varchar2
241 ,p_attribute2 in varchar2
242 ,p_attribute3 in varchar2
243 ,p_attribute4 in varchar2
244 ,p_attribute5 in varchar2
245 ,p_attribute6 in varchar2
246 ,p_attribute7 in varchar2
247 ,p_attribute8 in varchar2
248 ,p_attribute9 in varchar2
249 ,p_attribute10 in varchar2
250 ,p_attribute11 in varchar2
251 ,p_attribute12 in varchar2
252 ,p_attribute13 in varchar2
253 ,p_attribute14 in varchar2
254 ,p_attribute15 in varchar2
255 ,p_attribute16 in varchar2
256 ,p_attribute17 in varchar2
257 ,p_attribute18 in varchar2
258 ,p_attribute19 in varchar2
259 ,p_attribute20 in varchar2
260 )
261 Return g_rec_type is
262 --
263 l_rec g_rec_type;
264 --
265 Begin
266 --
267 -- Convert arguments into local l_rec structure.
268 --
269 l_rec.conference_server_id := p_conference_server_id;
270 l_rec.url := p_url;
271 l_rec.type := p_type;
272 l_rec.owc_site_id := p_owc_site_id;
273 l_rec.owc_auth_token := p_owc_auth_token;
274 l_rec.end_date_active := p_end_date_active;
275 l_rec.object_version_number := p_object_version_number;
276 l_rec.business_group_id := p_business_group_id;
277 l_rec.attribute_category := p_attribute_category;
278 l_rec.attribute1 := p_attribute1;
279 l_rec.attribute2 := p_attribute2;
280 l_rec.attribute3 := p_attribute3;
281 l_rec.attribute4 := p_attribute4;
282 l_rec.attribute5 := p_attribute5;
283 l_rec.attribute6 := p_attribute6;
284 l_rec.attribute7 := p_attribute7;
285 l_rec.attribute8 := p_attribute8;
286 l_rec.attribute9 := p_attribute9;
287 l_rec.attribute10 := p_attribute10;
288 l_rec.attribute11 := p_attribute11;
289 l_rec.attribute12 := p_attribute12;
290 l_rec.attribute13 := p_attribute13;
291 l_rec.attribute14 := p_attribute14;
292 l_rec.attribute15 := p_attribute15;
293 l_rec.attribute16 := p_attribute16;
294 l_rec.attribute17 := p_attribute17;
295 l_rec.attribute18 := p_attribute18;
296 l_rec.attribute19 := p_attribute19;
297 l_rec.attribute20 := p_attribute20;
298 --
299 -- Return the plsql record structure.
300 --
301 Return(l_rec);
302 --
303 End convert_args;
304 --
305 end ota_cfs_shd;