The following lines contain the word 'select', 'insert', 'update' or 'delete':
procedure update_column
(p_old_oid in number,
p_new_oid in number,
p_tab_name in varchar2,
p_col_name in varchar2,
p_option in varchar2)
is
p_cnt number;
select upper(oracle_username) into p_apps_username
from fnd_oracle_userid
where oracle_id between 900 and 999
and read_only_flag = 'U';
select upper(table_owner) into p_tab_owner
from dba_synonyms
where synonym_name = upper(p_tab_name)
and table_name = upper(p_tab_name)
and owner = upper(p_apps_username);
select 1 into p_cnt
from all_tables
where table_name = upper(p_tab_name)
and owner = upper(p_tab_owner);
select 1 into p_cnt
from all_tab_columns
where table_name = upper(p_tab_name)
and column_name = upper(p_col_name)
and owner = upper(p_tab_owner);
statement := 'update '||p_tab_name||' set '||p_col_name||' = '||
p_new_oid||' where '||p_col_name||' = '||p_old_oid;
dbms_output.put_line(' '||rows_processed||' rows updated.');
end update_column;
update_column(p_old_oid, p_new_oid, 'AD_MERGED_TABLES',
'ORACLE_ID', p_option);
update_column(p_old_oid, p_new_oid, 'ALR_ACTION_SET_CHECKS',
'ORACLE_ID', p_option);
update_column(p_old_oid, p_new_oid, 'ALR_ALERT_INSTALLATIONS',
'ORACLE_ID', p_option);
update_column(p_old_oid, p_new_oid, 'ALR_ORACLE_MAIL_ACCOUNTS',
'ORACLE_ID', p_option);
update_column(p_old_oid, p_new_oid, 'ALR_RESPONSE_ACTION_HISTORY',
'ORACLE_ID', p_option);
update_column(p_old_oid, p_new_oid, 'FND_AUDIT_SCHEMAS',
'ORACLE_ID', p_option);
update_column(p_old_oid, p_new_oid, 'FND_CONCURRENT_COMPLEX_LINES',
'TYPE_ID', p_option);
update_column(p_old_oid, p_new_oid, 'FND_CONCURRENT_QUEUE_CONTENT',
'TYPE_ID', p_option);
update_column(p_old_oid, p_new_oid, 'FND_CONCURRENT_COMPLEX_LINES',
'ORACLE_ID', p_option);
update_column(p_old_oid, p_new_oid, 'FND_CONCURRENT_QUEUE_CONTENT',
'ORACLE_ID', p_option);
update_column(p_old_oid, p_new_oid, 'FND_RESPONSIBILITY',
'ORACLE_ID', p_option);
update_column(p_old_oid, p_new_oid, 'FND_RESPONSIBILITY',
'READ_ONLY_ORACLE_ID', p_option);
update_column(p_old_oid, p_new_oid, 'FND_CONCURRENT_REQUESTS',
'ORACLE_ID', p_option);
update_column(p_old_oid, p_new_oid, 'FND_DATA_GROUP_UNITS',
'ORACLE_ID', p_option);
update_column(p_old_oid, p_new_oid, 'FND_DATA_GROUP_UNITS',
'READ_ONLY_ORACLE_ID', p_option);
update_column(p_old_oid, p_new_oid, 'FND_DOC_SEQUENCE_ACCESS',
'ORACLE_ID', p_option);
update_column(p_old_oid, p_new_oid, 'FND_ORACLE_USERID',
'READ_ONLY_ORACLE_ID', p_option);
update_column(p_old_oid, p_new_oid, 'FND_REGRESSION_SUITES',
'ORACLE_ID', p_option);
update_column(p_old_oid, p_new_oid, 'FND_REGRESSION_TESTS',
'ORACLE_ID', p_option);
update_column(p_old_oid, p_new_oid, 'FND_MODULE_INSTALLATIONS',
'ORACLE_ID', p_option);
update_column(p_old_oid, p_new_oid, 'FND_PRODUCT_INSTALLATIONS',
'ORACLE_ID', p_option);
update_column(p_old_oid, p_new_oid, 'FND_PRODUCT_DEPENDENCIES',
'ORACLE_ID', p_option);
update_column(p_old_oid, p_new_oid, 'FND_PRODUCT_DEPENDENCIES',
'REQUIRED_ORACLE_ID', p_option);
update_column(p_old_oid, p_new_oid, 'FND_ORACLE_USERID',
'ORACLE_ID', p_option);
procedure update_oracle_id
(p_release in varchar2,
p_old_oid in number,
p_new_oid in number,
p_option in varchar2)
is
begin
up_oid(p_release, p_old_oid, p_new_oid, p_option);
end update_oracle_id;
procedure update_oracle_id
(p_release in varchar2,
p_old_oid in number,
p_new_oid in number)
is
begin
update_oracle_id(
p_release => p_release,
p_old_oid => p_old_oid,
p_new_oid => p_new_oid,
p_option => 'N');
end update_oracle_id;
procedure update_oracle_id
(p_release in varchar2,
p_old_oid in number,
p_option in varchar2)
is
p_new_oid number;
dbms_output.put_line('-- select fnd_oracle_userid_s.nextval from dual;');
select fnd_oracle_userid_s.nextval into p_new_oid
from dual;
end update_oracle_id;
procedure update_oracle_id
(p_release in varchar2,
p_old_oid in number)
is
begin
update_oracle_id(
p_release => p_release,
p_old_oid => p_old_oid,
p_option => 'N');
end update_oracle_id;
select application_id into p_apps_id
from fnd_application
where application_short_name = upper(p_apps_short_name);
select oracle_id, db_status, status, install_group_num
from fnd_product_installations
where application_id = appl_id;
errmsg := 'update fnd_product_installations for oracle_id '||
x_oracle_id;
update fnd_product_installations
set status = 'S',
last_update_date = sysdate
where application_id = appid
and oracle_id = x_oracle_id;
' row updated in fnd_product_installations.');
' rows updated in fnd_product_installations.');
insert into fnd_data_group_units
(application_id,
data_group_id,
last_update_date,
last_updated_by,
creation_date,
created_by,
last_update_login,
oracle_id
)
select distinct appid,
dg.data_group_id,
sysdate,
1,
sysdate,
1,
0,
decode(substr(p_release, 1, 4), '10.6', decode(appid,
0, 0,
1, 0,
3, 0,
50, 0,
160,0,
u.oracle_id),
u.oracle_id)
from fnd_data_groups dg,
fnd_data_group_units du,
fnd_oracle_userid u
where du.data_group_id = dg.data_group_id
and du.created_by = 1
and dg.created_by = 1
and du.oracle_id = u.oracle_id
and u.oracle_id between 900 and 999
and not exists
( select 'x'
from fnd_data_group_units u2
where u2.data_group_id = dg.data_group_id
and u2.application_id = appid
);
' row inserted into fnd_data_group_units.');
' rows inserted into fnd_data_group_units.');
errmsg := 'insert into fnd_data_group_units';
insert into fnd_data_group_units
(application_id, data_group_id, last_update_date, last_updated_by,
creation_date, created_by, last_update_login, oracle_id)
select distinct appid,
dg.data_group_id,
sysdate,
1,
sysdate,
1,
0,
u.oracle_id
from fnd_data_groups dg,
fnd_data_group_units du,
fnd_oracle_userid u
where du.data_group_id = dg.data_group_id
and du.created_by = 1
and dg.created_by = 1
and du.oracle_id = u.oracle_id
and u.install_group_num = x_ign
and u.oracle_id between 900 and 999
and not exists
( select 'x'
from fnd_data_group_units u2
where u2.data_group_id = dg.data_group_id
and u2.application_id = appid
);
' row inserted into fnd_data_group_units.');
' rows inserted into fnd_data_group_units.');