1988: and wiav.item_type = wias.item_type
1989: and wiav.name = 'SESSION_ID'
1990: and not exists
1991: (select 1
1992: from icx_sessions s
1993: where s.session_id = wiav.number_value
1994: and s.disabled_flag = 'N');
1995: */
1996:
2079: -- 4287117
2080: --5076290
2081: CURSOR defunct_wf_ids (c_transaction_age in number) IS
2082: select wi.item_key
2083: from wf_items wi , wf_item_attribute_values av, icx_sessions s
2084: where wi.item_type= itemtype
2085: and trunc(wi.begin_date) <= trunc(sysdate) --fix for bug 6642996
2086: and wi.end_date is null
2087: and av.item_type = wi.item_type
2128: and wi.item_key = ts.item_key
2129: and ts.item_type is not null
2130: and ts.item_key is not null
2131: )
2132: and exists (select 'e' from wf_item_attribute_values av, icx_sessions s
2133: where av.item_type = wi.item_type
2134: and av.item_key = wi.item_key
2135: and av.name = 'SESSION_ID'
2136: and av.number_value = s.session_id(+)