2143: END;
2144:
2145: if (l_mc_parameter_id > 0) then
2146: select action into l_mc_param_action
2147: from iem_mc_parameters where mc_parameter_id = l_mc_parameter_id;
2148: end if;
2149:
2150: -- set contact id for IH recording.
2151: l_ih_customer_id := p_customer_id;
3395: (select rt_media_item_id from iem_rt_media_items WHERE expire='Y');
3396:
3397: delete from iem_msg_parts where DELETE_FLAG = 'Y';
3398:
3399: -- Delete IEM_MC_PARAMETERS, and IEM_MC_CUSTOM_PARAM
3400: delete from IEM_MC_CUSTOM_PARAMS where MC_PARAMETER_ID in
3401: (select IEM_MC_CUSTOM_PARAMS.MC_PARAMETER_ID
3402: from IEM_MC_CUSTOM_PARAMS, iem_rt_interactions
3403: where IEM_MC_CUSTOM_PARAMS.MC_PARAMETER_ID = iem_rt_interactions.MC_PARAMETER_ID
3402: from IEM_MC_CUSTOM_PARAMS, iem_rt_interactions
3403: where IEM_MC_CUSTOM_PARAMS.MC_PARAMETER_ID = iem_rt_interactions.MC_PARAMETER_ID
3404: and iem_rt_interactions.expire = 'Y');
3405:
3406: delete from IEM_MC_PARAMETERS where MC_PARAMETER_ID in
3407: (select IEM_MC_PARAMETERS.MC_PARAMETER_ID
3408: from IEM_MC_PARAMETERS, iem_rt_interactions
3409: where IEM_MC_PARAMETERS.MC_PARAMETER_ID = iem_rt_interactions.MC_PARAMETER_ID
3410: and iem_rt_interactions.expire = 'Y');
3403: where IEM_MC_CUSTOM_PARAMS.MC_PARAMETER_ID = iem_rt_interactions.MC_PARAMETER_ID
3404: and iem_rt_interactions.expire = 'Y');
3405:
3406: delete from IEM_MC_PARAMETERS where MC_PARAMETER_ID in
3407: (select IEM_MC_PARAMETERS.MC_PARAMETER_ID
3408: from IEM_MC_PARAMETERS, iem_rt_interactions
3409: where IEM_MC_PARAMETERS.MC_PARAMETER_ID = iem_rt_interactions.MC_PARAMETER_ID
3410: and iem_rt_interactions.expire = 'Y');
3411:
3404: and iem_rt_interactions.expire = 'Y');
3405:
3406: delete from IEM_MC_PARAMETERS where MC_PARAMETER_ID in
3407: (select IEM_MC_PARAMETERS.MC_PARAMETER_ID
3408: from IEM_MC_PARAMETERS, iem_rt_interactions
3409: where IEM_MC_PARAMETERS.MC_PARAMETER_ID = iem_rt_interactions.MC_PARAMETER_ID
3410: and iem_rt_interactions.expire = 'Y');
3411:
3412: -- Delete each record from iem_rt_interactions where expire = 'Y'
3405:
3406: delete from IEM_MC_PARAMETERS where MC_PARAMETER_ID in
3407: (select IEM_MC_PARAMETERS.MC_PARAMETER_ID
3408: from IEM_MC_PARAMETERS, iem_rt_interactions
3409: where IEM_MC_PARAMETERS.MC_PARAMETER_ID = iem_rt_interactions.MC_PARAMETER_ID
3410: and iem_rt_interactions.expire = 'Y');
3411:
3412: -- Delete each record from iem_rt_interactions where expire = 'Y'
3413: delete from iem_rt_interactions where expire = 'Y';
3424: -- Delete each record from iem_agent_sessions where last_update_date is older than 30 days
3425: delete from iem_agent_sessions where SYSDATE - LAST_UPDATE_DATE > 30;
3426:
3427:
3428: -- Delete each record from IEM_MC_CUSTOM_PARAMS and IEM_MC_PARAMETERS where last_update_date is older than 30 days
3429:
3430: delete from IEM_MC_CUSTOM_PARAMS where MC_PARAMETER_ID in
3431: (select IEM_MC_CUSTOM_PARAMS.MC_PARAMETER_ID
3432: from IEM_MC_CUSTOM_PARAMS, iem_rt_interactions
3433: where IEM_MC_CUSTOM_PARAMS.MC_PARAMETER_ID = iem_rt_interactions.MC_PARAMETER_ID
3434: and iem_rt_interactions.expire='N' and iem_rt_interactions.type='O' and
3435: SYSDATE - iem_rt_interactions.LAST_UPDATE_DATE > 30);
3436:
3437: delete from IEM_MC_PARAMETERS where MC_PARAMETER_ID in
3438: (select IEM_MC_PARAMETERS.MC_PARAMETER_ID
3439: from IEM_MC_PARAMETERS, iem_rt_interactions
3440: where IEM_MC_PARAMETERS.MC_PARAMETER_ID = iem_rt_interactions.MC_PARAMETER_ID
3441: and iem_rt_interactions.expire='N' and iem_rt_interactions.type='O' and
3434: and iem_rt_interactions.expire='N' and iem_rt_interactions.type='O' and
3435: SYSDATE - iem_rt_interactions.LAST_UPDATE_DATE > 30);
3436:
3437: delete from IEM_MC_PARAMETERS where MC_PARAMETER_ID in
3438: (select IEM_MC_PARAMETERS.MC_PARAMETER_ID
3439: from IEM_MC_PARAMETERS, iem_rt_interactions
3440: where IEM_MC_PARAMETERS.MC_PARAMETER_ID = iem_rt_interactions.MC_PARAMETER_ID
3441: and iem_rt_interactions.expire='N' and iem_rt_interactions.type='O' and
3442: SYSDATE - iem_rt_interactions.LAST_UPDATE_DATE > 30);
3435: SYSDATE - iem_rt_interactions.LAST_UPDATE_DATE > 30);
3436:
3437: delete from IEM_MC_PARAMETERS where MC_PARAMETER_ID in
3438: (select IEM_MC_PARAMETERS.MC_PARAMETER_ID
3439: from IEM_MC_PARAMETERS, iem_rt_interactions
3440: where IEM_MC_PARAMETERS.MC_PARAMETER_ID = iem_rt_interactions.MC_PARAMETER_ID
3441: and iem_rt_interactions.expire='N' and iem_rt_interactions.type='O' and
3442: SYSDATE - iem_rt_interactions.LAST_UPDATE_DATE > 30);
3443:
3436:
3437: delete from IEM_MC_PARAMETERS where MC_PARAMETER_ID in
3438: (select IEM_MC_PARAMETERS.MC_PARAMETER_ID
3439: from IEM_MC_PARAMETERS, iem_rt_interactions
3440: where IEM_MC_PARAMETERS.MC_PARAMETER_ID = iem_rt_interactions.MC_PARAMETER_ID
3441: and iem_rt_interactions.expire='N' and iem_rt_interactions.type='O' and
3442: SYSDATE - iem_rt_interactions.LAST_UPDATE_DATE > 30);
3443:
3444: FOR cr_rec in del_rt_csr LOOP