DBA Data[Home] [Help]

APPS.IEM_SPV_MONITORING_PVT SQL Statements

The following lines contain the word 'select', 'insert', 'update' or 'delete':

Line: 60

	select a.email_account_id, a.from_name bulk collect into l_email_account_id_tbl, l_account_name_tbl
	from iem_mstemail_accounts a, iem_agents b, jtf_rs_resource_extns c
 	where a.email_account_id=b.email_account_id and b.resource_id =  c.resource_id and c.user_id = l_current_user
 	order by UPPER(a.from_name);
Line: 68

		select Count(*) Total, nvl(max(sysdate-a.received_date)*24*60,0) wait_time,
		nvl(avg(sysdate-a.received_date)*24*60,0) average_time
		into l_queue_count, l_queue_wait_time, l_queue_average_time
 		FROM iem_rt_proc_emails a
		WHERE a.resource_id = 0 and
		a.email_account_id=l_email_account_id_tbl(l_index);
Line: 76

		select Count(*) Total, nvl(max(sysdate-a.received_date)*24*60,0) wait_time,
		nvl(avg(sysdate-a.received_date)*24*60,0) average_time
		into l_inbox_count, l_inbox_wait_time, l_inbox_average_time
 		FROM iem_rt_proc_emails a, iem_rt_media_items b
		WHERE a.resource_id <> 0 and a.message_id=b.message_id and b.expire='N' and
		a.email_account_id=l_email_account_id_tbl(l_index);
Line: 83

		select count(*) into l_agent_acct_count from iem_agents where email_account_id=l_email_account_id_tbl(l_index);
Line: 85

		select count(*) into l_total_count from iem_rt_proc_emails where email_account_id=l_email_account_id_tbl(l_index);
Line: 112

		select a.route_classification_id, a.name bulk collect into l_class_id_tbl, l_class_name_tbl
		from iem_route_classifications a, iem_account_route_class b
		where a.route_classification_id = b.route_classification_id and b.email_account_id=l_email_account_id_tbl(l_index) order by UPPER(a.name);
Line: 118

			select Count(*) Total, nvl(max(sysdate-a.received_date)*24*60,0) wait_time,
			nvl(avg(sysdate-a.received_date)*24*60,0) average_time
 			into l_queue_count, l_queue_wait_time, l_queue_average_time
 			FROM iem_rt_proc_emails a,iem_mstemail_accounts b, iem_route_classifications c
			WHERE a.email_account_id=b.email_account_id and a.rt_classification_id=c.route_classification_id
    			and a.resource_id=0 and a.email_account_id=l_email_account_id_tbl(l_index) and c.route_classification_id=l_class_id_tbl(i);
Line: 126

    			select Count(*) Total, nvl(max(sysdate-a.received_date)*24*60,0) wait_time,
			nvl(avg(sysdate-a.received_date)*24*60,0) average_time
 			into l_inbox_count, l_inbox_wait_time, l_inbox_average_time
 			FROM iem_rt_proc_emails a,iem_mstemail_accounts b, iem_route_classifications c, iem_rt_media_items d
			WHERE a.email_account_id=b.email_account_id and a.rt_classification_id=c.route_classification_id
    			and a.resource_id<>0 and a.message_id=d.message_id and d.expire='N'
    			and a.email_account_id=l_email_account_id_tbl(l_index) and c.route_classification_id=l_class_id_tbl(i);
Line: 134

    			select count(*) into l_total_count from iem_rt_proc_emails where email_account_id=l_email_account_id_tbl(l_index)
    			and rt_classification_id=l_class_id_tbl(i);
Line: 269

			select unique res.resource_id,concat(concat(res.source_last_name, ', '), res.source_first_name) as resource_name
   			bulk collect into l_resource_id_tbl, l_resource_name_tbl from fnd_user_resp_groups respgrp,
			jtf_rs_resource_extns res, fnd_responsibility resp where res.user_id=respgrp.user_id
			and respgrp.responsibility_id=resp.responsibility_id and resp.application_id=680
			and (resp.responsibility_key = 'EMAIL_CENTER_SUPERVISOR' or resp.responsibility_key = 'IEM_SA_AGENT')
 			and res.resource_id in ( select unique rel.role_resource_id from jtf_rs_role_relations rel where
           		rel.role_id in (28, 29, 30) and rel.delete_flag = 'N'
            		and rel.role_resource_type = 'RS_INDIVIDUAL'
            	--	and trunc(sysdate) between trunc(nvl(rel.start_date_active, sysdate))
      	     	--	and trunc(nvl(rel.end_date_active, sysdate))
			)
 			and res.resource_id in (select resource_id from iem_agents)
   			and (upper(res.source_last_name) like upper(p_resource_name) or upper(res.source_first_name) like upper(p_resource_name)
			or upper(res.user_name) like upper(p_resource_name))
   			order by resource_name;
Line: 285

   			select unique res.resource_id,concat(concat(res.source_last_name, ', '), res.source_first_name) as resource_name
   			bulk collect into l_resource_id_tbl, l_resource_name_tbl from fnd_user_resp_groups respgrp,
			jtf_rs_resource_extns res, fnd_responsibility resp where res.user_id=respgrp.user_id
 			and respgrp.responsibility_id=resp.responsibility_id and resp.application_id=680
 			and (resp.responsibility_key = 'EMAIL_CENTER_SUPERVISOR' or resp.responsibility_key = 'IEM_SA_AGENT')
 			and res.resource_id in ( select unique rel.role_resource_id from jtf_rs_role_relations rel where
            		rel.role_id in (28, 29, 30) and rel.delete_flag = 'N'
            		and rel.role_resource_type = 'RS_INDIVIDUAL'
            	--	and trunc(sysdate) between trunc(nvl(rel.start_date_active, sysdate))
      	     	--	and trunc(nvl(rel.end_date_active, sysdate))
			)
 			and res.resource_id in (select resource_id from iem_agents)
 			order by resource_name;
Line: 313

			select res.resource_id,concat(concat(res.source_last_name, ', '), res.source_first_name) as resource_name
   			bulk collect into l_resource_id_tbl, l_resource_name_tbl from fnd_user_resp_groups respgrp,
			jtf_rs_resource_extns res, fnd_responsibility resp where res.user_id=respgrp.user_id
			and respgrp.responsibility_id=resp.responsibility_id and resp.application_id=680
 			and resp.responsibility_key = l_resource_role
 			and res.resource_id in ( select unique rel.role_resource_id from jtf_rs_role_relations rel where
            		rel.role_id in (28, 29, 30) and rel.delete_flag = 'N'
            		and rel.role_resource_type = 'RS_INDIVIDUAL'
            		and trunc(sysdate) between trunc(nvl(rel.start_date_active, sysdate))
         		and trunc(nvl(rel.end_date_active, sysdate)) )
 			and res.resource_id in (select resource_id from iem_agents)
   			and (upper(res.source_last_name) like upper(p_resource_name) or upper(res.source_first_name) like upper(p_resource_name)
			or upper(res.user_name) like upper(p_resource_name))
   			order by resource_name;
Line: 328

   			select res.resource_id,concat(concat(res.source_last_name, ', '), res.source_first_name) as resource_name
   			bulk collect into l_resource_id_tbl, l_resource_name_tbl from fnd_user_resp_groups respgrp,
			jtf_rs_resource_extns res, fnd_responsibility resp where res.user_id=respgrp.user_id
			and respgrp.responsibility_id=resp.responsibility_id and resp.application_id=680
 			and resp.responsibility_key = l_resource_role
 			and res.resource_id in ( select unique rel.role_resource_id from jtf_rs_role_relations rel where
            		rel.role_id in (28, 29, 30) and rel.delete_flag = 'N'
            		and rel.role_resource_type = 'RS_INDIVIDUAL'
            		and trunc(sysdate) between trunc(nvl(rel.start_date_active, sysdate))
         		and trunc(nvl(rel.end_date_active, sysdate)) )
 			and res.resource_id in (select resource_id from iem_agents)
 			order by resource_name;
Line: 344

		select Count(*) Total, nvl(max(sysdate-a.received_date)*24*60,0) wait_time,
 		nvl(avg(sysdate-a.received_date)*24*60,0) average_time
 		into l_email_count, l_wait_time, l_average_time
 		FROM iem_rt_proc_emails a, iem_rt_media_items b
		WHERE a.message_id=b.message_id and b.expire='N'
		and a.resource_id = l_resource_id_tbl(l_index);
Line: 351

		select Count(*) Total into l_assigned_email_count
 		FROM iem_rt_proc_emails a, iem_rt_media_items b
		WHERE a.message_id=b.message_id and b.expire='N'
		and a.resource_id = l_resource_id_tbl(l_index) and a.email_account_id in
  		(select a.email_account_id from iem_agents a, jtf_rs_resource_extns b
  		where a.resource_id = b.resource_id and b.user_id=l_current_user);
Line: 358

  		select Count(*) Total into l_requeue_all_count
 		FROM iem_rt_proc_emails a, iem_rt_media_items b
		WHERE a.message_id=b.message_id and b.expire='N'
		and a.resource_id =  l_resource_id_tbl(l_index) and a.email_account_id in
 		(select email_account_id from iem_agents c, jtf_rs_resource_extns d
  		where c.resource_id=d.resource_id and d.user_id=l_current_user);
Line: 365

		select count(*) into l_agent_acct_count from iem_agents where resource_id=l_resource_id_tbl(l_index);
Line: 367

		select to_char(max(begin_date_time), 'MM/DD/RRRR HH24:MI:SS') into l_last_login_time
	 	from ieu_sh_sessions where application_id=680 and resource_id=l_resource_id_tbl(l_index);
Line: 388

		select a.email_account_id, a.from_name  bulk collect into l_account_id_tbl, l_account_name_tbl
		from iem_mstemail_accounts a, iem_agents b
		where a.email_account_id=b.email_account_id and b.resource_id=l_resource_id_tbl(l_index)
		order by UPPER(a.from_name);
Line: 394

			select Count(*) Total, nvl(max(sysdate-a.received_date)*24*60,0) wait_time,
 			nvl(avg(sysdate-a.received_date)*24*60,0) average_time
 			into l_email_count, l_wait_time, l_average_time
 			FROM iem_rt_proc_emails a, iem_rt_media_items b
			WHERE a.message_id=b.message_id and b.expire='N'
			and a.resource_id = l_resource_id_tbl(l_index)
			and a.email_account_id=l_account_id_tbl(i);
Line: 402

			select count(*) into l_email_count_flag from iem_agents a, jtf_rs_resource_extns b
			where a.email_account_id=l_account_id_tbl(i)
			and a.resource_id = b.resource_id and b.user_id=l_current_user;