The following lines contain the word 'select', 'insert', 'update' or 'delete':
G_created_updated_by NUMBER:=TO_NUMBER (FND_PROFILE.VALUE('USER_ID')) ;
G_LAST_UPDATE_LOGIN NUMBER:=TO_NUMBER (FND_PROFILE.VALUE('LOGIN_ ID') ) ;
SELECT IEM_DP_ACCT_STATUS_S1.nextval
INTO l_seq_id
FROM dual;
INSERT INTO IEM_DP_ACCT_STATUS
(
DP_ACCT_STATUS_ID,
EMAIL_ACCOUNT_ID,
INBOX_MSG_COUNT,
PROCESSED_MSG_COUNT,
RETRY_MSG_COUNT,
CREATED_BY,
CREATION_DATE,
LAST_UPDATED_BY,
LAST_UPDATE_DATE,
LAST_UPDATE_LOGIN
)
VALUES
(
l_seq_id,
P_ACCT_ID,
P_INBOX_COUNT,
P_PROCESSED_COUNT,
P_RETRY_COUNT,
decode(G_created_updated_by,null,-1,G_created_updated_by),
sysdate,
decode(G_created_updated_by,null,-1,G_created_updated_by),
sysdate,
decode(G_LAST_UPDATE_LOGIN,null,-1,G_LAST_UPDATE_LOGIN)
);
select count(DP_ACCT_STATUS_ID) into l_count from IEM_DP_ACCT_STATUS where email_account_id=p_acct_id;
-- if existed, updated record
-- else create new records.
if l_count > 0 then
if p_error_flag = 0 then
IEM_DP_MONITORING_PVT.update_dp_acct_status(
p_api_version_number => P_Api_Version_Number,
p_init_msg_list => FND_API.G_FALSE,
p_commit => P_Commit,
P_acct_id => P_acct_id,
p_inbox_count => p_inbox_count,
p_processed_count => p_processed_count,
p_retry_count => p_retry_count,
x_return_status =>l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data);
update IEM_DP_ACCT_STATUS set LAST_UPDATE_DATE = sysdate where email_account_id=P_acct_id;
PROCEDURE UPDATE_DP_ACCT_STATUS (
p_api_version_number IN NUMBER,
p_init_msg_list IN VARCHAR2 := null,
p_commit IN VARCHAR2 := null,
P_acct_id IN number,
p_inbox_count IN number,
p_processed_count IN number,
p_retry_count IN number,
x_return_status OUT NOCOPY VARCHAR2,
x_msg_count OUT NOCOPY NUMBER,
x_msg_data OUT NOCOPY VARCHAR2
) is
l_api_name VARCHAR2(255):='UPDATE_DP_ACCT_STATUS';
UPDATE IEM_DP_ACCT_STATUS
set
INBOX_MSG_COUNT = P_INBOX_COUNT,
PROCESSED_MSG_COUNT = P_PROCESSED_COUNT,
RETRY_MSG_COUNT = P_RETRY_COUNT,
LAST_UPDATED_BY = decode(G_created_updated_by,null,-1,G_created_updated_by),
LAST_UPDATE_DATE = sysdate,
LAST_UPDATE_LOGIN = decode(G_created_updated_by,null,-1,G_created_updated_by)
where
EMAIL_ACCOUNT_ID = p_acct_id;
SELECT IEM_DP_PROCESS_STATUS_S1.nextval
INTO l_seq_id
FROM dual;
INSERT INTO IEM_DP_PROCESS_STATUS
(
DP_PROCESS_STATUS_ID,
PROCESS_ID,
PROCESSED_MSG_COUNT,
RETRY_MSG_COUNT,
CREATED_BY,
CREATION_DATE,
LAST_UPDATED_BY,
LAST_UPDATE_DATE,
LAST_UPDATE_LOGIN
)
VALUES
(
l_seq_id,
P_PROCESS_ID,
0,
0,
decode(G_created_updated_by,null,-1,G_created_updated_by),
sysdate,
decode(G_created_updated_by,null,-1,G_created_updated_by),
sysdate,
decode(G_LAST_UPDATE_LOGIN,null,-1,G_LAST_UPDATE_LOGIN)
);
DELETE
FROM IEM_DP_PROCESS_STATUS;
DELETE
FROM IEM_DP_LOGS;
-- Insert parameters into iem_comp_rt_stats
delete IEM_COMP_RT_STATS where type='DOWNLOAD PROCESSOR';
select a.email_account_id, a.email_address, a.active_flag, fl.meaning as account_status,
b.last_update_date as processor_status, b.last_update_date as last_run_time,
b.inbox_msg_count, b.processed_msg_count, b.retry_msg_count,
(select count(*) from iem_dp_logs where email_account_id = a.email_account_id) as log
from iem_mstemail_accounts a, iem_dp_acct_status b, fnd_lookups fl
where a.email_account_id = b.email_account_id
and a.active_flag=fl.lookup_code and fl.lookup_type='IEM_ACCOUNT_STATUS'
and a.active_flag='Y' and a.deleted_flag='N'
order by a.email_address desc;
select a.email_account_id, a.email_address, a.active_flag, fl.meaning as account_status,
b.last_update_date as processor_status, b.last_update_date as last_run_time,
b.inbox_msg_count, b.processed_msg_count, b.retry_msg_count,
(select count(*) from iem_dp_logs where email_account_id = a.email_account_id) as log
from iem_mstemail_accounts a, iem_dp_acct_status b,fnd_lookups fl
where a.email_account_id = b.email_account_id(+) and a.deleted_flag='N'
and a.active_flag<>'M'
and a.active_flag=fl.lookup_code and fl.lookup_type='IEM_ACCOUNT_STATUS'
order by a.email_address desc;
select count(*) into l_count from iem_emta_config_params
where email_account_id=v_res.email_account_id
and Account_update_flag='N'
and action_type='active';
select count(*) into l_count_error from IEM_DP_LOGS where email_account_id=v_res.email_account_id;
select count(*) into l_count from iem_emta_config_params
where email_account_id=v_res.email_account_id
and Account_update_flag='N'
and action_type='active';
select count(*) into l_count_error from IEM_DP_LOGS where email_account_id=v_res.email_account_id;
select value into l_value from iem_comp_rt_stats where type=p_type and param=p_param;