The following lines contain the word 'select', 'insert', 'update' or 'delete':
procedure insert_tl_rows
(x_user_name in varchar2
,x_user_entity_id in number
,x_language in varchar2
,x_translated_user_name in varchar2
,x_description in varchar2
) is
l_disable_triggers varchar2(10);
insert into ff_database_items_tl (
user_name,
user_entity_id,
translated_user_name,
description,
language,
source_lang
) select
x_user_name,
x_user_entity_id,
x_translated_user_name,
x_description,
l.language_code,
x_language
from fnd_languages l
where l.installed_flag in ('I', 'B')
and not exists
(select null
from ff_database_items_tl t
where t.user_name = x_user_name
and t.user_entity_id = x_user_entity_id
and t.language = l.language_code);
end insert_tl_rows;
procedure insert_row
(x_rowid in out nocopy varchar2
,x_user_name in out nocopy varchar2
,x_user_entity_id in number
,x_data_type in varchar2
,x_definition_text in varchar2
,x_null_allowed_flag in varchar2
,x_translated_user_name in out nocopy varchar2
,x_description in varchar2
) is
l_disable_triggers varchar2(2000);
insert into ff_database_items (
user_name,
user_entity_id,
data_type,
definition_text,
null_allowed_flag
) values (
l_user_name,
x_user_entity_id,
upper(x_data_type),
x_definition_text,
upper(x_null_allowed_flag)
) returning rowid
into x_rowid
;
insert_tl_rows
(x_user_name => l_user_name
,x_user_entity_id => x_user_entity_id
,x_language => userenv('LANG')
,x_translated_user_name => l_translated_user_name
,x_description => x_description
);
end insert_row;
select distinct translated_user_name
from ff_database_items_tl
where user_name = x_user_name
and user_entity_id = x_user_entity_id
and translated_user_name <> x_new_name
and translated_user_name <> x_user_name
and x_language in (language, source_lang)
;
select null
from ff_database_items_tl
where user_name = x_user_name
and user_entity_id = x_user_entity_id
and translated_user_name = x_old_name
and language <> x_language
and source_lang <> x_language
;
,x_dont_update in out nocopy boolean
,x_message_rowids in out nocopy dbms_sql.varchar2s
) is
l_formula_ids dbms_sql.number_table;
x_dont_update := true;
pay_dbitl_update_errors_pkg.insert_row
(p_user_name => x_user_name
,p_user_entity_id => x_user_entity_id
,p_translated_name => x_tl_user_name
,p_message_text => l_encoded_message
,p_rowid => l_rowid
);
delete ff_compiled_info_f fci
where fci.formula_id = l_formula_ids(i)
and fci.effective_start_date = l_eff_start_dates(i)
and fci.effective_end_date = l_eff_end_dates(i)
;
delete ff_fdi_usages_f fdi
where fdi.formula_id = l_formula_ids(i)
and fdi.effective_start_date = l_eff_start_dates(i)
and fdi.effective_end_date = l_eff_end_dates(i)
and fdi.item_name = x_user_name
;
procedure core_update_tl_rows
(x_raise_errors in boolean
,x_seed_update in boolean
,x_user_name in varchar2
,x_user_entity_id in number
,x_language in varchar2
,x_tl_user_name in out nocopy varchar2
,x_description in varchar2
,x_last_update_date in date
,x_last_updated_by in number
,x_last_update_login in number
,x_got_error in out nocopy boolean
) is
l_disable_triggers varchar2(2000);
l_dont_update boolean;
hr_utility.set_location('ffdict.core_update_tl_rows',10);
l_raise_errors := (x_raise_errors or not x_seed_update);
hr_utility.set_location('ffdict.core_update_tl_rows',20);
hr_utility.set_location('ffdict.core_update_tl_rows',30);
pay_dbitl_update_errors_pkg.insert_row
(p_user_name => l_user_name
,p_user_entity_id => x_user_entity_id
,p_translated_name => l_tl_user_name
,p_message_text => l_encoded_message
);
hr_utility.set_location('ffdict.core_update_tl_rows',35);
hr_utility.set_location('ffdict.core_update_tl_rows',40);
pay_dbitl_update_errors_pkg.insert_row
(p_user_name => l_user_name
,p_user_entity_id => x_user_entity_id
,p_translated_name => l_tl_user_name
,p_message_text => l_encoded_message
);
hr_utility.set_location('ffdict.core_update_tl_rows',45);
hr_utility.set_location('ffdict.core_update_tl_rows',50);
l_dont_update := false;
,x_dont_update => l_dont_update
,x_message_rowids => l_message_rowids
);
if l_dont_update then
--
-- Delete messages that apply to custom Formulas.
--
pay_dbitl_update_errors_pkg.delete_rows
(p_rowids => l_message_rowids
);
hr_utility.set_location('ffdict.core_update_tl_rows',55);
hr_utility.set_location('ffdict.core_update_tl_rows',60);
hr_utility.set_location('ffdict.core_update_tl_rows',70);
hr_utility.set_location('ffdict.core_update_tl_rows',75);
l_dont_update := false;
,x_dont_update => l_dont_update
,x_message_rowids => l_message_rowids
);
if l_dont_update then
--
-- Delete messages that apply to custom Formulas.
--
pay_dbitl_update_errors_pkg.delete_rows
(p_rowids => l_message_rowids
);
hr_utility.set_location('ffdict.core_update_tl_rows',85);
hr_utility.set_location('ffdict.core_update_tl_rows',90);
update ff_database_items_tl set
translated_user_name = l_tl_user_name,
description = x_description,
last_update_date = x_last_update_date,
last_updated_by = x_last_updated_by,
last_update_login = x_last_update_login,
source_lang = x_language
where user_name = l_user_name
and user_entity_id = x_user_entity_id
and x_language in (language, source_lang);
hr_utility.set_location('ffdict.core_update_tl_rows',200);
hr_utility.set_location('ffdict.core_update_tl_rows',500);
end core_update_tl_rows;
procedure update_tl_rows
(x_user_name in varchar2
,x_user_entity_id in number
,x_language in varchar2
,x_translated_user_name in out nocopy varchar2
,x_description in varchar2
,x_last_update_date in date
,x_last_updated_by in number
,x_last_update_login in number
) is
l_got_error boolean := false;
core_update_tl_rows
(x_raise_errors => true
,x_seed_update => false
,x_user_name => x_user_name
,x_user_entity_id => x_user_entity_id
,x_language => x_language
,x_tl_user_name => x_translated_user_name
,x_description => x_description
,x_last_update_date => x_last_update_date
,x_last_updated_by => x_last_updated_by
,x_last_update_login => x_last_update_login
,x_got_error => l_got_error
);
end update_tl_rows;
procedure update_tl_rows
(x_user_name in varchar2
,x_user_entity_id in number
,x_language in varchar2
,x_translated_user_name in out nocopy varchar2
,x_description in varchar2
) is
begin
update_tl_rows
(x_user_name => x_user_name
,x_user_entity_id => x_user_entity_id
,x_language => x_language
,x_translated_user_name => x_translated_user_name
,x_description => x_description
,x_last_updated_by => fnd_global.user_id
,x_last_update_date => sysdate
,x_last_update_login => fnd_global.login_id
);
end update_tl_rows;
procedure update_tl_row
(x_user_name in varchar2
,x_user_entity_id in number
,x_language in varchar2
,x_source_lang in varchar2
,x_translated_user_name in varchar2
,x_description in varchar2
) is
l_disable_triggers varchar2(2000);
select translated_user_name
from ff_database_items_tl
where user_name = x_user_name
and user_entity_id = x_user_entity_id
and translated_user_name <> x_new_name
and translated_user_name <> x_user_name
and language = x_language
;
select null
from ff_database_items_tl
where user_name = x_user_name
and user_entity_id = x_user_entity_id
and translated_user_name = x_old_name
and language <> x_language
;
update ff_database_items_tl set
translated_user_name = l_tl_name,
description = x_description,
source_lang = x_source_lang
where user_name = l_user_name
and user_entity_id = x_user_entity_id
and language = x_language;
end update_tl_row;
procedure update_row
(x_user_name in varchar2
,x_user_entity_id in number
,x_data_type in varchar2
,x_definition_text in varchar2
,x_null_allowed_flag in varchar2
,x_translated_user_name in out nocopy varchar2
,x_description in varchar2
) is
l_update varchar2(2000);
cursor csr_update_base
(x_user_name in varchar2
,x_user_entity_id in number
,x_data_type in varchar2
,x_definition_text in varchar2
,x_null_allowed_flag in varchar2
) is
select 'Y'
from ff_database_items dbi
where dbi.user_name = x_user_name
and dbi.user_entity_id = x_user_entity_id
and (dbi.data_type <> x_data_type or
dbi.definition_text <> x_definition_text or
dbi.null_allowed_flag <> x_null_allowed_flag
)
;
open csr_update_base
(x_user_name => l_user_name
,x_user_entity_id => x_user_entity_id
,x_data_type => upper(x_data_type)
,x_definition_text => x_definition_text
,x_null_allowed_flag => upper(x_null_allowed_flag)
);
fetch csr_update_base into l_update;
close csr_update_base;
if l_update = 'Y' then
if ffdict.dbi_used_in_formula(l_user_name, x_user_entity_id) then
hr_utility.set_message(802,'FF75_ITEM_USED_IN_FORMULA');
update ff_database_items set
data_type = upper(x_data_type),
definition_text = x_definition_text,
null_allowed_flag = upper(x_null_allowed_flag)
where user_name = l_user_name
and user_entity_id = x_user_entity_id;
update_tl_rows
(x_user_name => l_user_name
,x_user_entity_id => x_user_entity_id
,x_language => userenv('LANG')
,x_translated_user_name => x_translated_user_name
,x_description => x_description
);
if csr_update_base%isopen then
close csr_update_base;
end update_row;
procedure update_seeded_tl_rows
(x_user_name in varchar2
,x_user_entity_id in number
,x_language in varchar2
,x_translated_user_name in out nocopy varchar2
,x_description in varchar2
,x_got_error out nocopy boolean
) is
l_got_error boolean := false;
core_update_tl_rows
(x_raise_errors => false
,x_seed_update => true
,x_user_name => x_user_name
,x_user_entity_id => x_user_entity_id
,x_language => x_language
,x_tl_user_name => x_translated_user_name
,x_description => x_description
,x_last_update_date => sysdate
,x_last_updated_by => 1
,x_last_update_login => 0
,x_got_error => l_got_error
);
end update_seeded_tl_rows;
procedure delete_tl_rows
(x_user_name in varchar2
,x_user_entity_id in number
) is
l_user_name varchar2(2000);
delete /*+ INDEX(dbitl FF_DATABASE_ITEMS_TL_PK) */
from ff_database_items_tl dbitl
where dbitl.user_name = l_user_name
and dbitl.user_entity_id = x_user_entity_id;
end delete_tl_rows;
procedure delete_row
(x_user_name in varchar2
,x_user_entity_id in number
) is
l_disable_triggers varchar2(2000);
ffdict.delete_dbitem_check
(p_item_name => l_user_name
,p_user_entity_id => x_user_entity_id
);
ff_database_items_pkg.delete_tl_rows
(x_user_name => l_user_name
,x_user_entity_id => x_user_entity_id
);
delete from ff_database_items
where user_name = l_user_name
and user_entity_id = x_user_entity_id;
end delete_row;
select a.user_entity_id
from ff_user_entities a
where exists
(
select null
from ff_database_items b
where a.user_entity_id = b.user_entity_id
)
;
select userenv('LANG')
into l_userenv_lang
from dual
;
hr_utility.trace('add_language:delete');
hr_utility.trace('add_language:update');
/* bug 13739722 remove update
forall i in ueids.first .. ueids.last
update ff_database_items_tl t set (
translated_user_name,
description
) = (select
b.translated_user_name,
b.description
from ff_database_items_tl b
where b.user_entity_id = ueids(i)
and b.user_name = t.user_name
and b.user_entity_id = t.user_entity_id
and b.language = t.source_lang)
where (
t.user_name,
t.user_entity_id,
t.language
) in (select
subt.user_name,
subt.user_entity_id,
subt.language
from ff_database_items_tl subb, ff_database_items_tl subt
where subb.user_entity_id = ueids(i)
and subb.user_name = subt.user_name
and subb.user_entity_id = subt.user_entity_id
and subb.language = subt.source_lang
and (subb.translated_user_name <> subt.translated_user_name
or subb.description <> subt.description
or (subb.description is null and subt.description is not null)
or (subb.description is not null and subt.description is null)
));
hr_utility.trace('add_language:insert');
insert /*+ append parallel(tt) */ into ff_database_items_tl tt (
user_name,
user_entity_id,
translated_user_name,
description,
last_update_date,
last_updated_by,
last_update_login,
created_by,
creation_date,
language,
source_lang
)
select /*+ parallel(v) parallel(t) use_nl(t) */ v.* from
( select /*+ no_merge ordered parallel(b) */
b.user_name,
b.user_entity_id,
b.translated_user_name,
b.description,
b.last_update_date,
b.last_updated_by,
b.last_update_login,
b.created_by,
b.creation_date,
l.language_code,
b.source_lang
from ff_database_items_tl b,
fnd_languages l
where l.installed_flag in ('I', 'B')
and b.user_entity_id = ueids(i)
and b.language = l_userenv_lang ) v,
ff_database_items_tl t
where t.user_name(+) = v.user_name
and t.user_entity_id(+) = v.user_entity_id
and t.language(+) = v.language_code
and t.user_entity_id IS NULL
;
l_updated_by number;
select ue.user_entity_id
from ff_database_items dbi
, ff_user_entities ue
where dbi.user_name = x_user_name
and ue.user_entity_id = dbi.user_entity_id
and (ue.legislation_code = x_legislation_code or
ue.legislation_code is null)
;
l_updated_by := 1;
l_updated_by := 0;
core_update_tl_rows
(x_raise_errors => (x_owner <> 'SEED')
,x_seed_update => (x_owner = 'SEED')
,x_user_name => l_user_name
,x_user_entity_id => l_user_entity_id
,x_language => l_language
,x_tl_user_name => l_translated_user_name
,x_description => x_description
,x_last_update_date => sysdate
,x_last_updated_by => l_updated_by
,x_last_update_login => 0
,x_got_error => l_got_error
);
hr_utility.trace('No update with name ' || l_translated_user_name);
hr_utility.trace('Update with name ' || l_translated_user_name);