The following lines contain the word 'select', 'insert', 'update' or 'delete':
select a.user_table_id
from pay_user_tables_v a
where upper (a.user_table_name) = upper (P_LOOKUP_TYPE)
and a.business_group_id = P_BUSINESS_GROUP_ID;
select c.user_column_id
from pay_user_columns_v c
where p_user_table_id = c.user_table_id
and upper (c.user_column_name) = upper (P_FUNCTION_TYPE)
and nvl(c.business_group_id,P_BUSINESS_GROUP_ID) = P_BUSINESS_GROUP_ID
and nvl(c.legislation_code,l_legislation_code) = l_legislation_code;
select hl.lookup_code, hl.meaning, b.user_row_id, b.effective_start_date, b.effective_end_date
from hr_lookups hl, pay_user_rows_f b
where hl.lookup_type = P_LOOKUP_TYPE
and b.user_table_id (+) = p_user_table_id
and nvl(b.business_group_id(+),P_BUSINESS_GROUP_ID) = P_BUSINESS_GROUP_ID
and nvl(b.legislation_code(+),l_legislation_code) = l_legislation_code
and b.row_low_range_or_name(+) = hl.lookup_code;
select a.user_column_instance_id
from pay_user_column_instances_f a
where a.user_row_id = p_user_row_id
and a.user_column_id = p_user_column_id;
select max(a.display_sequence)
from pay_user_rows_f a
where user_table_id = p_user_table_id
and nvl(a.business_group_id,P_BUSINESS_GROUP_ID) = P_BUSINESS_GROUP_ID
and nvl(a.legislation_code,l_legislation_code) = l_legislation_code;
select legislation_code into l_legislation_code
from per_business_groups
where business_group_id = P_BUSINESS_GROUP_ID;
pay_user_tables_pkg.insert_row (
P_ROWID => l_table_rowid
,P_USER_TABLE_ID => l_user_table_id
,P_BUSINESS_GROUP_ID => P_BUSINESS_GROUP_ID
,P_LEGISLATION_CODE => l_legislation_code
,P_LEGISLATION_SUBGROUP => NULL
,P_RANGE_OR_MATCH => 'M'
,P_USER_KEY_UNITS => 'T'
,P_USER_TABLE_NAME => P_LOOKUP_TYPE
,P_USER_ROW_TITLE => P_ROW_TITLE);
pay_user_columns_pkg.insert_row (
P_ROWID => l_column_rowid
,P_USER_COLUMN_ID => l_user_column_id
,P_USER_TABLE_ID => l_user_table_id
,P_BUSINESS_GROUP_ID => P_BUSINESS_GROUP_ID
,P_LEGISLATION_CODE => l_legislation_code
,P_LEGISLATION_SUBGROUP => NULL
,P_USER_COLUMN_NAME => P_FUNCTION_TYPE
,P_FORMULA_ID => NULL);
select pay_user_rows_s.nextval into l_user_row_id from dual;
insert into PAY_USER_ROWS_F
(USER_ROW_ID,
EFFECTIVE_START_DATE,
EFFECTIVE_END_DATE,
BUSINESS_GROUP_ID,
LEGISLATION_CODE,
USER_TABLE_ID,
ROW_LOW_RANGE_OR_NAME,
DISPLAY_SEQUENCE,
LEGISLATION_SUBGROUP,
ROW_HIGH_RANGE)
values (l_user_row_id,
to_date('01/01/1900', 'DD/MM/YYYY'),
to_date('31/12/4712', 'DD/MM/YYYY'),
P_BUSINESS_GROUP_ID,
l_legislation_code,
l_user_table_id,
l_lookup_code,
(l_order_code_new),
NULL,
NULL);
pay_user_column_instances_pkg.insert_row(
P_ROWID => l_column_instance_rowid
,P_USER_COLUMN_INSTANCE_ID => l_user_column_instance_id
,P_EFFECTIVE_START_DATE => to_date('01/01/1900', 'DD/MM/YYYY')
,P_EFFECTIVE_END_DATE => to_date('31/12/4712', 'DD/MM/YYYY')
,P_USER_ROW_ID => l_user_row_id
,P_USER_COLUMN_ID => l_user_column_id
,P_BUSINESS_GROUP_ID => P_BUSINESS_GROUP_ID
,P_LEGISLATION_CODE => l_legislation_code
,P_LEGISLATION_SUBGROUP => NULL
,P_VALUE => NULL);
pay_user_column_instances_pkg.insert_row(
P_ROWID => l_column_instance_rowid
,P_USER_COLUMN_INSTANCE_ID => l_user_column_instance_id
,P_EFFECTIVE_START_DATE => to_date('01/01/1900', 'DD/MM/YYYY')
,P_EFFECTIVE_END_DATE => to_date('31/12/4712', 'DD/MM/YYYY')
,P_USER_ROW_ID => l_user_row_id
,P_USER_COLUMN_ID => l_user_column_id
,P_BUSINESS_GROUP_ID => P_BUSINESS_GROUP_ID
,P_LEGISLATION_CODE => l_legislation_code
,P_LEGISLATION_SUBGROUP => NULL
,P_VALUE => l_lookup_meaning);
pay_user_column_instances_pkg.insert_row(
P_ROWID => l_column_instance_rowid
,P_USER_COLUMN_INSTANCE_ID => l_user_column_instance_id
,P_EFFECTIVE_START_DATE => to_date('01/01/1900', 'DD/MM/YYYY')
,P_EFFECTIVE_END_DATE => to_date('31/12/4712', 'DD/MM/YYYY')
,P_USER_ROW_ID => l_user_row_id
,P_USER_COLUMN_ID => l_user_column_id
,P_BUSINESS_GROUP_ID => P_BUSINESS_GROUP_ID
,P_LEGISLATION_CODE => l_legislation_code
,P_LEGISLATION_SUBGROUP => NULL
,P_VALUE => P_DEFAULT_VALUE);
SELECT USER_TABLE_ID
FROM PAY_USER_TABLES
WHERE USER_TABLE_NAME = cp_user_table_name and
BUSINESS_GROUP_ID = cn_business_group_id;
SELECT USER_COLUMN_ID
FROM PAY_USER_COLUMNS
WHERE USER_TABLE_ID = cp_user_table_id and
BUSINESS_GROUP_ID = cn_business_group_id;
SELECT USER_ROW_ID
FROM PAY_USER_ROWS_F
WHERE USER_TABLE_ID = cp_user_table_id and
BUSINESS_GROUP_ID = cn_business_group_id;
hr_utility.set_location('user_rows_f found. to be deleted ' || to_char(ln_pay_user_rows), 15);
DELETE FROM PAY_USER_COLUMN_INSTANCES_F
WHERE USER_ROW_ID = ln_pay_user_rows and
USER_COLUMN_ID = ln_user_column_id and
BUSINESS_GROUP_ID = cn_business_group_id;
hr_utility.set_location('perfralc - delete pay_user_row, column and table rows' , 20);
DELETE FROM PAY_USER_ROWS_F
WHERE USER_TABLE_ID = ln_user_table_id and
BUSINESS_GROUP_ID = cn_business_group_id;
DELETE FROM PAY_USER_COLUMNS
WHERE USER_TABLE_ID = ln_user_table_id and
BUSINESS_GROUP_ID = cn_business_group_id;
DELETE FROM PAY_USER_TABLES
WHERE USER_TABLE_ID = ln_user_table_id and
BUSINESS_GROUP_ID = cn_business_group_id;
SELECT USER_TABLE_ID
FROM PAY_USER_TABLES
WHERE USER_TABLE_NAME = cp_user_table_name
and BUSINESS_GROUP_ID = cn_business_group_id;
SELECT USER_COLUMN_ID
FROM PAY_USER_COLUMNS
WHERE USER_TABLE_ID = cp_user_table_id and
USER_COLUMN_NAME = cp_user_column_name and
BUSINESS_GROUP_ID = cn_business_group_id;
SELECT USER_ROW_ID
FROM PAY_USER_ROWS_F
WHERE USER_TABLE_ID = cp_user_table_id and
ROW_LOW_RANGE_OR_NAME = cp_row_name and
BUSINESS_GROUP_ID = cn_business_group_id;
SELECT USER_COLUMN_INSTANCE_ID
FROM PAY_USER_COLUMN_INSTANCES_F
WHERE USER_ROW_ID = cn_user_row_id and
USER_COLUMN_ID = cn_user_column_id and
BUSINESS_GROUP_ID = cn_business_group_id;
hr_utility.set_location(' Update PAY_USER_COLUMN_INSTANCES_F for ' || to_char(ln_column_instance_id),16);
UPDATE PAY_USER_COLUMN_INSTANCES_F
set value = cp_value
where user_column_instance_id = ln_column_instance_id;
hr_utility.set_location ('perfralc - set_instance_value - unable to update row into PAY_USER_COLUMN_INSTANCES_F '|| to_char(ln_column_instance_id), 20);
Procedure Update_Instance_value
(cn_business_group_id IN per_business_groups.business_group_id%TYPE,
cp_legislation_code IN per_business_groups.legislation_code%TYPE,
cp_user_table_name IN pay_user_tables.user_table_name%TYPE ,
cp_user_column_name IN pay_user_columns.user_column_name%TYPE ,
cp_row_name IN pay_user_rows_f.row_low_range_or_name%TYPE ,
cp_value IN pay_user_column_instances_f.value%TYPE
) IS
ln_user_table_id NUMBER;
SELECT BUSINESS_GROUP_ID
FROM PER_BUSINESS_GROUPS
WHERE LEGISLATION_CODE = cp_legislation_code;
hr_utility.set_location('per_perfralc_pkg - Entering update_instance_value', 1);
select rtrim(ltrim(pbg.legislation_code)) into ln_temp_leg_code
from per_business_groups pbg
where pbg.business_group_id = cn_business_group_id;
hr_utility.set_location('unable to update the instance - unknown business_group ' || to_char(cn_business_group_id),10);
hr_utility.set_location('unable to update the instance - incompatible business group and legislation code ',20);