The following lines contain the word 'select', 'insert', 'update' or 'delete':
procedure insert_row(
x_rowid in out NOCOPY Varchar2,
p_ws_id in number,
p_ws_type in varchar2,
p_distribute_to in varchar2,
p_distribute_from in varchar2,
p_distribution_function in varchar2,
p_not_valid_flag in varchar2,
p_object_code in varchar2,
p_ws_name in varchar2,
p_ws_description in varchar2,
p_ws_code in varchar2,
p_ws_enable_profile_option varchar2,
p_application_id number,
p_active_flag varchar2 DEFAULT NULL
) is
cursor C is select ROWID from IEU_UWQM_WORK_SOURCES_B
where WS_ID = p_ws_id;
insert into IEU_UWQM_WORK_SOURCES_B(
ws_id,
ws_type,
distribute_to,
distribute_from,
distribution_function,
not_valid_flag,
object_code,
OBJECT_VERSION_NUMBER,
CREATED_BY,
CREATION_DATE,
LAST_UPDATED_BY,
LAST_UPDATE_DATE,
LAST_UPDATE_LOGIN,
ws_code,
ws_enable_profile_option,
application_id,
active_flag
)
VALUES(
p_ws_id,
p_ws_type,
p_distribute_to,
p_distribute_from,
p_distribution_function,
p_not_valid_flag,
p_object_code,
1,
fnd_global.user_id,
sysdate,
fnd_global.user_id,
sysdate,
fnd_global.login_id,
p_ws_code,
p_ws_enable_profile_option,
p_application_id,
p_active_flag
);
insert into IEU_UWQM_WORK_SOURCES_TL (
ws_id,
OBJECT_VERSION_NUMBER,
CREATED_BY,
CREATION_DATE,
LAST_UPDATED_BY,
LAST_UPDATE_DATE,
LAST_UPDATE_LOGIN,
ws_name,
ws_description,
LANGUAGE,
SOURCE_LANG
) select
p_ws_id,
1,
fnd_global.user_id,
sysdate,
fnd_global.user_id,
sysdate,
fnd_global.login_id,
p_ws_name,
p_ws_description,
l.language_code,
userenv('LANG')
from fnd_languages l
where l.installed_flag in ('I', 'B')
and not exists
(select null from ieu_uwqm_work_sources_tl t
where t.ws_id = p_ws_id
and t.language = l.language_code);
END INSERT_ROW;
select object_version_number, ws_type, distribute_to, distribute_from,
distribution_function, not_valid_flag, object_code, ws_enable_profile_option, application_id
from ieu_uwqm_work_sources_b
where ws_id = p_ws_id
for update of ws_id nowait;
select ws_name, ws_description,
decode(language, userenv('LANG'), 'Y', 'N') BASELANG
from ieu_uwqm_work_sources_tl
where ws_id = p_ws_id
and userenv('LANG') in (LANGUAGE, SOURCE_LANG)
for update of ws_id nowait;
fnd_message.set_name('FND', 'FORM_RECORD_DELETED');
procedure update_row(
p_ws_id in number,
p_ws_type in varchar2,
p_distribute_to in varchar2,
p_distribute_from in varchar2,
p_distribution_function in varchar2,
p_not_valid_flag in varchar2,
p_object_code in varchar2,
p_ws_name in varchar2,
p_ws_description in varchar2,
p_ws_enable_profile_option varchar2,
p_application_id number,
p_active_flag varchar2 DEFAULT NULL
) is
l_active_flag varchar2(1);
select active_flag
into l_active_flag
from ieu_uwqm_work_sources_b
where ws_id = p_ws_id;
select active_flag
into l_active_flag
from ieu_uwqm_work_sources_b
where ws_id = p_ws_id;
update IEU_UWQM_WORK_SOURCES_B set
object_version_number = object_version_number+1,
ws_type = p_ws_type,
distribute_to = p_distribute_to,
distribute_from = p_distribute_from,
distribution_function = p_distribution_function,
not_valid_flag = p_not_valid_flag,
object_code = p_object_code,
last_update_date = sysdate,
last_updated_by = fnd_global.user_id,
last_update_login = fnd_global.login_id,
ws_enable_profile_option = p_ws_enable_profile_option,
application_id = p_application_id,
active_flag = l_active_flag
where ws_id = p_ws_id;
update IEU_UWQM_WORK_SOURCES_TL set
ws_name = p_ws_name,
ws_description = p_ws_description,
last_update_date = sysdate,
last_updated_by = fnd_global.user_id,
last_update_login = fnd_global.login_id,
object_version_number = object_version_number+1,
source_lang = userenv('LANG')
where ws_id = p_ws_id
and userenv('LANG') in (LANGUAGE, SOURCE_LANG);
END UPDATE_ROW;
procedure delete_row(
p_ws_id in number
) is
begin
delete from IEU_UWQM_WORK_SOURCES_TL
where ws_id = p_ws_id;
delete from ieu_uwqm_work_sources_b
where ws_id = p_ws_id;
END DELETE_ROW;
delete from IEU_UWQM_WORK_SOURCES_TL t
where not exists
(select null
from ieu_uwqm_work_sources_b b
where b.ws_id = t.ws_id);
update ieu_uwqm_work_sources_tl t
set (ws_name, ws_description)
= (select b.ws_name,
b.ws_description
from ieu_uwqm_work_sources_tl b
where b.ws_id = t.ws_id
and b.language= t.source_lang)
where ( t.ws_id, t.language )
in (select subt.ws_id, subt.language
from ieu_uwqm_work_sources_tl subb, ieu_uwqm_work_sources_tl subt
where subb.ws_id = subt.ws_id
and subb.language = subt.source_lang
and (subb.ws_name <> subt.ws_name
or subb.ws_description <> subt.ws_description));
insert into ieu_uwqm_work_sources_tl(
ws_ID,
OBJECT_VERSION_NUMBER,
CREATED_BY,
CREATION_DATE,
LAST_UPDATED_BY,
LAST_UPDATE_DATE,
LAST_UPDATE_LOGIN,
ws_name,
ws_DESCription,
LANGUAGE,
SOURCE_LANG
) select
b.ws_id,
b.object_version_number,
fnd_global.user_id,
sysdate,
fnd_global.user_id,
sysdate,
fnd_global.login_id,
b.ws_name,
b.ws_description,
l.language_code,
b.source_lang
from ieu_uwqm_work_sources_tl b, fnd_languages l
where l.installed_flag in ('I', 'B')
and b.language= userenv('LANG')
and not exists
(select null from ieu_uwqm_work_sources_tl t
where t.ws_id = b.ws_id
and t.language = l.language_code);
update_row(
p_ws_id => p_ws_id,
p_ws_type => p_ws_type,
p_distribute_to => p_distribute_to,
p_distribute_from => p_distribute_from,
p_distribution_function => p_distribution_function,
p_not_valid_flag => p_not_valid_flag,
p_object_code => p_object_code,
p_ws_name => p_ws_name,
p_ws_description => p_ws_description,
p_ws_enable_profile_option => p_ws_enable_profile_option,
p_application_id => p_application_id,
p_active_flag => p_active_flag);
insert_row(
x_rowid => l_rowid,
p_ws_id => p_ws_id,
p_ws_type => p_ws_type,
p_distribute_to => p_distribute_to,
p_distribute_from => p_distribute_from,
p_distribution_function => p_distribution_function,
p_not_valid_flag => p_not_valid_flag,
p_object_code => p_object_code,
p_ws_name => p_ws_name,
p_ws_description => p_ws_description,
p_ws_code => p_ws_code,
p_ws_enable_profile_option => p_ws_enable_profile_option,
p_application_id => p_application_id,
p_active_flag => p_active_flag);
update IEU_UWQM_WORK_SOURCES_TL
set source_lang = userenv('LANG'),
ws_name = p_ws_name,
ws_description = p_ws_description,
last_update_date = sysdate,
--last_updated_by = decode(p_owner, 'SEED', 1, 0),
last_updated_by = fnd_load_util.owner_id(p_owner),
last_update_login = 0
where (ws_id = p_ws_id)
and (userenv('LANG') IN (LANGUAGE, SOURCE_LANG));