DBA Data[Home] [Help]

PACKAGE BODY: APPS.OTA_OCL_BUS

Source


1 Package Body ota_ocl_bus as
2 /* $Header: otoclrhi.pkb 120.1.12000000.2 2007/02/07 09:19:37 niarora noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ota_ocl_bus.';  -- Global package name
9 --
10 -- The following two global variables are only to be
11 -- used by the return_legislation_code function.
12 --
13 g_legislation_code            varchar2(150)  default null;
14 g_competence_language_id      number         default null;
15 --
16 
17 procedure check_lang_code(p_rec                          in ota_ocl_shd.g_rec_type)
18 is
19 begin
20  If p_rec.language_code IS NULL THEN
21        fnd_message.set_name      ( 'OTA','OTA_467063_MAND_LANGUAGE_CODE');
22        fnd_message.raise_error;
23   END IF;
24 
25 end;
26 --  ---------------------------------------------------------------------------
27 --  |----------------------< set_security_group_id >--------------------------|
28 --  ---------------------------------------------------------------------------
29 --
30 Procedure set_security_group_id
31   (p_competence_language_id               in number
32   ) is
33   --
34   -- Declare cursor
35   --
36   cursor csr_sec_grp is
37     select pbg.security_group_id
38       from per_business_groups pbg
39          , ota_competence_languages ocl
40      where ocl.competence_language_id = p_competence_language_id
41        and pbg.business_group_id = ocl.business_group_id;
42   --
43   -- Declare local variables
44   --
45   l_security_group_id number;
46   l_proc              varchar2(72)  :=  g_package||'set_security_group_id';
47   --
48 begin
49   --
50   hr_utility.set_location('Entering:'|| l_proc, 10);
51   --
52   -- Ensure that all the mandatory parameter are not null
53   --
54   hr_api.mandatory_arg_error
55     (p_api_name           => l_proc
56     ,p_argument           => 'competence_language_id'
57     ,p_argument_value     => p_competence_language_id
58     );
59   --
60   open csr_sec_grp;
61   fetch csr_sec_grp into l_security_group_id;
62   --
63   if csr_sec_grp%notfound then
64      --
65      close csr_sec_grp;
66      --
67      -- The primary key is invalid therefore we must error
68      --
69      fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
70      fnd_message.raise_error;
71      --
72   end if;
73   close csr_sec_grp;
74   --
75   -- Set the security_group_id in CLIENT_INFO
76   --
77   hr_api.set_security_group_id
78     (p_security_group_id => l_security_group_id
79     );
80   --
81   hr_utility.set_location(' Leaving:'|| l_proc, 20);
82   --
83 end set_security_group_id;
84 --
85 --  ---------------------------------------------------------------------------
86 --  |---------------------< return_legislation_code >-------------------------|
87 --  ---------------------------------------------------------------------------
88 --
89 Function return_legislation_code
90   (p_competence_language_id               in     number
91   )
92   Return Varchar2 Is
93   --
94   -- Declare cursor
95   --
96   cursor csr_leg_code is
97     select pbg.legislation_code
98       from per_business_groups pbg
99          , ota_competence_languages ocl
100      where ocl.competence_language_id = p_competence_language_id
101        and pbg.business_group_id = ocl.business_group_id;
102   --
103   -- Declare local variables
104   --
105   l_legislation_code  varchar2(150);
106   l_proc              varchar2(72)  :=  g_package||'return_legislation_code';
107   --
108 Begin
109   --
110   hr_utility.set_location('Entering:'|| l_proc, 10);
111   --
112   -- Ensure that all the mandatory parameter are not null
113   --
114   hr_api.mandatory_arg_error
115     (p_api_name           => l_proc
116     ,p_argument           => 'competence_language_id'
117     ,p_argument_value     => p_competence_language_id
118     );
119   --
120   if ( nvl(ota_ocl_bus.g_competence_language_id, hr_api.g_number)
121        = p_competence_language_id) then
122     --
123     -- The legislation code has already been found with a previous
124     -- call to this function. Just return the value in the global
125     -- variable.
126     --
127     l_legislation_code := ota_ocl_bus.g_legislation_code;
128     hr_utility.set_location(l_proc, 20);
129   else
130     --
131     -- The ID is different to the last call to this function
132     -- or this is the first call to this function.
133     --
134     open csr_leg_code;
135     fetch csr_leg_code into l_legislation_code;
136     --
137     if csr_leg_code%notfound then
138       --
139       -- The primary key is invalid therefore we must error
140       --
141       close csr_leg_code;
142       fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
143       fnd_message.raise_error;
144     end if;
145     hr_utility.set_location(l_proc,30);
146     --
147     -- Set the global variables so the values are
148     -- available for the next call to this function.
149     --
150     close csr_leg_code;
151     ota_ocl_bus.g_competence_language_id:= p_competence_language_id;
152     ota_ocl_bus.g_legislation_code  := l_legislation_code;
153   end if;
154   hr_utility.set_location(' Leaving:'|| l_proc, 40);
155   return l_legislation_code;
156 end return_legislation_code;
157 --
158 -- ----------------------------------------------------------------------------
159 -- |-----------------------------< chk_ddf >----------------------------------|
160 -- ----------------------------------------------------------------------------
161 --
162 -- Description:
163 --   Validates all the Developer Descriptive Flexfield values.
164 --
165 -- Prerequisites:
166 --   All other columns have been validated.  Must be called as the
167 --   last step from insert_validate and update_validate.
168 --
169 -- In Arguments:
170 --   p_rec
171 --
172 -- Post Success:
173 --   If the Developer Descriptive Flexfield structure column and data values
174 --   are all valid this procedure will end normally and processing will
175 --   continue.
176 --
177 -- Post Failure:
178 --   If the Developer Descriptive Flexfield structure column value or any of
179 --   the data values are invalid then an application error is raised as
180 --   a PL/SQL exception.
181 --
182 -- Access Status:
183 --   Internal Row Handler Use Only.
184 --
185 -- ----------------------------------------------------------------------------
186 procedure chk_ddf
187   (p_rec in ota_ocl_shd.g_rec_type
188   ) is
189 --
190   l_proc   varchar2(72) := g_package || 'chk_ddf';
191 --
192 begin
193   hr_utility.set_location('Entering:'||l_proc,10);
194   --
195   if ((p_rec.competence_language_id is not null)  and (
196     nvl(ota_ocl_shd.g_old_rec.ocl_information_category, hr_api.g_varchar2) <>
197     nvl(p_rec.ocl_information_category, hr_api.g_varchar2)  or
198     nvl(ota_ocl_shd.g_old_rec.ocl_information1, hr_api.g_varchar2) <>
199     nvl(p_rec.ocl_information1, hr_api.g_varchar2)  or
200     nvl(ota_ocl_shd.g_old_rec.ocl_information2, hr_api.g_varchar2) <>
201     nvl(p_rec.ocl_information2, hr_api.g_varchar2)  or
202     nvl(ota_ocl_shd.g_old_rec.ocl_information3, hr_api.g_varchar2) <>
203     nvl(p_rec.ocl_information3, hr_api.g_varchar2)  or
204     nvl(ota_ocl_shd.g_old_rec.ocl_information4, hr_api.g_varchar2) <>
205     nvl(p_rec.ocl_information4, hr_api.g_varchar2)  or
206     nvl(ota_ocl_shd.g_old_rec.ocl_information5, hr_api.g_varchar2) <>
207     nvl(p_rec.ocl_information5, hr_api.g_varchar2)  or
208     nvl(ota_ocl_shd.g_old_rec.ocl_information6, hr_api.g_varchar2) <>
209     nvl(p_rec.ocl_information6, hr_api.g_varchar2)  or
210     nvl(ota_ocl_shd.g_old_rec.ocl_information7, hr_api.g_varchar2) <>
211     nvl(p_rec.ocl_information7, hr_api.g_varchar2)  or
212     nvl(ota_ocl_shd.g_old_rec.ocl_information8, hr_api.g_varchar2) <>
213     nvl(p_rec.ocl_information8, hr_api.g_varchar2)  or
214     nvl(ota_ocl_shd.g_old_rec.ocl_information9, hr_api.g_varchar2) <>
215     nvl(p_rec.ocl_information9, hr_api.g_varchar2)  or
216     nvl(ota_ocl_shd.g_old_rec.ocl_information10, hr_api.g_varchar2) <>
217     nvl(p_rec.ocl_information10, hr_api.g_varchar2)  or
218     nvl(ota_ocl_shd.g_old_rec.ocl_information11, hr_api.g_varchar2) <>
219     nvl(p_rec.ocl_information11, hr_api.g_varchar2)  or
220     nvl(ota_ocl_shd.g_old_rec.ocl_information12, hr_api.g_varchar2) <>
221     nvl(p_rec.ocl_information12, hr_api.g_varchar2)  or
222     nvl(ota_ocl_shd.g_old_rec.ocl_information13, hr_api.g_varchar2) <>
223     nvl(p_rec.ocl_information13, hr_api.g_varchar2)  or
224     nvl(ota_ocl_shd.g_old_rec.ocl_information14, hr_api.g_varchar2) <>
225     nvl(p_rec.ocl_information14, hr_api.g_varchar2)  or
226     nvl(ota_ocl_shd.g_old_rec.ocl_information15, hr_api.g_varchar2) <>
227     nvl(p_rec.ocl_information15, hr_api.g_varchar2)  or
228     nvl(ota_ocl_shd.g_old_rec.ocl_information16, hr_api.g_varchar2) <>
229     nvl(p_rec.ocl_information16, hr_api.g_varchar2)  or
230     nvl(ota_ocl_shd.g_old_rec.ocl_information17, hr_api.g_varchar2) <>
231     nvl(p_rec.ocl_information17, hr_api.g_varchar2)  or
232     nvl(ota_ocl_shd.g_old_rec.ocl_information18, hr_api.g_varchar2) <>
233     nvl(p_rec.ocl_information18, hr_api.g_varchar2)  or
234     nvl(ota_ocl_shd.g_old_rec.ocl_information19, hr_api.g_varchar2) <>
235     nvl(p_rec.ocl_information19, hr_api.g_varchar2)  or
236     nvl(ota_ocl_shd.g_old_rec.ocl_information20, hr_api.g_varchar2) <>
237     nvl(p_rec.ocl_information20, hr_api.g_varchar2) ))
238     or (p_rec.competence_language_id is null)  then
239     --
240     -- Only execute the validation if absolutely necessary:
241     -- a) During update, the structure column value or any
242     --    of the attribute values have actually changed.
243     -- b) During insert.
244     --
245     hr_dflex_utility.ins_or_upd_descflex_attribs
246       (p_appl_short_name                 => 'OTA'
247       ,p_descflex_name                   => 'OTA_COMPETENCE_LANGUAGES'
248     --  ,p_attribute20_name                => 'OCL_INFORMATION20'
249     --  ,p_attribute20_value               => p_rec.ocl_information20
250       ,p_attribute_category              => p_rec.OCL_INFORMATION_CATEGORY
251       ,p_attribute1_name                 => 'OCL_INFORMATION1'
252       ,p_attribute1_value                => p_rec.ocl_information1
253       ,p_attribute2_name                 => 'OCL_INFORMATION2'
254       ,p_attribute2_value                => p_rec.ocl_information2
255       ,p_attribute3_name                 => 'OCL_INFORMATION3'
256       ,p_attribute3_value                => p_rec.ocl_information3
257       ,p_attribute4_name                 => 'OCL_INFORMATION4'
258       ,p_attribute4_value                => p_rec.ocl_information4
259       ,p_attribute5_name                 => 'OCL_INFORMATION5'
260       ,p_attribute5_value                => p_rec.ocl_information5
261       ,p_attribute6_name                 => 'OCL_INFORMATION6'
262       ,p_attribute6_value                => p_rec.ocl_information6
263       ,p_attribute7_name                 => 'OCL_INFORMATION7'
264       ,p_attribute7_value                => p_rec.ocl_information7
265       ,p_attribute8_name                 => 'OCL_INFORMATION8'
266       ,p_attribute8_value                => p_rec.ocl_information8
267       ,p_attribute9_name                 => 'OCL_INFORMATION9'
268       ,p_attribute9_value                => p_rec.ocl_information9
269       ,p_attribute10_name                => 'OCL_INFORMATION10'
270       ,p_attribute10_value               => p_rec.ocl_information10
271       ,p_attribute11_name                => 'OCL_INFORMATION11'
272       ,p_attribute11_value               => p_rec.ocl_information11
273       ,p_attribute12_name                => 'OCL_INFORMATION12'
274       ,p_attribute12_value               => p_rec.ocl_information12
275       ,p_attribute13_name                => 'OCL_INFORMATION13'
276       ,p_attribute13_value               => p_rec.ocl_information13
277       ,p_attribute14_name                => 'OCL_INFORMATION14'
278       ,p_attribute14_value               => p_rec.ocl_information14
279       ,p_attribute15_name                => 'OCL_INFORMATION15'
280       ,p_attribute15_value               => p_rec.ocl_information15
281       ,p_attribute16_name                => 'OCL_INFORMATION16'
282       ,p_attribute16_value               => p_rec.ocl_information16
283       ,p_attribute17_name                => 'OCL_INFORMATION17'
284       ,p_attribute17_value               => p_rec.ocl_information17
285       ,p_attribute18_name                => 'OCL_INFORMATION18'
286       ,p_attribute18_value               => p_rec.ocl_information18
287       ,p_attribute19_name                => 'OCL_INFORMATION19'
288       ,p_attribute19_value               => p_rec.ocl_information19
289       ,p_attribute20_name                => 'OCL_INFORMATION20'
290       ,p_attribute20_value               => p_rec.ocl_information20
291       );
292   end if;
293   --
294   hr_utility.set_location(' Leaving:'||l_proc,20);
295 end chk_ddf;
296 --
297 -- ----------------------------------------------------------------------------
298 -- |-----------------------< chk_non_updateable_args >------------------------|
299 -- ----------------------------------------------------------------------------
300 -- {Start Of Comments}
301 --
302 -- Description:
303 --   This procedure is used to ensure that non updateable attributes have
304 --   not been updated. If an attribute has been updated an error is generated.
305 --
306 -- Pre Conditions:
307 --   g_old_rec has been populated with details of the values currently in
308 --   the database.
309 --
310 -- In Arguments:
311 --   p_rec has been populated with the updated values the user would like the
312 --   record set to.
313 --
314 -- Post Success:
315 --   Processing continues if all the non updateable attributes have not
316 --   changed.
317 --
318 -- Post Failure:
319 --   An application error is raised if any of the non updatable attributes
320 --   have been altered.
321 --
322 -- {End Of Comments}
323 -- ----------------------------------------------------------------------------
324 Procedure chk_non_updateable_args
325   (p_effective_date               in date
326   ,p_rec in ota_ocl_shd.g_rec_type
327   ) IS
328 --
329   l_proc     varchar2(72) := g_package || 'chk_non_updateable_args';
330   l_error    EXCEPTION;
331   l_argument varchar2(30);
332 --
333 Begin
334   --
335   -- Only proceed with the validation if a row exists for the current
336   -- record in the HR Schema.
337   --
338   IF NOT ota_ocl_shd.api_updating
339       (p_competence_language_id               => p_rec.competence_language_id
340       ,p_object_version_number                => p_rec.object_version_number
341       ) THEN
342      fnd_message.set_name('PER', 'HR_6153_ALL_PROCEDURE_FAIL');
343      fnd_message.set_token('PROCEDURE ', l_proc);
344      fnd_message.set_token('STEP ', '5');
345      fnd_message.raise_error;
346   END IF;
347   --
348   -- EDIT_HERE: Add checks to ensure non-updateable args have
349   --            not been updated.
350   --
351   EXCEPTION
352     WHEN l_error THEN
353        hr_api.argument_changed_error
354          (p_api_name => l_proc
355          ,p_argument => l_argument);
356     WHEN OTHERS THEN
357        RAISE;
358 End chk_non_updateable_args;
359 
360 -- ----------------------------------------------------------------------------
361 -- |---------------------------< chk_competence>----------------------------|
362 -- ----------------------------------------------------------------------------
363 Procedure chk_competence
364   (p_competence_language_id 	    in number
365   ,p_effective_date               in date
366   ,p_competence_id                in number
367   ,p_business_group_id            in number
368   ) is
369 --
370   l_proc  varchar2(72) := g_package||'chk_competence';
371   l_exists	varchar2(1);
372 
373   l_business_group_id  number := fnd_profile.value('OTA_HR_GLOBAL_BUSINESS_GROUP_ID');
374   l_hr_cross		 	varchar2(2) := fnd_profile.value('HR_CROSS_BUSINESS_GROUP');
375 
376 --
377  CURSOR csr_competence
378  IS
379  SELECT null
380  FROM PER_COMPETENCES
381  WHERE COMPETENCE_ID = p_competence_id and
382  Business_group_id = l_business_group_id ;
383 
384 CURSOR csr_competence_cross
385 IS
386  SELECT null
387 FROM per_competences
388 WHERE COMPETENCE_ID = p_competence_id and
389 (business_group_id = l_business_group_id OR
390  business_group_id is null);
391 
392 Begin
393   hr_utility.set_location('Entering:'||l_proc, 5);
394   --
395    if l_business_group_id is null then
396       l_business_group_id := p_business_group_id;
397    end if;
398 
399 
400 
401   -- Call all supporting business operations
402   if (((p_competence_language_id is not null) and
403       nvl(ota_ocl_shd.g_old_rec.competence_id,hr_api.g_number) <>
404          nvl(p_competence_id,hr_api.g_number))
405    or (p_competence_language_id is null)) then
406   --
407      hr_utility.set_location('Entering:'||l_proc, 10);
408      if (p_competence_id is not null) then
409          hr_utility.set_location('Entering:'||l_proc, 15);
410          if ( fnd_profile.value('OTA_HR_GLOBAL_BUSINESS_GROUP_ID') is null and
411 		 l_hr_cross ='N') or
412                (fnd_profile.value('OTA_HR_GLOBAL_BUSINESS_GROUP_ID') is not null and
413 		 l_hr_cross = 'N' )then
414             open csr_competence;
415             fetch csr_competence into l_exists;
416             if csr_competence%notfound then
417                close csr_competence;
418                fnd_message.set_name('OTA','OTA_OCL_COMP_NOT_EXIST');
419                fnd_message.raise_error;
420             end if;
421             close csr_competence;
422             hr_utility.set_location('Entering:'||l_proc, 20);
423           elsif ( fnd_profile.value('OTA_HR_GLOBAL_BUSINESS_GROUP_ID') is not null and
424 		 l_hr_cross ='Y') or
425                (fnd_profile.value('OTA_HR_GLOBAL_BUSINESS_GROUP_ID') is null and
426 		 l_hr_cross ='Y' )then
427             hr_utility.set_location('Entering:'||l_proc, 25);
428             open csr_competence_cross;
429             fetch csr_competence_cross into l_exists;
430             if csr_competence_cross%notfound then
431                close csr_competence_cross;
432                fnd_message.set_name('OTA','OTA_OCL_COMP_NOT_EXIST');
433                fnd_message.raise_error;
434             end if;
435             close csr_competence_cross;
436             hr_utility.set_location('Entering:'||l_proc, 30);
437 
438           end if;
439       end if;
440 end if;
441 
442   --
443   --
444   --
445   --
446   hr_utility.set_location(' Leaving:'||l_proc, 35);
447 End chk_competence;
448 
449 -- ----------------------------------------------------------------------------
450 -- |---------------------------< chk_proficiency>----------------------------|
451 -- ----------------------------------------------------------------------------
452 Procedure chk_proficiency
453   (p_competence_language_id 	    in number
454   ,p_effective_date               in date
455   ,p_competence_id                in number
456   ,p_min_proficiency_level_id     in number
457   ) is
458 --
459   l_proc  varchar2(72) := g_package||'chk_proficiency';
460   l_exists	varchar2(1);
461 
462 --
463  CURSOR csr_proficiency
464  IS
465  /*  Modified for bug#4905777
466  SELECT null
467  FROM PER_COMPETENCE_LEVELS_V
468  WHERE COMPETENCE_ID = p_competence_id AND
469  RATING_LEVEL_ID = p_min_proficiency_level_id
470  ;
471  */
472   select null
473  from
474    per_rating_levels prl
475   ,per_competences pce
476 where (prl.rating_scale_id = pce.rating_scale_id
477      OR pce.competence_id = prl.competence_id)
478      AND pce.competence_id = p_competence_id
479      AND prl.rating_level_id = p_min_proficiency_level_id;
480 
481 
482 Begin
483   hr_utility.set_location('Entering:'||l_proc, 5);
484   --
485   -- Call all supporting business operations
486   if (((p_competence_language_id is not null) and
487       nvl(ota_ocl_shd.g_old_rec.min_proficiency_level_id,hr_api.g_number) <>
488          nvl(p_min_proficiency_level_id,hr_api.g_number))
489    or (p_competence_language_id is null)) then
490   --
491      hr_utility.set_location('Entering:'||l_proc, 10);
492      if (p_min_proficiency_level_id is not null) then
493           hr_utility.set_location('Entering:'||l_proc, 15);
494             open csr_proficiency ;
495             fetch csr_proficiency  into l_exists;
496             if csr_proficiency %notfound then
497                close csr_proficiency ;
498                fnd_message.set_name('OTA','OTA_OCL_PROF_LEVEL_NOT_EXIST');
499                fnd_message.raise_error;
500             end if;
501             close csr_proficiency;
502             hr_utility.set_location('Entering:'||l_proc, 20);
503       end if;
504 end if;
505 
506   --
507   --
508   --
509   --
510   hr_utility.set_location(' Leaving:'||l_proc, 10);
511 End chk_proficiency;
512 
513 
514 -- ----------------------------------------------------------------------------
515 -- |------------------------------< chk_language>----------------------------|
516 -- ----------------------------------------------------------------------------
517 Procedure chk_language
518   (p_competence_language_id 	    in number
519   ,p_effective_date               in date
520   ,p_language_code                 in varchar2
521   ) is
522 --
523   l_proc  varchar2(72) := g_package||'chk_language';
524   l_exists	varchar2(1);
525 
526 --
527  CURSOR csr_language
528  IS
529  SELECT null
530  FROM OTA_NATURAL_LANGUAGES_V
531  WHERE LANGUAGE_code = p_language_code;
532 
533 Begin
534   hr_utility.set_location('Entering:'||l_proc, 5);
535   --
536   -- Call all supporting business operations
537   if (((p_competence_language_id is not null) and
538       nvl(ota_ocl_shd.g_old_rec.language_code,hr_api.g_number) <>
539          nvl(p_language_code,hr_api.g_varchar2))
540    or (p_competence_language_id is null)) then
541   --
542      hr_utility.set_location('Entering:'||l_proc, 10);
543      if (p_language_code is not null) then
544           hr_utility.set_location('Entering:'||l_proc, 15);
545             open csr_language;
546             fetch csr_language into l_exists;
547             if csr_language%notfound then
548                close csr_language;
549                fnd_message.set_name('OTA','OTA_OCL_LANG_NOT_EXIST');
550                fnd_message.raise_error;
551             end if;
552             close csr_language;
553             hr_utility.set_location('Entering:'||l_proc, 20);
554       end if;
555 end if;
556 
557   --
558   --
559   --
560   --
561   hr_utility.set_location(' Leaving:'||l_proc, 10);
562 End chk_language;
563 
564 
565 --
566 -- ----------------------------------------------------------------------------
567 -- |---------------------------< insert_validate >----------------------------|
568 -- ----------------------------------------------------------------------------
569 Procedure insert_validate
570   (p_effective_date               in date
571   ,p_rec                          in ota_ocl_shd.g_rec_type
572   ) is
573 --
574   l_proc  varchar2(72) := g_package||'insert_validate';
575 --
576 Begin
577   hr_utility.set_location('Entering:'||l_proc, 5);
578   --
579   -- Call all supporting business operations
580   --
581   hr_api.validate_bus_grp_id(p_rec.business_group_id);  -- Validate Bus Grp
582   --
583   --
584   ota_ocl_bus.chk_ddf(p_rec);
585 
586    check_lang_code(p_rec);
587 
588   chk_competence
589   (p_competence_language_id => p_rec.competence_language_id
590   ,p_effective_date         => p_effective_date
591   ,p_competence_id          => p_rec.competence_id
592   ,p_business_group_id      => p_rec.business_group_id );
593 
594    chk_proficiency
595   (p_competence_language_id 	    => p_rec.competence_language_id
596   ,p_effective_date               => p_effective_date
597   ,p_competence_id                => p_rec.competence_id
598   ,p_min_proficiency_level_id     => p_rec.min_proficiency_level_id
599   ) ;
600 
601   chk_language
602   (p_competence_language_id 	    => p_rec.competence_language_id
603   ,p_effective_date               => p_effective_date
604   ,p_language_code                  => p_rec.language_code
605   ) ;
606   --
607   hr_utility.set_location(' Leaving:'||l_proc, 10);
608 End insert_validate;
609 --
610 -- ----------------------------------------------------------------------------
611 -- |---------------------------< update_validate >----------------------------|
612 -- ----------------------------------------------------------------------------
613 Procedure update_validate
614   (p_effective_date               in date
615   ,p_rec                          in ota_ocl_shd.g_rec_type
616   ) is
617 --
618   l_proc  varchar2(72) := g_package||'update_validate';
619 --
620 Begin
621   hr_utility.set_location('Entering:'||l_proc, 5);
622   --
623   -- Call all supporting business operations
624   --
625   hr_api.validate_bus_grp_id(p_rec.business_group_id);  -- Validate Bus Grp
626   --
627   chk_non_updateable_args
628     (p_effective_date              => p_effective_date
629       ,p_rec              => p_rec
630     );
631   --
632   --
633    check_lang_code(p_rec);
634   ota_ocl_bus.chk_ddf(p_rec);
635  --
636  chk_competence
637   (p_competence_language_id => p_rec.competence_language_id
638   ,p_effective_date         => p_effective_date
639   ,p_competence_id          => p_rec.competence_id
640   ,p_business_group_id      => p_rec.business_group_id );
641 
642    chk_proficiency
643   (p_competence_language_id 	    => p_rec.competence_language_id
644   ,p_effective_date               => p_effective_date
645   ,p_competence_id                => p_rec.competence_id
646   ,p_min_proficiency_level_id     => p_rec.min_proficiency_level_id
647   ) ;
648 
649   chk_language
650   (p_competence_language_id 	    => p_rec.competence_language_id
651   ,p_effective_date               => p_effective_date
652   ,p_language_code                 => p_rec.language_code
653   ) ;
654 
655 
656   --
657   hr_utility.set_location(' Leaving:'||l_proc, 10);
658 End update_validate;
659 --
660 -- ----------------------------------------------------------------------------
661 -- |---------------------------< delete_validate >----------------------------|
662 -- ----------------------------------------------------------------------------
663 Procedure delete_validate
664   (p_rec                          in ota_ocl_shd.g_rec_type
665   ) is
666 --
667   l_proc  varchar2(72) := g_package||'delete_validate';
668 --
669 Begin
670   hr_utility.set_location('Entering:'||l_proc, 5);
671   --
672   -- Call all supporting business operations
673   --
674   hr_utility.set_location(' Leaving:'||l_proc, 10);
675 End delete_validate;
676 --
677 end ota_ocl_bus;