[Home] [Help]
The following lines contain the word 'select', 'insert', 'update' or 'delete':
update amw_process
set approval_status = 'PA'
where process_id = p_process_id
and end_date is null;
insert into amw_process_locks
(organization_id,
locking_process_id,
locked_process_id,
LAST_UPDATE_DATE,
LAST_UPDATED_BY,
LAST_UPDATE_LOGIN,
CREATION_DATE,
CREATED_BY,
object_version_number)
values
(
-1,
p_process_id,
p_process_id,
sysdate,
G_USER_ID,
G_LOGIN_ID,
sysdate,
G_USER_ID,
1
);
insert into amw_process_locks
(organization_id,
locking_process_id,
locked_process_id,
LAST_UPDATE_DATE,
LAST_UPDATED_BY,
LAST_UPDATE_LOGIN,
CREATION_DATE,
CREATED_BY,
object_version_number)
(select -1, p_process_id, parent_child_id, sysdate, G_USER_ID, G_LOGIN_ID,
sysdate, G_USER_ID, 1
from amw_proc_hierarchy_denorm
where process_id = p_process_id
and up_down_ind = 'D'
and hierarchy_type = 'L');
insert into amw_process_locks
(organization_id,
locking_process_id,
locked_process_id,
LAST_UPDATE_DATE,
LAST_UPDATED_BY,
LAST_UPDATE_LOGIN,
CREATION_DATE,
CREATED_BY,
object_version_number)
(select -1, p_process_id, child_process_id, sysdate, G_USER_ID, G_LOGIN_ID,
sysdate, G_USER_ID, 1
from amw_latest_hierarchy_rl_v
where parent_process_id = p_process_id);
insert into amw_process_locks
(organization_id,
locking_process_id,
locked_process_id,
LAST_UPDATE_DATE,
LAST_UPDATED_BY,
LAST_UPDATE_LOGIN,
CREATION_DATE,
CREATED_BY,
object_version_number)
(select -1, p_process_id, parent_child_id, sysdate, G_USER_ID, G_LOGIN_ID,
sysdate, G_USER_ID, 1
from amw_proc_hierarchy_denorm
where process_id = p_process_id
and up_down_ind = 'D'
and hierarchy_type = 'L');
* ko .. We need to update only draft children
* select parent_child_id
from amw_proc_hierarchy_denorm
where process_id = p_process_id
and up_down_ind = 'D'
and hierarchy_type = 'L';
select ah.parent_child_id
from amw_proc_hierarchy_denorm ah,
amw_process ap
where ah.process_id = p_process_id
and ah.up_down_ind = 'D'
and ah.hierarchy_type = 'L'
and ah.parent_child_id = ap.process_id
and ap.end_date is null
and ap.approval_date is null;
select approval_status
into curr_app_status
from amw_process
where process_id = p_process_id
and end_date is null;
delete from amw_process_locks
where organization_id = -1
and locking_process_id = p_process_id;
update amw_process
set approval_status = 'A',
approval_date = APPROV_TXN_DATE
where process_id = p_process_id
and end_date is null
returning revision_number into rev_num;
update amw_process
set approval_end_date = APPROV_TXN_DATE
where process_id = p_process_id
and revision_number = (rev_num-1);
AMW_RL_HIERARCHY_PKG.update_org_count(p_process_id => p_process_id);
update amw_process
set approval_status = 'A',
approval_date = APPROV_TXN_DATE
where process_id = c1_rec.parent_child_id
and end_date is null
returning revision_number into rev_num;
update amw_process
set approval_end_date = APPROV_TXN_DATE
where process_id = c1_rec.parent_child_id
and revision_number = (rev_num-1);
--kosriniv ..Need to update the org count...
AMW_RL_HIERARCHY_PKG.update_org_count(p_process_id => c1_rec.parent_child_id );
amw_rl_hierarchy_pkg.update_approved_denorm(-1);
amw_rl_hierarchy_pkg.update_appr_control_counts;
amw_rl_hierarchy_pkg.update_appr_risk_counts;
update amw_process
set approval_status = 'D'
where process_id = p_process_id
and end_date is null;
delete from amw_process_locks
where organization_id = -1
and locking_process_id = p_process_id;
select 1 --parent_child_id, a.approval_status
into l_dummy
from amw_proc_hierarchy_denorm d, amw_process a
where d.process_id = p_process_id
and up_down_ind = 'D'
and hierarchy_type = 'L'
and a.process_id = d.parent_child_id
and a.end_date is null
and a.approval_status <> 'A';
update amw_risk_associations
set approval_date = APPROV_TXN_DATE
where pk1 = p_process_id
and object_type = 'PROCESS'
and approval_date is null;
update amw_risk_associations
set deletion_approval_date = APPROV_TXN_DATE
where pk1 = p_process_id
and object_type = 'PROCESS'
and deletion_date is not null
and deletion_approval_date is null;
update amw_control_associations
set approval_date = APPROV_TXN_DATE
where pk1 = p_process_id
and object_type = 'RISK'
and approval_date is null;
update amw_control_associations
set deletion_approval_date = APPROV_TXN_DATE
where pk1 = p_process_id
and object_type = 'RISK'
and deletion_date is not null
and deletion_approval_date is null;
update amw_acct_associations
set approval_date = APPROV_TXN_DATE
where pk1 = p_process_id
and object_type = 'PROCESS'
and approval_date is null;
update amw_acct_associations
set deletion_approval_date = APPROV_TXN_DATE
where pk1 = p_process_id
and object_type = 'PROCESS'
and deletion_date is not null
and deletion_approval_date is null;
update amw_objective_associations
set approval_date = APPROV_TXN_DATE
where pk1 = p_process_id
and object_type in ('PROCESS', 'CONTROL')
and approval_date is null;
update amw_objective_associations
set deletion_approval_date = APPROV_TXN_DATE
where pk1 = p_process_id
and object_type in ('PROCESS', 'CONTROL')
and deletion_date is not null
and deletion_approval_date is null;
update amw_significant_elements
set approval_date = APPROV_TXN_DATE
where pk1 = p_process_id
and object_type = 'PROCESS'
and approval_date is null;
update amw_significant_elements
set deletion_approval_date = APPROV_TXN_DATE
where pk1 = p_process_id
and object_type = 'PROCESS'
and deletion_date is not null
and deletion_approval_date is null;
(select parent_process_id,
child_process_id,
child_order_number
from (select *
from amw_latest_hierarchy_rl_v
where parent_approval_status = 'A'
and child_approval_status = 'A')
start with parent_process_id = -1
connect by prior child_process_id = parent_process_id)
MINUS
(select parent_process_id,
child_process_id,
child_order_number
from AMW_CURR_APP_HIERARCHY_RL_V);
(select parent_process_id,
child_process_id
from AMW_CURR_APP_HIERARCHY_RL_V
where parent_process_id = p_process_id)
MINUS
(select parent_process_id,
child_process_id
from amw_latest_hierarchy_rl_v
where parent_process_id = p_process_id);
(select parent_process_id,
child_process_id
from AMW_CURR_APP_HIERARCHY_RL_V)
MINUS
(select parent_process_id,
child_process_id
from amw_latest_hierarchy_rl_v);
(select parent_process_id,
child_process_id
from AMW_CURR_APP_HIERARCHY_RL_V
where parent_process_id is not null)
MINUS
(select parent_process_id,
child_process_id
from AMW_CURR_APP_HIERARCHY_RL_V
start with parent_process_id = -1
connect by prior child_process_id = parent_process_id);
insert into amw_approved_hierarchies(
organization_id,
parent_id,
child_id,
start_date,
child_order_number,
LAST_UPDATE_DATE,
LAST_UPDATED_BY,
LAST_UPDATE_LOGIN,
CREATION_DATE,
CREATED_BY,
object_version_number
)values(
-1,
a_link.parent_process_id,
a_link.child_process_id,
APPROV_TXN_DATE,
a_link.child_order_number,
sysdate,
G_USER_ID,
G_LOGIN_ID,
sysdate,
G_USER_ID,
1
);
update amw_approved_hierarchies
set end_date = APPROV_TXN_DATE,
object_version_number = object_version_number + 1
where organization_id = -1
and parent_id = defunct_link.parent_process_id
and child_id = defunct_link.child_process_id
and end_date is null;
update amw_approved_hierarchies
set end_date = APPROV_TXN_DATE,
object_version_number = object_version_number + 1
where organization_id = -1
and parent_id = defunct_link.parent_process_id
and child_id = defunct_link.child_process_id
and end_date is null;
insert into amw_approved_hierarchies(
organization_id,
parent_id,
child_id,
start_date,
child_order_number,
LAST_UPDATE_DATE,
LAST_UPDATED_BY,
LAST_UPDATE_LOGIN,
CREATION_DATE,
CREATED_BY,
object_version_number
)values(
-1,
a_link.parent_process_id,
a_link.child_process_id,
APPROV_TXN_DATE,
a_link.child_order_number,
sysdate,
G_USER_ID,
G_LOGIN_ID,
sysdate,
G_USER_ID,
1
);
update amw_approved_hierarchies
set end_date = APPROV_TXN_DATE
,object_version_number = object_version_number + 1
,last_update_date = sysdate
,last_updated_by = G_USER_ID
,last_update_login = G_LOGIN_ID
where organization_id = -1
and parent_id = defunct_link.parent_process_id
and child_id = defunct_link.child_process_id
and end_date is null;
update amw_approved_hierarchies
set end_date = APPROV_TXN_DATE,
object_version_number = object_version_number + 1
,last_update_date = sysdate
,last_updated_by = G_USER_ID
,last_update_login = G_LOGIN_ID
where organization_id = -1
and parent_id = defunct_link.parent_process_id
and child_id = defunct_link.child_process_id
and end_date is null;
select parent_child_id
from amw_proc_hierarchy_denorm
where process_id = pid
and up_down_ind = 'D'
and hierarchy_type = 'L'
union
select pid from dual;
select risk_id from amw_risk_associations where pk1 = pid and object_type = 'PROCESS';
select control_id from amw_control_associations where pk1 = pid and object_type = 'RISK';
select 1
into l_dummy
from amw_risks_b
where risk_id = ass_risks_rec.risk_id
and approval_status = 'A';
select 1
into l_dummy
from amw_controls_b
where control_id = ass_controls_rec.control_id
and approval_status = 'A';
select 1
into l_dummy
from amw_risks_b
where risk_id = ass_risks_rec.risk_id
and approval_status = 'A';
select 1
into l_dummy
from amw_controls_b
where control_id = ass_controls_rec.control_id
and approval_status = 'A';
select 1 --parent_child_id, a.approval_status
into l_dummy
from amw_proc_hierarchy_denorm d, amw_process a
where d.process_id = p_process_id
and up_down_ind = 'D'
and hierarchy_type = 'L'
and a.process_id = d.parent_child_id
and a.end_date is null
and a.approval_status <> 'A';
select parent_child_id
from amw_proc_hierarchy_denorm
where process_id = pid
and up_down_ind = 'D'
and hierarchy_type = 'L'
union
select pid from dual;
select a.standard_process_flag, b.process_id
into std_process, st_var_pid
from amw_process a, amw_process b
where a.process_id = process_list_rec.parent_child_id
and a.end_date is null
and b.process_rev_id = a.standard_variation;
select 1
into l_dummy
from amw_process
where process_id = st_var_pid
and approval_status = 'A';
select a.standard_process_flag, b.process_id
into std_process, st_var_pid
from amw_process a, amw_process b
where a.process_id = p_process_id
and a.end_date is null
and b.process_rev_id = a.standard_variation;
select 1
into l_dummy
from amw_process
where process_id = st_var_pid
and approval_status = 'A';
select parent_child_id
from amw_proc_hierarchy_denorm
where process_id = pid
and up_down_ind = 'D'
and hierarchy_type = 'L'
union
select pid from dual;
select standard_process_flag,standard_variation
into std_process,l_std_variation
from amw_process
where process_id = process_list_rec.parent_child_id
and end_date is null;
select parent_child_id
into l_dummy
from amw_proc_hierarchy_denorm
where process_id = process_list_rec.parent_child_id
and up_down_ind = 'D'
and hierarchy_type = 'L'
and parent_child_id not in
(select NON_STD_CHILD_ID
from AMW_NONSTANDARD_VARIATIONS_B
where NON_STD_PROCESS_ID = process_list_rec.parent_child_id
and NON_STD_PROCESS_REV_NUM = (select revision_number
from amw_process
where process_id = process_list_rec.parent_child_id
and end_date is null)
and END_DATE is null);
select NON_STD_CHILD_ID
into l_dummy
from AMW_NONSTANDARD_VARIATIONS_B
where NON_STD_PROCESS_ID = process_list_rec.parent_child_id
and NON_STD_PROCESS_REV_NUM = (select revision_number
from amw_process
where process_id = process_list_rec.parent_child_id
and end_date is null)
and END_DATE is null
and NON_STD_CHILD_ID not in
(select parent_child_id
from amw_proc_hierarchy_denorm
where process_id = process_list_rec.parent_child_id
and up_down_ind = 'D'
and hierarchy_type = 'L');
select standard_process_flag,standard_variation
into std_process,l_std_variation
from amw_process
where process_id = p_process_id
and end_date is null;
select parent_child_id
into l_dummy
from amw_proc_hierarchy_denorm
where process_id = p_process_id
and up_down_ind = 'D'
and hierarchy_type = 'L'
and parent_child_id not in
(select NON_STD_CHILD_ID
from AMW_NONSTANDARD_VARIATIONS_B
where NON_STD_PROCESS_ID = p_process_id
and NON_STD_PROCESS_REV_NUM = (select revision_number
from amw_process
where process_id = p_process_id
and end_date is null)
and END_DATE is null);
select NON_STD_CHILD_ID
into l_dummy
from AMW_NONSTANDARD_VARIATIONS_B
where NON_STD_PROCESS_ID = p_process_id
and NON_STD_PROCESS_REV_NUM = (select revision_number
from amw_process
where process_id = p_process_id
and end_date is null)
and END_DATE is null
and NON_STD_CHILD_ID not in
(select parent_child_id
from amw_proc_hierarchy_denorm
where process_id = p_process_id
and up_down_ind = 'D'
and hierarchy_type = 'L');
select parent_child_id
from amw_proc_hierarchy_denorm
where process_id = p_process_id
and up_down_ind = 'D'
and hierarchy_type = 'L';
select approval_status
into curr_app_status
from amw_process
where process_id = p_process_id
and end_date is null;
delete from amw_process_locks
where organization_id = -1
and locking_process_id = p_process_id;
update amw_process
set approval_status = 'A',
approval_date = APPROV_TXN_DATE
where process_id = p_process_id
and end_date is null
returning revision_number into rev_num;
update amw_process
set approval_end_date = APPROV_TXN_DATE
where process_id = p_process_id
and revision_number = (rev_num-1);
AMW_RL_HIERARCHY_PKG.update_org_count(p_process_id => p_process_id);
update amw_process
set approval_status = 'A',
approval_date = APPROV_TXN_DATE
where process_id = c1_rec.parent_child_id
and end_date is null
returning revision_number into rev_num;
update amw_process
set approval_end_date = APPROV_TXN_DATE
where process_id = c1_rec.parent_child_id
and revision_number = (rev_num-1);
--kosriniv ..Need to update the org count...
AMW_RL_HIERARCHY_PKG.update_org_count(p_process_id => c1_rec.parent_child_id);
amw_rl_hierarchy_pkg.update_approved_denorm(-1);
amw_rl_hierarchy_pkg.update_appr_control_counts;
amw_rl_hierarchy_pkg.update_appr_risk_counts;