DBA Data[Home] [Help]
Skip to content

PACKAGE BODY: APPS.OTA_LME_SHD

Source


1 Package Body ota_lme_shd as
2 /* $Header: otlmerhi.pkb 120.0.12010000.2 2009/05/14 08:48:52 pekasi ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  ota_lme_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_LP_MEMBER_ENROLLMENTS_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_lp_member_enrollment_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        lp_member_enrollment_id
50       ,lp_enrollment_id
51       ,learning_path_section_id
52       ,learning_path_member_id
53       ,member_status_code
54       ,completion_target_date
55       ,completion_date
56       ,business_group_id
57       ,object_version_number
58       ,attribute_category
59       ,attribute1
60       ,attribute2
61       ,attribute3
62       ,attribute4
63       ,attribute5
64       ,attribute6
65       ,attribute7
66       ,attribute8
67       ,attribute9
68       ,attribute10
69       ,attribute11
70       ,attribute12
71       ,attribute13
72       ,attribute14
73       ,attribute15
74       ,attribute16
75       ,attribute17
76       ,attribute18
77       ,attribute19
78       ,attribute20
79       ,attribute21
80       ,attribute22
81       ,attribute23
82       ,attribute24
83       ,attribute25
84       ,attribute26
85       ,attribute27
86       ,attribute28
87       ,attribute29
88       ,attribute30
89       ,creator_person_id
90       ,event_id
91     from        ota_lp_member_enrollments
92     where       lp_member_enrollment_id = p_lp_member_enrollment_id;
93   --
94   l_fct_ret     boolean;
95   --
96 Begin
97   --
98   If (p_lp_member_enrollment_id is null and
99       p_object_version_number is null
100      ) Then
101     --
102     -- One of the primary key arguments is null therefore we must
103     -- set the returning function value to false
104     --
105     l_fct_ret := false;
106   Else
107     If (p_lp_member_enrollment_id
108         = ota_lme_shd.g_old_rec.lp_member_enrollment_id and
109         p_object_version_number
110         = ota_lme_shd.g_old_rec.object_version_number
111        ) Then
112       --
113       -- The g_old_rec is current therefore we must
114       -- set the returning function to true
115       --
116       l_fct_ret := true;
117     Else
118       --
119       -- Select the current row into g_old_rec
120       --
121       Open C_Sel1;
122       Fetch C_Sel1 Into ota_lme_shd.g_old_rec;
123       If C_Sel1%notfound Then
124         Close C_Sel1;
125         --
126         -- The primary key is invalid therefore we must error
127         --
128         fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
129         fnd_message.raise_error;
130       End If;
131       Close C_Sel1;
132       If (p_object_version_number
133           <> ota_lme_shd.g_old_rec.object_version_number) Then
134         fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
135         fnd_message.raise_error;
136       End If;
137       l_fct_ret := true;
138     End If;
139   End If;
140   Return (l_fct_ret);
141 --
142 End api_updating;
143 --
144 -- ----------------------------------------------------------------------------
145 -- |---------------------------------< lck >----------------------------------|
146 -- ----------------------------------------------------------------------------
147 Procedure lck
148   (p_lp_member_enrollment_id              in     number
149   ,p_object_version_number                in     number
150   ) is
151 --
152 -- Cursor selects the 'current' row from the HR Schema
153 --
154   Cursor C_Sel1 is
155     select
156        lp_member_enrollment_id
157       ,lp_enrollment_id
158       ,learning_path_section_id
159       ,learning_path_member_id
160       ,member_status_code
161       ,completion_target_date
162       ,completion_date
163       ,business_group_id
164       ,object_version_number
165       ,attribute_category
166       ,attribute1
167       ,attribute2
168       ,attribute3
169       ,attribute4
170       ,attribute5
171       ,attribute6
172       ,attribute7
173       ,attribute8
174       ,attribute9
175       ,attribute10
176       ,attribute11
177       ,attribute12
178       ,attribute13
179       ,attribute14
180       ,attribute15
181       ,attribute16
182       ,attribute17
183       ,attribute18
184       ,attribute19
185       ,attribute20
186       ,attribute21
187       ,attribute22
188       ,attribute23
189       ,attribute24
190       ,attribute25
191       ,attribute26
192       ,attribute27
193       ,attribute28
194       ,attribute29
195       ,attribute30
196       ,creator_person_id
197       ,event_id
198     from        ota_lp_member_enrollments
199     where       lp_member_enrollment_id = p_lp_member_enrollment_id
200     for update nowait;
201 --
202   l_proc        varchar2(72) := g_package||'lck';
203 --
204 Begin
205   hr_utility.set_location('Entering:'||l_proc, 5);
206   --
207   hr_api.mandatory_arg_error
208     (p_api_name           => l_proc
209     ,p_argument           => 'LP_MEMBER_ENROLLMENT_ID'
210     ,p_argument_value     => p_lp_member_enrollment_id
211     );
212   hr_utility.set_location(l_proc,6);
213   hr_api.mandatory_arg_error
214     (p_api_name           => l_proc
215     ,p_argument           => 'OBJECT_VERSION_NUMBER'
216     ,p_argument_value     => p_object_version_number
217     );
218   --
219   Open  C_Sel1;
220   Fetch C_Sel1 Into ota_lme_shd.g_old_rec;
221   If C_Sel1%notfound then
222     Close C_Sel1;
223     --
224     -- The primary key is invalid therefore we must error
225     --
226     fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
227     fnd_message.raise_error;
228   End If;
229   Close C_Sel1;
230   If (p_object_version_number
231       <> ota_lme_shd.g_old_rec.object_version_number) Then
232         fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
233         fnd_message.raise_error;
234   End If;
235   --
236   hr_utility.set_location(' Leaving:'||l_proc, 10);
237   --
238   -- We need to trap the ORA LOCK exception
239   --
240 Exception
241   When HR_Api.Object_Locked then
242     --
243     -- The object is locked therefore we need to supply a meaningful
244     -- error message.
245     --
246     fnd_message.set_name('PAY', 'HR_7165_OBJECT_LOCKED');
247     fnd_message.set_token('TABLE_NAME', 'ota_lp_member_enrollments');
248     fnd_message.raise_error;
249 End lck;
250 --
251 -- ----------------------------------------------------------------------------
252 -- |-----------------------------< convert_args >-----------------------------|
253 -- ----------------------------------------------------------------------------
254 Function convert_args
255   (p_lp_member_enrollment_id        in number
256   ,p_lp_enrollment_id               in number
257   ,p_learning_path_section_id       in number
258   ,p_learning_path_member_id        in number
259   ,p_member_status_code                  in varchar2
260   ,p_completion_target_date         in date
261   ,p_completion_date                 in date
262   ,p_business_group_id              in number
263   ,p_object_version_number          in number
264   ,p_attribute_category             in varchar2
265   ,p_attribute1                     in varchar2
266   ,p_attribute2                     in varchar2
267   ,p_attribute3                     in varchar2
268   ,p_attribute4                     in varchar2
269   ,p_attribute5                     in varchar2
270   ,p_attribute6                     in varchar2
271   ,p_attribute7                     in varchar2
272   ,p_attribute8                     in varchar2
273   ,p_attribute9                     in varchar2
274   ,p_attribute10                    in varchar2
275   ,p_attribute11                    in varchar2
276   ,p_attribute12                    in varchar2
277   ,p_attribute13                    in varchar2
278   ,p_attribute14                    in varchar2
279   ,p_attribute15                    in varchar2
280   ,p_attribute16                    in varchar2
281   ,p_attribute17                    in varchar2
282   ,p_attribute18                    in varchar2
283   ,p_attribute19                    in varchar2
284   ,p_attribute20                    in varchar2
285   ,p_attribute21                    in varchar2
286   ,p_attribute22                    in varchar2
287   ,p_attribute23                    in varchar2
288   ,p_attribute24                    in varchar2
289   ,p_attribute25                    in varchar2
290   ,p_attribute26                    in varchar2
291   ,p_attribute27                    in varchar2
292   ,p_attribute28                    in varchar2
293   ,p_attribute29                    in varchar2
294   ,p_attribute30                    in varchar2
295   ,p_creator_person_id              in number
296   ,p_event_id                       in number
297   )
298   Return g_rec_type is
299 --
300   l_rec   g_rec_type;
301 --
302 Begin
303   --
304   -- Convert arguments into local l_rec structure.
305   --
306   l_rec.lp_member_enrollment_id          := p_lp_member_enrollment_id;
307   l_rec.lp_enrollment_id                 := p_lp_enrollment_id;
308   l_rec.learning_path_section_id         := p_learning_path_section_id;
309   l_rec.learning_path_member_id          := p_learning_path_member_id;
310   l_rec.member_status_code                    := p_member_status_code;
311   l_rec.completion_target_date           := p_completion_target_date;
312   l_rec.completion_date                   := p_completion_date;
313   l_rec.business_group_id                := p_business_group_id;
314   l_rec.object_version_number            := p_object_version_number;
315   l_rec.attribute_category               := p_attribute_category;
316   l_rec.attribute1                       := p_attribute1;
317   l_rec.attribute2                       := p_attribute2;
318   l_rec.attribute3                       := p_attribute3;
319   l_rec.attribute4                       := p_attribute4;
320   l_rec.attribute5                       := p_attribute5;
321   l_rec.attribute6                       := p_attribute6;
322   l_rec.attribute7                       := p_attribute7;
323   l_rec.attribute8                       := p_attribute8;
324   l_rec.attribute9                       := p_attribute9;
325   l_rec.attribute10                      := p_attribute10;
326   l_rec.attribute11                      := p_attribute11;
327   l_rec.attribute12                      := p_attribute12;
328   l_rec.attribute13                      := p_attribute13;
329   l_rec.attribute14                      := p_attribute14;
330   l_rec.attribute15                      := p_attribute15;
331   l_rec.attribute16                      := p_attribute16;
332   l_rec.attribute17                      := p_attribute17;
333   l_rec.attribute18                      := p_attribute18;
334   l_rec.attribute19                      := p_attribute19;
335   l_rec.attribute20                      := p_attribute20;
336   l_rec.attribute21                      := p_attribute21;
337   l_rec.attribute22                      := p_attribute22;
338   l_rec.attribute23                      := p_attribute23;
339   l_rec.attribute24                      := p_attribute24;
340   l_rec.attribute25                      := p_attribute25;
341   l_rec.attribute26                      := p_attribute26;
342   l_rec.attribute27                      := p_attribute27;
343   l_rec.attribute28                      := p_attribute28;
344   l_rec.attribute29                      := p_attribute29;
345   l_rec.attribute30                      := p_attribute30;
346   l_rec.creator_person_id                := p_creator_person_id;
347   l_rec.event_id                         := p_event_id;
348   --
349   -- Return the plsql record structure.
350   --
351   Return(l_rec);
352 --
353 End convert_args;
354 --
355 end ota_lme_shd;