Академический Документы
Профессиональный Документы
Культура Документы
declare
cursor getApplications is
select application_id,application_name
from apps.ame_calling_apps aca
where sysdate < nvl(aca.end_date-(1/86400),sysdate+1);
cursor checkConfigVars(appId in number) is
select 'Transaction Type' configType,variable_name
from apps.AME_CONFIG_VARS
where application_id = appId
and sysdate < nvl(end_date,sysdate + 1)
and variable_name in ('allowAllApproverTypes','allowAllItemClassRules','a
llowFyiNotifications','productionFunctionality')
and variable_value not in ('no','none')
union
select 'Default',variable_name
from apps.AME_CONFIG_VARS
where nvl(application_id, 0) = 0
and sysdate < nvl(end_date,sysdate + 1)
and variable_name in ('allowAllApproverTypes','allowAllItemClassRules','a
llowFyiNotifications','productionFunctionality')
and variable_value not in ('no','none')
and not exists (select null from apps.AME_CONFIG_VARS B
where application_id = appId
and sysdate < nvl(B.end_date,sysdate + 1)
and variable_name = B.variable_name);
cursor checkActionTypesVR(appId in number) is
select name
from apps.AME_ACTION_TYPE_CONFIG atc
,apps.AME_ACTION_TYPES atyp
where application_id = appId
and voting_regime <> 'S'
and sysdate between atc.start_date and nvl(atc.end_date,sysdate + 1)
and sysdate between atyp.start_date and nvl(atyp.end_date,sysdate + 1)
and atc.action_type_id = atyp.action_type_id;
cursor checkActionTypesON(appId in number) is
select name
from apps.AME_ACTION_TYPE_CONFIG atc
,apps.AME_ACTION_TYPES atyp
,apps.AME_ACTION_TYPE_USAGES atu
where application_id = appId
and sysdate between atu.start_date and nvl(atu.end_date,sysdate + 1)
and sysdate between atc.start_date and nvl(atc.end_date,sysdate + 1)
and sysdate between atyp.start_date and nvl(atyp.end_date,sysdate + 1)
and atc.action_type_id = atyp.action_type_id
and atu.action_type_id = atyp.action_type_id
and (atu.rule_type, atc.order_number) in (select rule_type,order_numbe
r
from apps.ame_action_type_
config B,apps.ame_action_type_usages C
where B.action_type_id = C.
action_type_id
and application_id = appI
d
and sysdate between C.sta