[Home] [Help]
2762: if x.exists(1) then
2763: forall ctr in x.first .. x.last
2764: update amw_process
2765: set risk_count = (select count(*) from (
2766: select distinct risk_id from amw_risk_associations
2767: where pk1 in ( ( select parent_child_id
2768: from amw_proc_hierarchy_denorm
2769: where process_id = x(ctr)
2770: and up_down_ind = 'D'
2881: if x.exists(1) then
2882: forall ctr in x.first .. x.last
2883: update amw_process
2884: set risk_count = (select count(*) from (
2885: select distinct risk_id from amw_risk_associations
2886: where pk1 in ( ( select parent_child_id
2887: from amw_proc_hierarchy_denorm
2888: where process_id = x(ctr)
2889: and up_down_ind = 'D'
3043: if x.exists(1) then
3044: forall ctr in x.first .. x.last
3045: update amw_process
3046: set risk_count_latest = (select count(*) from (
3047: select distinct risk_id from amw_risk_associations
3048: where pk1 in ( (select parent_child_id
3049: from amw_proc_hierarchy_denorm
3050: where process_id = x(ctr)
3051: and up_down_ind = 'D'
3133: forall ctr in x.first .. x.last
3134: update amw_process
3135: set risk_count_latest = (select count(*) from (
3136: select distinct risk_id
3137: from amw_risk_associations
3138: where pk1 in ((select parent_child_id
3139: from amw_proc_hierarchy_denorm
3140: where process_id = x(ctr)
3141: and up_down_ind = 'D'
3176: forall ctr in x.first .. x.last
3177: update amw_process
3178: set risk_count_latest = (select count(*) from (
3179: select distinct risk_id
3180: from amw_risk_associations
3181: where pk1 in ((select parent_child_id
3182: from amw_proc_hierarchy_denorm
3183: where process_id = x(ctr)
3184: and up_down_ind = 'D'
3892: end if;
3893:
3894: -- perform other common delete operations
3895:
3896: delete from amw_risk_associations
3897: where pk1 = p_process_id
3898: and approval_date is null
3899: and object_type = 'PROCESS';
3900: --ko we need to update the latest risk & controls counts..
3901: IF SQL%FOUND THEN
3902: l_risk_exists := TRUE;
3903: END IF;
3904:
3905: update amw_risk_associations
3906: set deletion_date = null
3907: where pk1 = p_process_id
3908: and object_type = 'PROCESS'
3909: and deletion_date is not null