The following lines contain the word 'select', 'insert', 'update' or 'delete':
function insert_application
70.4 05-JAN-93 SZWILLIA Correction for applicant
assignments
70.5 11-JAN-93 SZWILLIA Corrected date defaulting
70.6 11-JAN-93 SZWILLIA Changed interface to create
business group to accept
structure names not numbers
70.9 20-JAN-93 SZWILLIA Corrected error handling.
70.12 09-MAR-93 SZWILLIA Made insert_org_information
public and added error checking.
70.13 11-MAR-93 NKHAN Added 'exit' to the end
70.17 25-AUG-93 PGOLDTHO Reference to ORG_CLASSIFICATIONS
changed to read ORG_CLASS.
70.20 23-NOV-94 RFINE Suppressed index on business_group_id
70.20 25-JUL-95 AForte Changed tokenised message
PAY_6361_USER_TABLE_UNIQUE
to hard coded message
PAY_7686_USER_JOB_TAB_UNIQUE,
PAY_7683_USER_POS_TABLE_UNIQUE,
PAY_7687_USER_GRADE_TAB_UNIQUE
70.23 17-NOV-95 JTHURING Removed ampersand from change history -
this was causing an
"expected symbol name is missing" error
70.24 02-JUL-96 DKERR Year2000:Made date_from/date_to
parameters on insert_organization_unit
dates instead of varchar2
110.1 05-AUG-97 ALOGUE Change fnd_id_flex_structures
to fnd_id_flex_structures_vl
115.1 19-NOV-98 ALOGUE Change to insert_organization_unit
to insert into hr_all_organization_units
and hr_all_organization_units_tl.
115.2 30-NOV-98 ALOGUE Amend change to insert_organization_unit
as business_group_id not in
HR_ALL_ORGANIZATION_UNITS_TL.
115.4 14-May-19099 mmillmor multi-radix fix to working_hours on position
115.5 05-Oct-1999 SCNair Date track position related changes
115.6 16-Nov-1999 pzwalker changed call
hr_dt_position_api.create_dt_position
to hr_position_api.create_position
================================================================= */
--
--
FUNCTION insert_organization_unit
( P_GROUP VARCHAR2
,P_NAME VARCHAR2
,P_BUSINESS_GROUP_ID NUMBER
,P_COST_ALLOCATION_KEYFLEX_ID NUMBER
,P_LOCATION_ID NUMBER
,P_SOFT_CODING_KEYFLEX_ID NUMBER
,P_DATE_FROM DATE
,P_DATE_TO DATE
,P_INTERNAL_EXTERNAL_FLAG VARCHAR2
,P_INTERNAL_ADDRESS_LINE VARCHAR2
,P_TYPE VARCHAR2
) return NUMBER
IS
--
l_organization_id NUMBER;
SELECT language_code
from fnd_languages
where installed_flag in ('I','B');
hr_utility.set_location('per_db_per_setup.insert_organization_unit',1);
SELECT hr_organization_units_s.nextval
INTO l_organization_id
FROM sys.dual ;
hr_utility.set_location('per_db_per_setup.insert_organization_unit',2);
INSERT INTO HR_ALL_ORGANIZATION_UNITS
(organization_id
,business_group_id
,cost_allocation_keyflex_id
,location_id
,soft_coding_keyflex_id
,date_from
,name
,date_to
,internal_external_flag
,internal_address_line
,type
,last_update_date
,last_updated_by
,last_update_login
,created_by
,creation_date)
SELECT l_organization_id
,DECODE(p_group,'Y',l_organization_id,p_business_group_id)
,p_cost_allocation_keyflex_id
,p_location_id
,p_soft_coding_keyflex_id
,nvl(p_date_from,trunc(SYSDATE))
,p_name
,p_date_to
,p_internal_external_flag
,p_internal_address_line
,p_type
,SYSDATE
,0
,0
,0
,SYSDATE
FROM sys.dual ;
INSERT INTO HR_ALL_ORGANIZATION_UNITS_TL
(organization_id
,language
,source_lang
,name
,last_update_date
,last_updated_by
,last_update_login
,created_by
,creation_date)
SELECT l_organization_id
,language
,userenv('LANG')
,p_name
,SYSDATE
,0
,0
,0
,SYSDATE
FROM sys.dual ;
end insert_organization_unit;
FUNCTION insert_org_information
( P_ORGANIZATION_ID NUMBER
,P_ORG_INFORMATION_CONTEXT VARCHAR2
,P_ORG_INFORMATION1 VARCHAR2
,P_ORG_INFORMATION2 VARCHAR2 DEFAULT null
,P_ORG_INFORMATION3 VARCHAR2 DEFAULT null
,P_ORG_INFORMATION4 VARCHAR2 DEFAULT null
,P_ORG_INFORMATION5 VARCHAR2 DEFAULT null
,P_ORG_INFORMATION6 VARCHAR2 DEFAULT null
,P_ORG_INFORMATION7 VARCHAR2 DEFAULT null
,P_ORG_INFORMATION8 VARCHAR2 DEFAULT null
,P_ORG_INFORMATION9 VARCHAR2 DEFAULT null
,P_ORG_INFORMATION10 VARCHAR2 DEFAULT null
,P_ORG_INFORMATION11 VARCHAR2 DEFAULT null
,P_ORG_INFORMATION12 VARCHAR2 DEFAULT null
,P_ORG_INFORMATION13 VARCHAR2 DEFAULT null
,P_ORG_INFORMATION14 VARCHAR2 DEFAULT null
,P_ORG_INFORMATION15 VARCHAR2 DEFAULT null
,P_ORG_INFORMATION16 VARCHAR2 DEFAULT null
,P_ORG_INFORMATION17 VARCHAR2 DEFAULT null
,P_ORG_INFORMATION18 VARCHAR2 DEFAULT null
,P_ORG_INFORMATION19 VARCHAR2 DEFAULT null
,P_ORG_INFORMATION20 VARCHAR2 DEFAULT null
) return NUMBER
IS
--
l_org_information_id NUMBER;
hr_utility.trace('Entered insert_org_information');
hr_utility.set_location('per_db_per_setup.insert_org_information',1);
hr_utility.set_message_token('PROCEDURE','insert_org_information');
hr_utility.set_location('per_db_per_setup.insert_org_information',5);
SELECT organization_id
INTO l_organization_id
FROM hr_organization_units
WHERE organization_id = p_organization_id;
hr_utility.set_location('per_db_per_setup.insert_org_information',8);
SELECT lookup_code
INTO l_org_information1
FROM hr_lookups
WHERE lookup_type = 'ORG_CLASS'
AND lookup_code = p_org_information1;
hr_utility.set_location('per_db_per_setup.insert_org_information',10);
SELECT oit.org_information_type
INTO l_org_information_type
FROM hr_organization_information hoi
, hr_org_info_types_by_class tbc
, hr_org_information_types oit
WHERE oit.org_information_type = p_org_information_context
AND oit.org_information_type = tbc.org_information_type
AND tbc.org_classification = hoi.org_information1
AND hoi.org_information_context = 'CLASS'
AND hoi.organization_id = l_organization_id;
hr_utility.set_message_token('PROCEDURE','insert_org_information');
hr_utility.set_location('per_db_per_setup.insert_org_information',15);
SELECT 'Y'
INTO l_check
FROM hr_organization_information
WHERE organization_id = l_organization_id
AND org_information_context = l_org_information_type
AND org_information1 = l_org_information1;
hr_utility.set_message_token('PROCEDURE','insert_org_information');
hr_utility.set_location('per_db_per_setup.insert_org_information',20);
SELECT hr_organization_information_s.nextval
INTO l_org_information_id
FROM sys.dual;
hr_utility.set_location('per_db_per_setup.insert_org_information',25);
INSERT INTO HR_ORGANIZATION_INFORMATION
(org_information_id
,organization_id
,attribute_category
,org_information_context
,org_information1
,org_information2
,org_information3
,org_information4
,org_information5
,org_information6
,org_information7
,org_information8
,org_information9
,org_information10
,org_information11
,org_information12
,org_information13
,org_information14
,org_information15
,org_information16
,org_information17
,org_information18
,org_information19
,org_information20
,last_update_date
,last_updated_by
,last_update_login
,created_by
,creation_date)
SELECT l_org_information_id
,hou.organization_id
,p_org_information_context
,p_org_information_context
,p_org_information1
,p_org_information2
,p_org_information3
,p_org_information4
,p_org_information5
,p_org_information6
,p_org_information7
,p_org_information8
,p_org_information9
,p_org_information10
,p_org_information11
,p_org_information12
,p_org_information13
,p_org_information14
,p_org_information15
,p_org_information16
,p_org_information17
,p_org_information18
,p_org_information19
,p_org_information20
,hou.last_update_date
,hou.last_updated_by
,hou.last_update_login
,hou.created_by
,hou.creation_date
FROM hr_organization_units hou
WHERE hou.organization_id = p_organization_id;
end insert_org_information;
SELECT id_flex_num
INTO l_position_num
FROM fnd_id_flex_structures_vl
WHERE id_flex_code = 'POS'
AND id_flex_structure_name = p_position_structure;
SELECT id_flex_num
INTO l_grade_num
FROM fnd_id_flex_structures_vl
WHERE id_flex_code = 'GRD'
AND id_flex_structure_name = p_grade_structure;
SELECT id_flex_num
INTO l_job_num
FROM fnd_id_flex_structures_vl
WHERE id_flex_code = 'JOB'
AND id_flex_structure_name = p_job_structure;
SELECT id_flex_num
INTO l_people_group_num
FROM fnd_id_flex_structures_vl
WHERE id_flex_code = 'GRP'
AND id_flex_structure_name = p_people_group_structure;
SELECT id_flex_num
INTO l_cost_allocation_num
FROM fnd_id_flex_structures_vl
WHERE id_flex_code = 'COST'
AND id_flex_structure_name = p_cost_allocation_structure;
l_business_group_id := insert_organization_unit('Y'
,p_name
,null
,null
,null
,null
,p_date_from
,p_date_to
,'INT'
,p_internal_address_line
,null);
l_org_information_id := per_db_per_setup.insert_org_information(
l_business_group_id
,'CLASS'
,'HR_BG'
,'Y'
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null);
l_org_information_id := per_db_per_setup.insert_org_information(
l_business_group_id
,'Business Group Information'
,p_short_name
,p_method_of_generation_emp_num
,p_method_of_generation_apl_num
,l_grade_num
,l_people_group_num
,l_job_num
,l_cost_allocation_num
,l_position_num
,p_legislation_code
,p_currency_code
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null);
l_org_information_id := per_db_per_setup.insert_org_information(
l_business_group_id
,'Work Day Information'
,p_default_start_time
,p_default_end_time
,p_working_hours
,p_frequency
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null);
SELECT business_group_id
INTO l_business_group_id
FROM per_business_groups
WHERE name = p_business_group;
l_organization_id := insert_organization_unit('N'
,p_name
,l_business_group_id
,null
,p_location_id
,null
,p_date_from
,p_date_to
,p_internal_external_flag
,p_internal_address_line
,p_type);
l_org_information_id := per_db_per_setup.insert_org_information(l_organization_id
,'CLASS'
,'HR_ORG'
,'Y'
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null);
l_org_information_id := per_db_per_setup.insert_org_information(l_organization_id
,'Work Day Information'
,p_default_start_time
,p_default_end_time
,p_working_hours
,p_frequency
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null);
SELECT business_group_id
INTO l_business_group_id
FROM per_business_groups
WHERE name = p_business_group;
l_legal_company_id := insert_organization_unit('N'
,p_name
,l_business_group_id
,null
,p_location_id
,null
,p_date_from
,p_date_to
,null
,p_internal_address_line
,null);
l_org_information_id := per_db_per_setup.insert_org_information(
l_legal_company_id
,'CLASS'
,'HR_ORG'
,'Y'
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null);
l_org_information_id := per_db_per_setup.insert_org_information(
l_legal_company_id
,'CLASS'
,'HR_LEGAL'
,'Y'
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null);
l_org_information_id := per_db_per_setup.insert_org_information(
l_legal_company_id
,'Legal Company Information'
,p_company_federal_identifier
,p_nacha_company_name
,p_nacha_identifier
,p_nacha_discretionary_code
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null
,null);
SELECT 'Y'
INTO job_check
FROM per_jobs jb
WHERE (jb.job_id <> p_job_id
OR p_job_id IS NULL)
AND p_job_name = jb.name
AND p_business_group_id = jb.business_group_id + 0;
FUNCTION insert_job_definition return NUMBER IS
--
l_job_definition_id NUMBER;
hr_utility.set_location('per_db_per_setup.insert_job_definition',1);
SELECT per_job_definitions_s.nextval
INTO l_job_definition_id
FROM sys.dual;
hr_utility.set_location('per_db_per_setup.insert_job_definition',2);
INSERT INTO per_job_definitions
(JOB_DEFINITION_ID
,ID_FLEX_NUM
,SUMMARY_FLAG
,ENABLED_FLAG
,START_DATE_ACTIVE
,END_DATE_ACTIVE
,SEGMENT1
,SEGMENT2
,SEGMENT3
,SEGMENT4
,SEGMENT5
,SEGMENT6
,SEGMENT7
,SEGMENT8
,SEGMENT9
,SEGMENT10
,SEGMENT11
,SEGMENT12
,SEGMENT13
,SEGMENT14
,SEGMENT15
,SEGMENT16
,SEGMENT17
,SEGMENT18
,SEGMENT19
,SEGMENT20
,SEGMENT21
,SEGMENT22
,SEGMENT23
,SEGMENT24
,SEGMENT25
,SEGMENT26
,SEGMENT27
,SEGMENT28
,SEGMENT29
,SEGMENT30)
values
(l_job_definition_id
,l_structure_num
,'Y'
,'N'
,to_date(p_date_from,'DD-MON-YYYY')
,to_date(p_date_to,'DD-MON-YYYY')
,l_segment1 -- p_name for default jobs
,p_segment2
,p_segment3
,p_segment4
,p_segment5
,p_segment6
,p_segment7
,p_segment8
,p_segment9
,p_segment10
,p_segment11
,p_segment12
,p_segment13
,p_segment14
,p_segment15
,p_segment16
,p_segment17
,p_segment18
,p_segment19
,p_segment20
,p_segment21
,p_segment22
,p_segment23
,p_segment24
,p_segment25
,p_segment26
,p_segment27
,p_segment28
,p_segment29
,p_segment30
);
end insert_job_definition;
FUNCTION insert_job RETURN NUMBER IS
--
l_job_id NUMBER;
hr_utility.set_location('per_db_per_setup.insert_job',1);
SELECT per_jobs_s.nextval
INTO l_job_id
FROM sys.dual;
hr_utility.set_location('per_db_per_setup.insert_job',2);
hr_utility.set_location('per_db_per_setup.insert_job',3);
INSERT INTO per_jobs
(JOB_ID
,BUSINESS_GROUP_ID
,JOB_DEFINITION_ID
,DATE_FROM
,DATE_TO
,NAME
,LAST_UPDATE_DATE
,LAST_UPDATED_BY
,LAST_UPDATE_LOGIN
,CREATED_BY
,CREATION_DATE)
values
(l_job_id
,l_business_group_id
,l_job_definition_id
,p_date_from
,p_date_to
,p_name
,SYSDATE
,0
,0
,0
,SYSDATE);
end insert_job;
SELECT business_group_id
, job_structure
INTO l_business_group_id
, l_structure_num
FROM per_business_groups
WHERE name = p_business_group
AND business_group_id <> 0;
l_job_definition_id := insert_job_definition;
l_job_id := insert_job;
SELECT position_id
FROM hr_positions_f
WHERE name = p_name
AND effective_end_date = to_date('31124712', 'ddmmyyyy');
SELECT 'Y'
INTO pos_check
FROM hr_all_positions_f pos
WHERE (pos.position_id <> p_position_id
OR p_position_id IS NULL)
AND p_position_name = pos.name
AND p_business_group_id = pos.business_group_id + 0;
FUNCTION insert_pos_definition return NUMBER IS
--
l_pos_definition_id NUMBER;
hr_utility.set_location('per_db_per_setup.insert_pos_definition',1);
SELECT per_position_definitions_s.nextval
INTO l_pos_definition_id
FROM sys.dual;
hr_utility.set_location('per_db_per_setup.insert_pos_definition',2);
INSERT INTO per_position_definitions
(POSITION_DEFINITION_ID
,ID_FLEX_NUM
,SUMMARY_FLAG
,ENABLED_FLAG
,START_DATE_ACTIVE
,END_DATE_ACTIVE
,SEGMENT1
,SEGMENT2
,SEGMENT3
,SEGMENT4
,SEGMENT5
,SEGMENT6
,SEGMENT7
,SEGMENT8
,SEGMENT9
,SEGMENT10
,SEGMENT11
,SEGMENT12
,SEGMENT13
,SEGMENT14
,SEGMENT15
,SEGMENT16
,SEGMENT17
,SEGMENT18
,SEGMENT19
,SEGMENT20
,SEGMENT21
,SEGMENT22
,SEGMENT23
,SEGMENT24
,SEGMENT25
,SEGMENT26
,SEGMENT27
,SEGMENT28
,SEGMENT29
,SEGMENT30)
values
(l_pos_definition_id
,l_structure_num
,'Y'
,'N'
,p_date_effective
,p_date_end
,l_segment1 -- p_name for a default position
,p_segment2
,p_segment3
,p_segment4
,p_segment5
,p_segment6
,p_segment7
,p_segment8
,p_segment9
,p_segment10
,p_segment11
,p_segment12
,p_segment13
,p_segment14
,p_segment15
,p_segment16
,p_segment17
,p_segment18
,p_segment19
,p_segment20
,p_segment21
,p_segment22
,p_segment23
,p_segment24
,p_segment25
,p_segment26
,p_segment27
,p_segment28
,p_segment29
,p_segment30
);
end insert_pos_definition;
FUNCTION insert_position RETURN NUMBER IS
--
l_position_id NUMBER;
hr_utility.set_location('per_db_per_setup.insert_position',1);
hr_utility.set_location('per_db_per_setup.insert_position',2);
hr_utility.set_location('per_db_per_setup.insert_position',3);
p_program_update_date => l_program_update_date
*/
p_segment1 => l_segment1,
p_segment2 => p_segment2,
p_segment3 => p_segment3,
p_segment4 => p_segment4,
p_segment5 => p_segment5,
p_segment6 => p_segment6,
p_segment7 => p_segment7,
p_segment8 => p_segment8,
p_segment9 => p_segment9,
p_segment10 => p_segment10,
p_segment11 => p_segment11,
p_segment12 => p_segment12,
p_segment13 => p_segment13,
p_segment14 => p_segment14,
p_segment15 => p_segment15,
p_segment16 => p_segment16,
p_segment17 => p_segment17,
p_segment18 => p_segment18,
p_segment19 => p_segment19,
p_segment20 => p_segment20,
p_segment21 => p_segment21,
p_segment22 => p_segment22,
p_segment23 => p_segment23,
p_segment24 => p_segment24,
p_segment25 => p_segment25,
p_segment26 => p_segment26,
p_segment27 => p_segment27,
p_segment28 => p_segment28,
p_segment29 => p_segment29,
p_segment30 => p_segment30
);
end insert_position;
SELECT business_group_id
, position_structure
INTO l_business_group_id
, l_structure_num
FROM per_business_groups
WHERE name = p_business_group
AND business_group_id <> 0;
SELECT job_id
INTO l_job_id
FROM per_jobs
WHERE name = p_job
AND business_group_id + 0 = l_business_group_id;
SELECT organization_id
INTO l_organization_id
FROM per_organization_units
WHERE name = p_organization
AND business_group_id + 0 = l_business_group_id;
SELECT location_id
INTO l_location_id
FROM hr_locations
WHERE location_code = p_location;
l_position_definition_id := insert_pos_definition;
l_position_id := insert_position;
SELECT 'Y'
INTO grd_check
FROM per_grades grd
WHERE (grd.grade_id <> p_grade_id
OR p_grade_id IS NULL)
AND p_grade_name = grd.name
AND p_business_group_id = grd.business_group_id + 0;
FUNCTION insert_grade_definition return NUMBER IS
--
l_grade_definition_id NUMBER;
hr_utility.set_location('per_db_per_setup.insert_grade_definition',1);
SELECT per_grade_definitions_s.nextval
INTO l_grade_definition_id
FROM sys.dual;
hr_utility.set_location('per_db_per_setup.insert_grade_definition',2);
INSERT INTO per_grade_definitions
(GRADE_DEFINITION_ID
,ID_FLEX_NUM
,SUMMARY_FLAG
,ENABLED_FLAG
,START_DATE_ACTIVE
,END_DATE_ACTIVE
,SEGMENT1
,SEGMENT2
,SEGMENT3
,SEGMENT4
,SEGMENT5
,SEGMENT6
,SEGMENT7
,SEGMENT8
,SEGMENT9
,SEGMENT10
,SEGMENT11
,SEGMENT12
,SEGMENT13
,SEGMENT14
,SEGMENT15
,SEGMENT16
,SEGMENT17
,SEGMENT18
,SEGMENT19
,SEGMENT20
,SEGMENT21
,SEGMENT22
,SEGMENT23
,SEGMENT24
,SEGMENT25
,SEGMENT26
,SEGMENT27
,SEGMENT28
,SEGMENT29
,SEGMENT30)
values
(l_grade_definition_id
,l_structure_num
,'Y'
,'N'
,p_date_from
,p_date_to
,l_segment1 -- p_name for default grades
,p_segment2
,p_segment3
,p_segment4
,p_segment5
,p_segment6
,p_segment7
,p_segment8
,p_segment9
,p_segment10
,p_segment11
,p_segment12
,p_segment13
,p_segment14
,p_segment15
,p_segment16
,p_segment17
,p_segment18
,p_segment19
,p_segment20
,p_segment21
,p_segment22
,p_segment23
,p_segment24
,p_segment25
,p_segment26
,p_segment27
,p_segment28
,p_segment29
,p_segment30
);
end insert_grade_definition;
FUNCTION insert_grade RETURN NUMBER IS
--
l_grade_id NUMBER;
hr_utility.set_location('per_db_per_setup.insert_grade',1);
SELECT per_grades_s.nextval
INTO l_grade_id
FROM sys.dual;
hr_utility.set_location('per_db_per_setup.insert_grade',2);
hr_utility.set_location('per_db_per_setup.insert_grade',3);
INSERT INTO per_grades
(GRADE_ID
,BUSINESS_GROUP_ID
,GRADE_DEFINITION_ID
,DATE_FROM
,DATE_TO
,NAME
,SEQUENCE
,LAST_UPDATE_DATE
,LAST_UPDATED_BY
,LAST_UPDATE_LOGIN
,CREATED_BY
,CREATION_DATE)
SELECT
l_grade_id
,l_business_group_id
,l_grade_definition_id
,p_date_from
,p_date_to
,p_name
,nvl(p_sequence,nvl(max(pg.sequence),0) + 1)
,SYSDATE
,0
,0
,0
,SYSDATE
FROM per_grades pg
WHERE pg.business_group_id + 0 = l_business_group_id ;
end insert_grade;
SELECT business_group_id
, grade_structure
INTO l_business_group_id
, l_structure_num
FROM per_business_groups
WHERE name = p_business_group
AND business_group_id <> 0;
l_grade_definition_id := insert_grade_definition;
l_grade_id := insert_grade;