DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_ES_CREATE_PERSON

Source


1 package body PER_ES_CREATE_PERSON as
2 /* $Header: peesconp.pkb 120.1 2006/09/14 13:49:35 mgettins noship $ */
3 g_package   VARCHAR2(30) := 'PER_ES_CREATE_PERSON.';
4 
5 --         p_first_last_name                p_last_name
6 --         p_identifier_type           p_per_information2
7 --         p_identifier_value          p_per_information3
8 PROCEDURE create_es_person (p_last_name           VARCHAR2
9                            ,p_first_name          VARCHAR2
10                            ,p_national_identifier VARCHAR2
11                            ,p_per_information1    VARCHAR2
12                            ,p_per_information2    VARCHAR2
13                            ,p_per_information3    VARCHAR2) is
14 
15 Cursor get_lookup_type(p_per_information2 varchar2) is
16        select lookup_code from hr_lookups where
17        lookup_type='ES_IDENTIFIER_TYPE'
18        and  lookup_code=p_per_information2;
19 
20 l_identifier_type   hr_lookups.lookup_code%TYPE;
21 l_identifier_value  VARCHAR2(10);
22 l_proc              VARCHAR2(72) := g_package||'CREATE_ES_PERSON';
23 l_national_identifier per_all_people_f.national_identifier%TYPE;
24 
25 BEGIN
26    --
27    -- Added for GSI Bug 5472781
28    --
29    IF hr_utility.chk_product_install('Oracle Human Resources', 'ES') THEN
30      --
31         hr_api.mandatory_arg_error
32            (p_api_name         => l_proc,
33             p_argument         => hr_general.decode_lookup('ES_FORM_LABELS','LAST_NAME_1'),
34             p_argument_value   => p_last_name
35            );
36 
37         /*IF  p_per_information3 IS NOT NULL AND
38             p_per_information2 IS NULL THEN
39             hr_utility.set_message(800, 'HR_ES_REQ_NIF_IDT_MISSING');
40             hr_utility.raise_error;
41         ELSIF  p_per_information2 IS NOT NULL AND
42             p_per_information3 IS NULL THEN
43             hr_utility.set_message(800, 'HR_ES_REQ_NIF_IDT_MISSING');
44             hr_utility.raise_error;
45         END IF;
46         --
47         IF  p_national_identifier IS NULL THEN
48             IF  p_per_information3 IS NULL THEN
49             hr_utility.set_message(800, 'HR_ES_REQ_NIF_IDT_MISSING');
50             hr_utility.raise_error;
51             END IF;
52         ELSE
53             l_national_identifier := hr_es_utility.check_NIF(p_national_identifier);
54         END IF;
55 
56         IF  p_per_information2 IS NOT NULL THEN
57             OPEN get_lookup_type(p_per_information2);
58             FETCH get_lookup_type into l_identifier_type;
59             IF  get_lookup_type%NOTFOUND THEN
60                 hr_utility.set_message(800,'HR_ES_INVALID_VALUE'||p_per_information2||'..'||p_per_information3||'..'||p_national_identifier);
61                 hr_utility.set_message_token(800,'FIELD','Identifier Type');
62                 hr_utility.raise_error;
63             ELSE
64                 l_identifier_value := hr_es_utility.validate_identifier(p_per_information2,p_per_information3);
65             END IF;
66         END IF;*/
67 
68        IF  length(p_last_name)>40 THEN
69          hr_utility.set_message(800, 'HR_289712_UTF8_LENGTH_EXCEEDED');
70          hr_utility.set_message_token('COLUMN_NAME',hr_general.decode_lookup('ES_FORM_LABELS','LAST_NAME_1'));
71          hr_utility.set_message_token('COLUMN_VALUE',p_last_name);
72          hr_utility.set_message_token('MAX_LENGTH','40');
73          hr_utility.raise_error;
74        END IF;
75 
76        IF  length(p_first_name)>40 THEN
77          hr_utility.set_message(800, 'HR_289712_UTF8_LENGTH_EXCEEDED');
78          hr_utility.set_message_token('COLUMN_NAME',hr_general.decode_lookup('ES_FORM_LABELS','NAME'));
79          hr_utility.set_message_token('COLUMN_VALUE',p_first_name);
80          hr_utility.set_message_token('MAX_LENGTH','40');
81          hr_utility.raise_error;
82        END IF;
83 
84        IF  length(p_per_information1)>40 THEN
85          hr_utility.set_message(800, 'HR_289712_UTF8_LENGTH_EXCEEDED');
86          hr_utility.set_message_token('COLUMN_NAME',hr_general.decode_lookup('ES_FORM_LABELS','LAST_NAME_2'));
87          hr_utility.set_message_token('COLUMN_VALUE',p_per_information1);
88          hr_utility.set_message_token('MAX_LENGTH','40');
89          hr_utility.raise_error;
90        END IF;
91     --
92   END IF;
93   --
94 END create_es_person;
95 
96 END PER_ES_CREATE_PERSON;