The following lines contain the word 'select', 'insert', 'update' or 'delete':
select b.guid,A.status,b.status
from
wf_events a, wf_event_subscriptions b
where a.GUID = b.EVENT_FILTER_GUID
and a.name = p_event
and b.RULE_FUNCTION='EDR_PSIG_RULE.PSIG_RULE'
--Bug No 4912782- Start
and b.source_type = 'LOCAL'
and b.system_guid = hextoraw(wf_core.translate('WF_SYSTEM_GUID')) ;
select count(*) INTO l_no_enabled_eres_sub
from
wf_events a, wf_event_subscriptions b
where a.GUID = b.EVENT_FILTER_GUID
and a.name = p_event
and b.RULE_FUNCTION='EDR_PSIG_RULE.PSIG_RULE'
and b.STATUS = 'ENABLED'
--Bug No 4912782- Start
and b.source_type = 'LOCAL'
and b.system_guid = hextoraw(wf_core.translate('WF_SYSTEM_GUID')) ;
select count(*) INTO l_no_enabled_eres_sub
from
wf_events a, wf_event_subscriptions b
where a.GUID = b.EVENT_FILTER_GUID
and a.name = p_event
and b.RULE_FUNCTION='EDR_PSIG_RULE.PSIG_RULE'
--Bug No 4912782- Start
and b.source_type = 'LOCAL'
and b.system_guid = hextoraw(wf_core.translate('WF_SYSTEM_GUID')) ;
/* AME Processing, Select APPLICATION_ID of the Event. */
/* Required by AME. Assumption made here is OWNER_TAG will always be set to application Short Name*/
BEGIN
SELECT application_id,APPLICATION_SHORT_NAME into l_application_id,l_application_code
FROM FND_APPLICATION
WHERE APPLICATION_SHORT_NAME in
(SELECT OWNER_TAG from WF_EVENTS WHERE NAME=evt.getEventName( ));
select application_name into l_application_name
from ame_Calling_Apps
where FND_APPLICATION_ID=l_application_id
and TRANSACTION_TYPE_ID=NVL(l_ame_transaction_type,evt.getEventName( ))
--Bug 4652277: Start
--and end_Date is null;
DELETE EDR_ERECORDS where ERECORD_SIGNATURE_STATUS not in ('PENDING');
DELETE EDR_ESIGNATURES where EVENT_ID not in (SELECT EVENT_ID from EDR_ERECORDS);
DELETE EDR_REDLINE_TRANS_DATA where EVENT_ID not in (SELECT EVENT_ID from EDR_ERECORDS);
DELETE EDR_TRANS_QUERY_TEMP;
DELETE FROM EDR_ERESPARAMETERS_T
WHERE PARENT_TYPE = 'EDR_XDOC_PARAMS';
EDR_ERES_EVENT_PVT.DELETE_ERECORDS();
DELETE FROM EDR_PREPARE_DOCUMENT_TEMP WHERE REQUEST_ID IN
(SELECT REQUEST_ID FROM EDR_COLLATE_PRINT_TEMP
WHERE CREATION_DATE < (SYSDATE - 2) );
DELETE FROM EDR_COLLATE_PRINT_TEMP where CREATION_DATE < (SYSDATE - 2);
select SIGNATURE_SEQUENCE,USER_NAME,
B.MEANING SIGNATURE_STATUS,
SIGNATURE_TIMESTAMP,
C.MEANING SIGNATURE_TYPE,
(SELECT D.MEANING FROM WF_LOOKUPS D WHERE D.LOOKUP_CODE=A.SIGNATURE_REASON_CODE AND
D.LOOKUP_TYPE='SIGNING_REASON_CODES') SIGNATURE_REASON_CODE,
SIGNER_COMMENTS,
--Bug 4113995: Start
--Including overriding comments in the cursor.
SIGNATURE_OVERRIDING_COMMENTS
--Bug 4113995: End
from EDR_ESIGNATURES A,
FND_LOOKUPS B,
WF_LOOKUPS C
WHERE EVENT_ID=to_number(document_id,'999999999999.999999' ) AND
A.SIGNATURE_STATUS=B.LOOKUP_CODE AND
B.LOOKUP_TYPE='EDR_PSIG_ESIGNATURE' AND
C.LOOKUP_CODE=A.SIGNATURE_TYPE AND
C.LOOKUP_TYPE='PSIG_ESIGN_SIGNER_LOOKUP'
--Bug 4272262: Start
--Convert signature sequence to a number value before performing the
--order by operation.
order by to_number(SIGNATURE_SEQUENCE,'999999999999.999999') desc;
last_update_date out nocopy date,
last_updated_by out nocopy number,
last_update_login out nocopy number)
is
begin
creation_date := sysdate;
last_update_date := sysdate;
last_updated_by := fnd_global.user_id();
last_update_login := fnd_global.login_id();
cursor GET_AMEGROUP is select approval_group_id, name
from AME_APPROVAL_GROUPS
where upper(name) like p_groupname
and end_date is null;
SELECT DISPLAY_NAME
from
wf_events_vl
WHERE NAME= P_EVENT;
select user_display_name into l_displayname from edr_psig_details where
signature_id=p_signature_id;
select event_xml into l_event_xml
from EDR_FINAL_XML_GT
where event_name = p_event_name
and event_key = p_event_key;
select count(*) into l_count from edr_final_xml_gt
where event_name = p_event_name
and event_key = p_document_id;
update edr_final_xml_gt
set event_xml = X_XML_PAYLOAD
where event_name = p_event_name
and event_key = p_document_id;
insert into edr_final_xml_gt
(event_name, event_key, event_xml)
values
(p_event_name, p_document_id, X_xml_PAYLOAD);
select count(*) into L_count_Value
from EDR_RAW_XML_T
where event_name = p_transaction_name
and event_key = p_transaction_key;
update EDR_RAW_XML_T set RAW_XML = P_RAW_XML,
LAST_UPDATED_BY = FND_GLOBAL.USER_ID,
LAST_UPDATE_LOGIN = FND_GLOBAL.LOGIN_ID,
LAST_UPDATE_DATE = sysdate
where event_name = p_transaction_name
and event_key = p_transaction_key;
insert into EDR_RAW_XML_T(EVENT_NAME,
EVENT_KEY,
RAW_XML,
CREATED_BY,
CREATION_DATE,
LAST_UPDATED_BY,
LAST_UPDATE_LOGIN,
LAST_UPDATE_DATE
)
values ( p_transaction_name,
p_transaction_key,
p_raw_xml,
FND_GLOBAL.USER_ID,
sysdate,
FND_GLOBAL.USER_ID,
FND_GLOBAL.LOGIN_ID,
sysdate
);
select b.guid,A.status,b.status
from
wf_events a, wf_event_subscriptions b
where a.GUID = b.EVENT_FILTER_GUID
and a.name = p_event_name
and b.RULE_FUNCTION='EDR_PSIG_RULE.PSIG_RULE'
-- bug 5586151 : start
-- and b.STATUS = 'ENABLED'
-- bug 5586151 : End
--Bug No 4912782- Start
and b.source_type = 'LOCAL'
and b.system_guid = hextoraw(wf_core.translate('WF_SYSTEM_GUID')) ;
select count(*) INTO l_no_enabled_eres_sub
from wf_events a, wf_event_subscriptions b
where a.GUID = b.EVENT_FILTER_GUID
and a.name = p_event_name
and b.RULE_FUNCTION='EDR_PSIG_RULE.PSIG_RULE'
and b.STATUS = 'ENABLED'
--Bug No 4912782- Start
and b.source_type = 'LOCAL'
and b.system_guid = hextoraw(wf_core.translate('WF_SYSTEM_GUID')) ;
SELECT application_id,APPLICATION_SHORT_NAME into l_application_id,
l_application_code
FROM FND_APPLICATION
WHERE APPLICATION_SHORT_NAME in
(SELECT OWNER_TAG from WF_EVENTS
WHERE NAME=evt.getEventName( ));
select application_name into l_application_name
from ame_Calling_Apps
where FND_APPLICATION_ID=l_application_id
and TRANSACTION_TYPE_ID=NVL(l_ame_transaction_type,evt.getEventName( ))
--Bug 4652277: Start
--and end_Date is null;
l_ruleids.delete;
l_rulenames.delete;
X_VARIABLE_NAMES.delete;
X_VARIABLE_VALUES.delete;
X_VARIABLE_NAMES.delete;
X_VARIABLE_VALUES.delete;
X_VARIABLE_NAMES.delete;
X_VARIABLE_VALUES.delete;
l_temp_rule_names.delete;
l_temp_rule_values.delete;
select test_scenario_id, test_scenario, test_scenario_instance
into l_test_scenario_id, l_test_scenario, l_test_scenario_instance
from edr_inter_event_test_scenarios
where test_scenario_id = p_test_scenario_id;
SELECT PARENT_ERECORD_ID
from
EDR_EVENT_RELATIONSHIP
WHERE CHILD_ERECORD_ID= P_ERECORD_ID;
insert into EDR_PROCESS_ERECORDS_T(ERECORD_SEQUENCE_ID,
PAYLOAD,
CREATED_BY,
CREATION_DATE,
LAST_UPDATED_BY,
LAST_UPDATE_DATE)
values(P_XML_CLOB_ID,
l_event_xml,
fnd_global.user_id,
sysdate,
fnd_global.user_id,
sysdate);
select count(*) into l_count from wf_roles
where name = l_approving_users
and status = 'ACTIVE'
and (orig_system = 'PER' or ORIG_SYSTEM = 'FND_USR');
select count(*) into l_count from wf_roles
where name = l_approving_users
and status = 'ACTIVE'
and orig_system = 'FND_RESP';
select count(*) into l_count from wf_roles
where name = l_current_approving_user
and status = 'ACTIVE'
and (orig_system = 'PER' or orig_system = 'FND_USR');
select count(*) into l_count from wf_roles
where name = l_current_approving_user
and status = 'ACTIVE'
and orig_system = 'FND_RESP';