DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_PSS_BUS

Source


1 Package Body per_pss_bus as
2 /* $Header: pepssrhi.pkb 120.1 2006/08/08 11:27:06 amigarg noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  per_pss_bus.';  -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |-----------------------< chk_salary_survey_id >---------------------------|
12 -- ----------------------------------------------------------------------------
13 --
14 -- Description
15 --   This procedure is used to check that the primary key for the table
16 --   is created properly. It should be null on insert and
17 --   should not be able to be updated.  It is mandatory.
18 --
19 -- Pre Conditions
20 --   None.
21 --
22 -- In Parameters
23 --   salary_survey_id PK of record being inserted or updated.
24 --   object_version_number Object version number of record being
25 --                         inserted or updated.
26 --
27 -- Post Success
28 --   Processing continues
29 --
30 -- Post Failure
31 --   Errors handled by the procedure
32 --
33 -- Access Status
34 --   Internal row handler use only.
35 --
36 Procedure chk_salary_survey_id(p_salary_survey_id      in number,
37                                p_object_version_number in number) is
38   --
39   l_proc         varchar2(72) := g_package||'chk_salary_survey_id';
40   l_api_updating boolean;
41   --
42 Begin
43   --
44   hr_utility.set_location('Entering:'||l_proc, 5);
45   --
46   l_api_updating := per_pss_shd.api_updating
47     (p_salary_survey_id            => p_salary_survey_id,
48      p_object_version_number       => p_object_version_number);
49   --
50   if (l_api_updating
51      and nvl(p_salary_survey_id,hr_api.g_number)
52      <>  per_pss_shd.g_old_rec.salary_survey_id) then
53     --
54     -- raise error as PK has changed
55     --
56     per_pss_shd.constraint_error('PER_SALARY_SURVEYS_PK');
57     --
58   elsif not l_api_updating then
59     --
60     -- check if PK is null
61     --
62     if p_salary_survey_id is not null then
63       --
64       -- raise error as PK is not null
65       --
66       per_pss_shd.constraint_error('PER_SALARY_SURVEYS_PK');
67       --
68     end if;
69     --
70   end if;
71   --
72   hr_utility.set_location('Leaving:'||l_proc, 10);
73   --
74 End chk_salary_survey_id;
75 --
76 --
77 -- ----------------------------------------------------------------------------
78 -- |--------------------< chk_survey_name_company_code >----------------------|
79 -- ----------------------------------------------------------------------------
80 --
81 -- Description
82 --   This procedure is used to check that survey_name and
83 --   survey_company_code:
84 --     a) Are not null since they are mandatory.
85 --     b) Form a unique combination.
86 --
87 -- Pre Requisites
88 --   None.
89 --
90 -- In Parameters
91 --   salary_survey_id
92 --   object_version_number
93 --   survey_name
94 --   survey_company_code.
95 --
96 -- Post Success
97 --   Processing continues if the survey_name and survey_company_code are not
98 --   null and the combination is valid.
99 --
100 -- Post Failure
101 --   An application error is raised and processing is terminated if the
102 --   survey_name or survey_company_code are null or combination is invalid.
103 --
104 -- Developer/Implementation Notes
105 --   None.
109 --
106 --
107 -- Access Status
108 --   Internal row handler use only.
110 Procedure chk_survey_name_company_code
111 (p_salary_survey_id      in number,
112  p_object_version_number in number,
113  p_survey_name           in per_salary_surveys.survey_name%TYPE,
114  p_survey_company_code   in per_salary_surveys.survey_company_code%TYPE) is
115   --
116   l_proc         varchar2(72) := g_package||'chk_survey_name_company_code';
117   l_api_updating boolean;
118   l_exists       varchar2(1);
119   --
120   cursor csr_unique_surv_name_comp_code is
121     select null
122     from   per_salary_surveys
123     where upper(survey_name)   = upper(p_survey_name)
124     and    survey_company_code = p_survey_company_code
125     and    salary_survey_id <> nvl(p_salary_survey_id,hr_api.g_number);
126   --
127 Begin
128   --
129   hr_utility.set_location('Entering:'||l_proc, 5);
130   --
131   -- Check that survey_name is not null.  Error if it is.
132   --
133   if p_survey_name is null then
134     fnd_message.set_name('PER','PER_50331_PSS_MAND_SURV_NAME');
135     fnd_message.raise_error;
136   end if;
137   --
138   hr_utility.set_location('Entering:'||l_proc, 10);
139   --
140   -- Check that survey_company_code is not null.  Error if it is.
141   --
142   if p_survey_company_code is null then
143     fnd_message.set_name('PER','PER_50332_PSS_MAND_SURV_COMP');
144     fnd_message.raise_error;
145   end if;
146   --
147   hr_utility.set_location('Entering:'||l_proc, 15);
148   --
149   --  Only proceed with validation if:
150   --   The current g_old_rec is current and
151   --   The survey_name value has changed or
152   --   The survey_company_code value has changed or
153   --   A record is being inserted
154   --
155   l_api_updating := per_pss_shd.api_updating
156     (p_salary_survey_id      => p_salary_survey_id
157     ,p_object_version_number => p_object_version_number
158     );
159   --
160   hr_utility.set_location(l_proc, 20);
161   --
162   if ((l_api_updating
163         and nvl(per_pss_shd.g_old_rec.survey_name, hr_api.g_varchar2)
164         <>  nvl(p_survey_name,hr_api.g_varchar2))
165      or
166       (l_api_updating and
167            nvl(per_pss_shd.g_old_rec.survey_company_code,hr_api.g_varchar2)
168         <> nvl(p_survey_company_code,hr_api.g_varchar2))
169      or
170        (NOT l_api_updating))
171   then
172     --
173     -- c) Check that survey_name forms a unique combination with
174     --    survey_company_code.
175     --
176     hr_utility.set_location(l_proc, 25);
177     --
178     open csr_unique_surv_name_comp_code;
179     --
180     fetch csr_unique_surv_name_comp_code into l_exists;
181     --
182     if csr_unique_surv_name_comp_code%found then
183         --
184         per_pss_shd.constraint_error(p_constraint_name =>
185                                      'PER_SALARY_SURVEYS_UK1');
186         --
187     end if;
188     --
189     hr_utility.set_location(l_proc, 30);
190     --
191    end if;
192    --
193    hr_utility.set_location('Leaving:'||l_proc, 35);
194    --
195 End chk_survey_name_company_code;
196 --
197 -- ---------------------------------------------------------------
198 -- |-----------------< chk_survey_company_code >-----------------|
199 -- ---------------------------------------------------------------
200 --
201 -- Description
202 --   This procedure is used to check that survey_company_code:
203 --     a) Exists in hr_standard_lookups for lookup_type 'SURVEY_COMPANY'.
204 --
205 -- Pre Requisites
206 --   None.
207 --
208 -- In Parameters
209 --   salary_survey_id
210 --   survey_company_code.
211 --   p_effective_date (used as parameter for not_exists in
212 --                     hr_standard_lookups)
213 --
214 -- Post Success
215 --   Processing continues if the survey_company_code
216 --   exists in hr_standard_lookups.
217 --
218 -- Post Failure
219 --  An application error is raised and processing is terminated
220 --  if the survey_company_code does not exist in hr_standard_lookups.
221 --
222 -- Developer/Implementation Notes
223 --   None.
224 --
225 -- Access Status
226 --   Internal row handler use only.
227 --
228 procedure chk_survey_company_code
229 (p_salary_survey_id in per_salary_surveys.salary_survey_id%TYPE
230 ,p_survey_company_code
231                     in per_salary_surveys.survey_company_code%TYPE
232 ,p_effective_date   in date
233   ) is
234 --
235   l_proc           varchar2(72)  :=
236                              g_package||'chk_survey_company_code';
237   l_api_updating   boolean;
238 --
239 begin
240   hr_utility.set_location('Entering:'|| l_proc, 10);
241   --
242   -- Check mandatory parameters have been set
243   --
244   hr_api.mandatory_arg_error
245     (p_api_name       => l_proc
246     ,p_argument       => 'effective date'
247     ,p_argument_value => p_effective_date
248     );
249   --
250   -- Only proceed with validation if:
251   -- a) During update, the value has actually changed to
252   --    another not null value.
253   -- b) This is an insert.
254   --
255   if (((p_salary_survey_id is not null) and
256        nvl(per_pss_shd.g_old_rec.survey_company_code,
257            hr_api.g_varchar2) <> nvl(p_survey_company_code,
258                                      hr_api.g_varchar2))
259     or
260       (p_salary_survey_id is null)) then
261     --
262     hr_utility.set_location(l_proc, 20);
263     --
264     --  If survey_company_code is not null then
265     --  Check if the survey_company_code value exists
266     --  in hr_standard_lookups where the lookup_type is 'SURVEY_COMPANY'
267     --
268     if p_survey_company_code is not null then
269       -- code commented for bug5439193 by amigarg
270       --if hr_api.not_exists_in_hrstanlookups
271       if hr_api.not_exists_in_hr_lookups
272           (p_effective_date        => p_effective_date
273            ,p_lookup_type           => 'SURVEY_COMPANY'
274            ,p_lookup_code           => p_survey_company_code
275            ) then
276         --  Error: Invalid Survey Company
277         fnd_message.set_name('PER', 'PER_50333_PSS_INV_SURV_COMP');
278         fnd_message.raise_error;
279       end if;
280       -- code change ended  for bug5439193 by amigarg
281       --
282       hr_utility.set_location(l_proc, 30);
283       --
284     end if;
285   end if;
286   --
287   hr_utility.set_location(' Leaving:'|| l_proc, 40);
288   --
289 end chk_survey_company_code;
290 --
291 -- ---------------------------------------------------------------
292 -- |----------------------< chk_identifier >---------------------|
293 -- ---------------------------------------------------------------
294 --
295 -- Description
296 --   This procedure is used to check that identifier:
297 --     a) Is not null.
298 --
299 -- Pre Requisites
300 --   None.
301 --
302 -- In Parameters
303 --   salary_survey_id
304 --   identifier.
305 --
306 -- Post Success
307 --   Processing continues if the identifier is not null.
308 --
309 -- Post Failure
310 --  An application error is raised and processing is terminated
311 --  if the identifier is null.
312 --
313 -- Developer/Implementation Notes
314 --   None.
315 --
316 -- Access Status
317 --   Internal row handler use only.
318 --
319 procedure chk_identifier
320 (p_identifier       in per_salary_surveys.identifier%TYPE) is
321 --
322   l_proc         varchar2(72) := g_package||'chk_identifier';
323   l_api_updating boolean;
324 --
325 begin
326   --
327   hr_utility.set_location('Entering:'||l_proc, 10);
328   --
329   --  Check that identifier is not null.
330   --
331   if p_identifier is null then
332     fnd_message.set_name('PER','PER_50334_PSS_MAND_IDENTIFIER');
333     fnd_message.raise_error;
334   end if;
335   --
336   hr_utility.set_location('Leaving:'||l_proc, 20);
337   --
338 end chk_identifier;
339 --
340 /*ras
341 -- ---------------------------------------------------------------
342 -- |--------------------< chk_currency_code >--------------------|
343 -- ---------------------------------------------------------------
344 --
345 -- Description
346 --   This procedure is used to check that currency_code:
347 --     a) Is not null.
348 --     a) Exists in fnd_currencies_v;.
349 --
350 -- Pre Requisites
351 --   None.
352 --
353 -- In Parameters
354 --   salary_survey_id
355 --   currency_code
356 --   p_effective_date
357 --
358 -- Post Success
359 --   Processing continues if the currency_code
360 --   exists in hr_standard_lookups and is not null.
361 --
362 -- Post Failure
363 --  An application error is raised and processing is terminated
364 --  if the currency_code does not exist in hr_standard_lookups or is null.
365 --
366 -- Developer/Implementation Notes
367 --   None.
368 --
369 -- Access Status
370 --   Internal row handler use only.
371 --
372 procedure chk_currency_code
373 (p_salary_survey_id in per_salary_surveys.salary_survey_id%TYPE
374 ,p_currency_code
375                     in per_salary_surveys.currency_code%TYPE) is
376 --
377   l_proc           varchar2(72)  :=
378                              g_package||'chk_currency_code';
379   --
380   l_api_updating   boolean;
381   --
382   l_exists         varchar2(1);
383   --
384   cursor csr_currency_exists is
385     select null
386     from   fnd_currencies_vl fcv
387     where  fcv.currency_code = p_currency_code;
388 --
389 begin
390   hr_utility.set_location('Entering:'|| l_proc, 10);
391   hr_utility.set_location(l_proc, 15);
392   --
393   -- Check that currency_code is not null
394   --
395   if p_currency_code is null then
396     fnd_message.set_name('PER','PER_50335_PSS_MAND_CURRENCY');
397     fnd_message.raise_error;
398   end if;
399   --
400   hr_utility.set_location(l_proc, 17);
401   --
402   -- Only proceed with validation if:
403   -- a) During update, the value has actually changed to
404   --    another not null value.
405   -- b) This is an insert.
406   --
407   if (((p_salary_survey_id is not null) and
408        nvl(per_pss_shd.g_old_rec.currency_code,
409            hr_api.g_varchar2) <> nvl(p_currency_code,
410                                      hr_api.g_varchar2))
411     or
412       (p_salary_survey_id is null)) then
413     --
414     hr_utility.set_location(l_proc, 20);
415     --
416     --  If currency_code is not null then
417     --  Check if the currency_code value exists
418     --  in fnd_currencies_vl.
419     --
420     open csr_currency_exists;
421     --
422     fetch csr_currency_exists into l_exists;
423     --
424     if csr_currency_exists%notfound then
425       --
426       --  Error: Invalid Currency
427       --
428       fnd_message.set_name('PER', 'PER_50336_PSS_INV_CURRENCY');
429       --
430       fnd_message.raise_error;
431       --
432     end if;
433     --
434     hr_utility.set_location(l_proc, 30);
435     --
436   end if;
437   --
438   hr_utility.set_location(' Leaving:'|| l_proc, 40);
439   --
440 end chk_currency_code; ras */
441 --
442 -- ---------------------------------------------------------------
443 -- |------------------< chk_survey_type_code >-------------------|
444 -- ---------------------------------------------------------------
445 --
446 -- Description
447 --   This procedure is used to check that survey_type_code:
448 --     a) Is not null.
449 --     b) Exists in hr_standard_lookups for lookup_type 'PAY_BASIS'.
450 --
451 -- Pre Requisites
452 --   None.
453 --
454 -- In Parameters
455 --   salary_survey_id
456 --   survey_type_code.
457 --   p_effective_date (used as parameter for not_exists in
458 --                     hr_standard_lookups)
459 --
460 -- Post Success
461 --   Processing continues if the survey_type_code
462 --   exists in hr_standard_lookups.
463 --
464 -- Post Failure
465 --  An application error is raised and processing is terminated
466 --  if the survey_type_code does not exist in hr_standard_lookups.
467 --
468 -- Developer/Implementation Notes
469 --   None.
470 --
471 -- Access Status
472 --   Internal row handler use only.
473 --
474 procedure chk_survey_type_code
475 (p_salary_survey_id in per_salary_surveys.salary_survey_id%TYPE
476 ,p_survey_type_code
477                     in per_salary_surveys.survey_type_code%TYPE
478 ,p_effective_date   in date
479   ) is
480 --
481   l_proc           varchar2(72)  :=
482                              g_package||'chk_survey_type_code';
483   l_api_updating   boolean;
484 --
485 begin
486   hr_utility.set_location('Entering:'|| l_proc, 10);
487   --
488   -- Check mandatory parameters have been set
489   --
490   hr_api.mandatory_arg_error
491     (p_api_name       => l_proc
492     ,p_argument       => 'effective date'
493     ,p_argument_value => p_effective_date
494     );
495   --
496   -- Check that survey_type_code is not null.
497   --
498   if p_survey_type_code is null then
499     fnd_message.set_name('PER', 'PER_50337_PSS_MAND_SURV_TYPE');
500     fnd_message.raise_error;
501   end if;
502   --
503   hr_utility.set_location('Entering:'|| l_proc, 15);
504   --
505   -- Only proceed with validation if:
506   -- a) During update, the value has actually changed to
507   --    another not null value.
508   -- b) This is an insert.
509   --
510   if (((p_salary_survey_id is not null) and
511        nvl(per_pss_shd.g_old_rec.survey_type_code,
512            hr_api.g_varchar2) <> nvl(p_survey_type_code,
513                                      hr_api.g_varchar2))
514     or
515       (p_salary_survey_id is null)) then
516     --
517     hr_utility.set_location(l_proc, 20);
518     --
519     --  If survey_type_code is not null then
520     --  Check if the survey_type_code value exists
521     --  in hr_standard_lookups where the lookup_type is 'PAY_BASIS'
522     --
523     if hr_api.not_exists_in_hrstanlookups
524          (p_effective_date        => p_effective_date
525          ,p_lookup_type           => 'PAY_BASIS'
526          ,p_lookup_code           => p_survey_type_code
527          ) then
528       --  Error: Invalid Survey TYPE
529       fnd_message.set_name('PER', 'PER_50338_PSS_INV_SURV_TYPE');
530       fnd_message.raise_error;
531     end if;
532     --
533     hr_utility.set_location(l_proc, 30);
534     --
535   end if;
536   --
537   hr_utility.set_location(' Leaving:'|| l_proc, 40);
538   --
539 end chk_survey_type_code;
540 
541 --
542 -- ----------------------------------------------------------------------------
543 -- |-------------------------------< chk_delete >-----------------------------|
544 -- ----------------------------------------------------------------------------
545 -- {Start Of Comments}
546 --
547 -- Description:
548 --   This procedure is used to ensure that no rows may be deleted if there are
549 --   rows in PER_SALARY_SURVEY_LINES with matching salary_survey_id.
550 --
551 -- Pre Conditions:
552 --   None.
553 --
554 -- In Arguments:
555 --   salary_survey_id
556 --
557 -- Post Success:
558 --   Processing continues if there are no rows in salary_survey_lines with
559 --   matcing salary_survey_id.
560 --
561 -- Post Failure:
562 --   An application error is raised if there are  rows in
563 --   salary_survey_lines with matcing salary_survey_id.
564 --
565 -- Access Status
566 --   Internal row handler use only.
567 --
568 -- {End Of Comments}
569 
570 Procedure chk_delete(p_salary_survey_id
571                                in per_salary_surveys.salary_survey_id%TYPE) is
572 --
573   l_proc     varchar2(72) := g_package||'chk_delete';
574   l_exists   varchar2(1);
575   --
576   cursor csr_survey_line_exists is
577          select null
578          from   per_salary_survey_lines ssl
579          where  ssl.salary_survey_id = p_salary_survey_id;
580   --
581 --
582 Begin
583   --
584   hr_utility.set_location('Entering:'||l_proc, 10);
585   --
586   open csr_survey_line_exists;
587   --
588   fetch csr_survey_line_exists into l_exists;
589   --
590   if csr_survey_line_exists%found then
591     --
592     close csr_survey_line_exists;
593     --
594     fnd_message.set_name('PER','PER_50339_PSS_INV_DEL');
595     fnd_message.raise_error;
596     --
597   end if;
598   --
599   close csr_survey_line_exists;
600   --
601   hr_utility.set_location('Entering:'||l_proc, 20);
602   --
603 End chk_delete;
604 --
605 --
606 -- ----------------------------------------------------------------------------
607 -- |----------------------< chk_non_updateable_args >-----------------------|
608 -- ----------------------------------------------------------------------------
609 -- {Start Of Comments}
610 --
611 -- Description:
612 --   This procedure is used to ensure that non updateable attributes have
613 --   not been updated. If an attribute has been updated an error is generated.
614 --
615 -- Pre Conditions:
616 --   g_old_rec has been populated with details of the values currently in
617 --   the database.
618 --
619 -- In Arguments:
620 --   p_rec has been populated with the updated values the user would like the
621 --   record set to.
622 --
623 -- Post Success:
624 --   Processing continues if all the non updateable attributes have not
625 --   changed.
626 --
627 -- Post Failure:
628 --   An application error is raised if any of the non updateable attributes
629 --   (survey_company_code, identifier)
630 --   have been altered.
631 --
632 -- {End Of Comments}
633 
634 Procedure chk_non_updateable_args
635   (p_rec             in per_pss_shd.g_rec_type,
636    p_effective_date  in date
637   ) is
638 --
639   l_proc     varchar2(72) := g_package||'chk_non_updateable_args';
640   l_error    exception;
641   l_argument varchar2(30);
642 --
643 Begin
644   hr_utility.set_location('Entering:'||l_proc, 10);
645   --
646   -- Only proceed with validation if a row exists for
647   -- the current record in the HR Schema
648   --
649   if not per_pss_shd.api_updating
650       (p_salary_survey_id          => p_rec.salary_survey_id
651       ,p_object_version_number     => p_rec.object_version_number
652       ) then
653     hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
654     hr_utility.set_message_token('PROCEDURE', l_proc);
655     hr_utility.set_message_token('STEP', '20');
656   end if;
657   --
658   hr_utility.set_location(l_proc, 30);
659   --
660   if nvl(p_rec.survey_company_code, hr_api.g_varchar2) <>
661      nvl(per_pss_shd.g_old_rec.survey_company_code,hr_api.g_varchar2)
662   then
663      l_argument := 'survey_company_code';
664      raise l_error;
665   end if;
666   --
667   hr_utility.set_location(l_proc, 40);
668   --
669   if nvl(p_rec.identifier, hr_api.g_varchar2) <>
670      nvl(per_pss_shd.g_old_rec.identifier,hr_api.g_varchar2)
671   then
672      l_argument := 'identifier';
673      raise l_error;
674   end if;
675   --
676   hr_utility.set_location(l_proc, 50);
677   --
678 exception
679     when l_error then
680        hr_api.argument_changed_error
681          (p_api_name => l_proc
682          ,p_argument => l_argument
683          );
684     when others then
685        raise;
686   hr_utility.set_location(' Leaving:'||l_proc, 60);
687 end chk_non_updateable_args;
688 --
689 --
690 --
691 -- -----------------------------------------------------------------------
692 -- |------------------------------< chk_df >-----------------------------|
693 -- -----------------------------------------------------------------------
694 --
695 -- Description:
696 --   Validates the all Descriptive Flexfield values.
697 --
698 -- Pre-conditions:
699 --   All other columns have been validated. Must be called as the
700 --   last step from insert_validate and update_validate.
701 --
702 -- In Arguments:
703 --   p_rec
704 --
705 -- Post Success:
706 --   If the Descriptive Flexfield structure column and data values are
707 --   all valid this procedure will end normally and processing will
708 --   continue.
709 --
710 -- Post Failure:
711 --   If the Descriptive Flexfield structure column value or any of
712 --   the data values are invalid then an application error is raised as
713 --   a PL/SQL exception.
714 --
715 -- Access Status:
716 --   Internal Row Handler Use Only.
717 --
718 procedure chk_df
719   (p_rec in per_pss_shd.g_rec_type) is
720 --
721   l_proc    varchar2(72) := g_package||'chk_df';
722 --
723 begin
724   hr_utility.set_location('Entering:'||l_proc, 10);
725   --
726   if ((p_rec.salary_survey_id is not null) and (
727      nvl(per_pss_shd.g_old_rec.attribute_category, hr_api.g_varchar2) <>
728      nvl(p_rec.attribute_category, hr_api.g_varchar2) or
729      nvl(per_pss_shd.g_old_rec.attribute1, hr_api.g_varchar2) <>
730      nvl(p_rec.attribute1, hr_api.g_varchar2) or
731      nvl(per_pss_shd.g_old_rec.attribute2, hr_api.g_varchar2) <>
732      nvl(p_rec.attribute2, hr_api.g_varchar2) or
733      nvl(per_pss_shd.g_old_rec.attribute3, hr_api.g_varchar2) <>
734      nvl(p_rec.attribute3, hr_api.g_varchar2) or
735      nvl(per_pss_shd.g_old_rec.attribute4, hr_api.g_varchar2) <>
736      nvl(p_rec.attribute4, hr_api.g_varchar2) or
737      nvl(per_pss_shd.g_old_rec.attribute5, hr_api.g_varchar2) <>
738      nvl(p_rec.attribute5, hr_api.g_varchar2) or
739      nvl(per_pss_shd.g_old_rec.attribute6, hr_api.g_varchar2) <>
740      nvl(p_rec.attribute6, hr_api.g_varchar2) or
741      nvl(per_pss_shd.g_old_rec.attribute7, hr_api.g_varchar2) <>
742      nvl(p_rec.attribute7, hr_api.g_varchar2) or
743      nvl(per_pss_shd.g_old_rec.attribute8, hr_api.g_varchar2) <>
744      nvl(p_rec.attribute8, hr_api.g_varchar2) or
745      nvl(per_pss_shd.g_old_rec.attribute9, hr_api.g_varchar2) <>
746      nvl(p_rec.attribute9, hr_api.g_varchar2) or
747      nvl(per_pss_shd.g_old_rec.attribute10, hr_api.g_varchar2) <>
748      nvl(p_rec.attribute10, hr_api.g_varchar2) or
749      nvl(per_pss_shd.g_old_rec.attribute11, hr_api.g_varchar2) <>
750      nvl(p_rec.attribute11, hr_api.g_varchar2) or
751      nvl(per_pss_shd.g_old_rec.attribute12, hr_api.g_varchar2) <>
752      nvl(p_rec.attribute12, hr_api.g_varchar2) or
753      nvl(per_pss_shd.g_old_rec.attribute13, hr_api.g_varchar2) <>
754      nvl(p_rec.attribute13, hr_api.g_varchar2) or
755      nvl(per_pss_shd.g_old_rec.attribute14, hr_api.g_varchar2) <>
756      nvl(p_rec.attribute14, hr_api.g_varchar2) or
757      nvl(per_pss_shd.g_old_rec.attribute15, hr_api.g_varchar2) <>
758      nvl(p_rec.attribute15, hr_api.g_varchar2) or
759      nvl(per_pss_shd.g_old_rec.attribute16, hr_api.g_varchar2) <>
760      nvl(p_rec.attribute16, hr_api.g_varchar2) or
761      nvl(per_pss_shd.g_old_rec.attribute17, hr_api.g_varchar2) <>
762      nvl(p_rec.attribute17, hr_api.g_varchar2) or
763      nvl(per_pss_shd.g_old_rec.attribute18, hr_api.g_varchar2) <>
764      nvl(p_rec.attribute18, hr_api.g_varchar2) or
765      nvl(per_pss_shd.g_old_rec.attribute19, hr_api.g_varchar2) <>
766      nvl(p_rec.attribute19, hr_api.g_varchar2) or
767      nvl(per_pss_shd.g_old_rec.attribute20, hr_api.g_varchar2) <>
768      nvl(p_rec.attribute20, hr_api.g_varchar2)))
769      or
770      (p_rec.salary_survey_id is null) then
771     --
772     -- Only execute the validation if absolutely necessary:
773     -- a) During update, the structure column value or any
774     --    of the attribute values have actually changed.
775     -- b) During insert.
776     --
777     hr_dflex_utility.ins_or_upd_descflex_attribs
778       (p_appl_short_name    => 'PER'
779       ,p_descflex_name      => 'PER_SALARY_SURVEYS'
780       ,p_attribute_category => p_rec.attribute_category
781       ,p_attribute1_name    => 'ATTRIBUTE1'
782       ,p_attribute1_value   => p_rec.attribute1
783       ,p_attribute2_name    => 'ATTRIBUTE2'
784       ,p_attribute2_value   => p_rec.attribute2
785       ,p_attribute3_name    => 'ATTRIBUTE3'
786       ,p_attribute3_value   => p_rec.attribute3
787       ,p_attribute4_name    => 'ATTRIBUTE4'
788       ,p_attribute4_value   => p_rec.attribute4
789       ,p_attribute5_name    => 'ATTRIBUTE5'
790       ,p_attribute5_value   => p_rec.attribute5
791       ,p_attribute6_name    => 'ATTRIBUTE6'
792       ,p_attribute6_value   => p_rec.attribute6
793       ,p_attribute7_name    => 'ATTRIBUTE7'
794       ,p_attribute7_value   => p_rec.attribute7
795       ,p_attribute8_name    => 'ATTRIBUTE8'
796       ,p_attribute8_value   => p_rec.attribute8
797       ,p_attribute9_name    => 'ATTRIBUTE9'
798       ,p_attribute9_value   => p_rec.attribute9
799       ,p_attribute10_name   => 'ATTRIBUTE10'
800       ,p_attribute10_value  => p_rec.attribute10
801       ,p_attribute11_name   => 'ATTRIBUTE11'
802       ,p_attribute11_value  => p_rec.attribute11
803       ,p_attribute12_name   => 'ATTRIBUTE12'
804       ,p_attribute12_value  => p_rec.attribute12
805       ,p_attribute13_name   => 'ATTRIBUTE13'
806       ,p_attribute13_value  => p_rec.attribute13
807       ,p_attribute14_name   => 'ATTRIBUTE14'
808       ,p_attribute14_value  => p_rec.attribute14
809       ,p_attribute15_name   => 'ATTRIBUTE15'
810       ,p_attribute15_value  => p_rec.attribute15
811       ,p_attribute16_name   => 'ATTRIBUTE16'
812       ,p_attribute16_value  => p_rec.attribute16
813       ,p_attribute17_name   => 'ATTRIBUTE17'
814       ,p_attribute17_value  => p_rec.attribute17
815       ,p_attribute18_name   => 'ATTRIBUTE18'
816       ,p_attribute18_value  => p_rec.attribute18
817       ,p_attribute19_name   => 'ATTRIBUTE19'
818       ,p_attribute19_value  => p_rec.attribute19
819       ,p_attribute20_name   => 'ATTRIBUTE20'
820       ,p_attribute20_value  => p_rec.attribute20
821       );
822 
823   end if;
824   --
825   hr_utility.set_location(' Leaving:'||l_proc, 20);
826 end chk_df;
827 
828 --
829 -- ----------------------------------------------------------------------------
830 -- |---------------------------< insert_validate >----------------------------|
831 -- ----------------------------------------------------------------------------
832 Procedure insert_validate(p_rec            in per_pss_shd.g_rec_type,
833                           p_effective_date in date) is
834 --
835   l_proc  varchar2(72) := g_package||'insert_validate';
836 --
837 Begin
838   hr_utility.set_location('Entering:'||l_proc, 5);
839   --
840   -- Call all supporting business operations
841   --
842   --   a) Check SALARY_SURVEY_ID.
843   --
844   chk_salary_survey_id(p_salary_survey_id      => p_rec.salary_survey_id
845                       ,p_object_version_number => p_rec.object_version_number);
846   --
847   hr_utility.set_location(l_proc, 10);
848   --
849   --   b) Check SURVEY_NAME and SURVEY_COMPANY_CODE.
850   --
851   chk_survey_name_company_code(p_salary_survey_id => p_rec.salary_survey_id
852   ,p_object_version_number => p_rec.object_version_number
853   ,p_survey_name           => p_rec.survey_name
854   ,p_survey_company_code   => p_rec.survey_company_code);
855   --
856   hr_utility.set_location(l_proc, 15);
857   --
858   --  c) Check SURVEY_COMPANY_CODE specific rules.
859   --
860  chk_survey_company_code(p_salary_survey_id => p_rec.salary_survey_id
861  ,p_survey_company_code => p_rec.survey_company_code
862  ,p_effective_date      => p_effective_date);
863   --
864   hr_utility.set_location(l_proc, 20);
865   --
866   --  d) Check IDENTIFIER.
867   --
868   chk_identifier(p_identifier => p_rec.identifier);
869   --
870   hr_utility.set_location(l_proc, 25);
871   --
872   --  e) Check CURRENCY_CODE.
873   --
874 --ras  chk_currency_code(p_salary_survey_id => p_rec.salary_survey_id
875 --ras                  ,p_currency_code    => p_rec.currency_code);
876   --
877   hr_utility.set_location(l_proc, 27);
878   --
879   --  f) Check SURVEY_TYPE_CODE.
880   --
881   chk_survey_type_code(p_salary_survey_id => p_rec.salary_survey_id
882   ,p_survey_type_code => p_rec.survey_type_code
883   ,p_effective_date   => p_effective_date);
884   --
885   hr_utility.set_location(l_proc, 30);
886   --
887 
888   --
889   -- Call descriptive flexfield validation routines
890   --
891   per_pss_bus.chk_df(p_rec => p_rec);
892   --
893   hr_utility.set_location(' Leaving:'||l_proc, 35);
894   --
895 End insert_validate;
896 --
897 -- ----------------------------------------------------------------------------
898 -- |---------------------------< update_validate >----------------------------|
899 -- ----------------------------------------------------------------------------
900 Procedure update_validate(p_rec in per_pss_shd.g_rec_type,
901                           p_effective_date in date) is
902 --
903   l_proc  varchar2(72) := g_package||'update_validate';
904 --
905 Begin
906   hr_utility.set_location('Entering:'||l_proc, 5);
907   --
908   -- Call all supporting business operations
909   --
910   --   a) Check for non updateable arguments.
911   --
912   chk_non_updateable_args(p_rec => p_rec
913   ,p_effective_date => p_effective_date);
914   --
915   hr_utility.set_location(l_proc, 10);
916   --
917   --   b) Check SALARY_SURVEY_ID.
918   --
919   chk_salary_survey_id(p_salary_survey_id      => p_rec.salary_survey_id
920                       ,p_object_version_number => p_rec.object_version_number);
921   --
922   hr_utility.set_location(l_proc, 15);
923   --
924   --   c) Check SURVEY_NAME and SURVEY_COMPANY_CODE have a unique combination.
925   --
926   chk_survey_name_company_code(p_salary_survey_id => p_rec.salary_survey_id
927   ,p_object_version_number => p_rec.object_version_number
928   ,p_survey_name           => p_rec.survey_name
929   ,p_survey_company_code   => p_rec.survey_company_code);
930   --
931   hr_utility.set_location(l_proc, 20);
932   --
933   --  d) Check CURRENCY_CODE.
934   --
935 --ras  chk_currency_code(p_salary_survey_id => p_rec.salary_survey_id
936 --ras                   ,p_currency_code    => p_rec.currency_code);
937   --
938   hr_utility.set_location(l_proc, 23);
939   --
940   --  e) Check SURVEY_TYPE_CODE.
941   --
942   chk_survey_type_code(p_salary_survey_id => p_rec.salary_survey_id
943   ,p_survey_type_code => p_rec.survey_type_code
944   ,p_effective_date   => p_effective_date);
945   --
946   hr_utility.set_location(l_proc, 25);
947   --
948   --
949   -- Call descriptive flexfield validation routines
950   --
951   per_pss_bus.chk_df(p_rec => p_rec);
952   --
953   hr_utility.set_location(' Leaving:'||l_proc, 35);
954   --
955 End update_validate;
956 --
957 -- ----------------------------------------------------------------------------
958 -- |---------------------------< delete_validate >----------------------------|
959 -- ----------------------------------------------------------------------------
960 Procedure delete_validate(p_rec in per_pss_shd.g_rec_type) is
961 --
962   l_proc  varchar2(72) := g_package||'delete_validate';
963 --
964 Begin
965   hr_utility.set_location('Entering:'||l_proc, 5);
966   --
967   -- Call all supporting business operations
968   --
969   --  Check there are no rows in PER_SALARY_SURVEY_LINES.
970   --
971   chk_delete(p_salary_survey_id => p_rec.salary_survey_id);
972   --
973   hr_utility.set_location(' Leaving:'||l_proc, 10);
974 End delete_validate;
975 --
976 end per_pss_bus;