The following lines contain the word 'select', 'insert', 'update' or 'delete':
/* update the build refresh num if the plans are deleted. */
if (nvl(retcode, '0') <> '2') then
update msd_demand_plans
set dp_build_refresh_num = null,
dp_build_error_flag = null
where demand_plan_id = PlanID;
MSD_DPE.DeleteBuildDBS(errbuf, retText, ExpRetcode,
inPlan => PlanID,
Demand_Plan_Name => Demand_Plan_Name,
Shared_DB_Prefix => Shared_DB_Prefix,
Code_Location => Code_Location,
Shared_DB_Location => Shared_DB_Location,
Express_Machine_Port => Express_Machine_Port,
OWA_Virtual_Path_Name => OWA_Virtual_Path_Name,
EAD_Name => EAD_Name,
Express_Connect_String => Express_Connect_String);
MSD_DPE.DeleteWorkflow (errbuf, WfRetcode, PlanID);
-- delete all databases for this plan if no one in use
dispMesg := 'Deleting Express Demand Planning Engine databases.';
MSD_DPE.DeleteBuildDBS(errbuf, retText, ExpRetCode,
inPlan => PlanID,
Demand_Plan_Name => Demand_Plan_Name,
Shared_DB_Prefix => Shared_DB_Prefix,
Code_Location => Code_Location,
Shared_DB_Location => Shared_DB_Location,
Express_Machine_Port => Express_Machine_Port,
OWA_Virtual_Path_Name => OWA_Virtual_Path_Name,
EAD_Name => EAD_Name,
Express_Connect_String => Express_Connect_String);
MSD_DPE.DeleteWorkflow (errbuf, WfRetcode, PlanID);
-- delete all databases for this plan if no one in use
dispMesg := 'Deleting Express Demand Planning Engine databases.';
MSD_DPE.DeleteBuildDBS(errbuf, retText, ExpRetCode,
inPlan => PlanID,
Demand_Plan_Name => Demand_Plan_Name,
Shared_DB_Prefix => Shared_DB_Prefix,
Code_Location => Code_Location,
Shared_DB_Location => Shared_DB_Location,
Express_Machine_Port => Express_Machine_Port,
OWA_Virtual_Path_Name => OWA_Virtual_Path_Name,
EAD_Name => EAD_Name,
Express_Connect_String => Express_Connect_String);
MSD_DPE.DeleteWorkflow (errbuf, WfRetcode, PlanID);
MSD_DPE.DeleteBuildDBS(errbuf, retText, ExpRetcode,
inPlan => PlanID,
Demand_Plan_Name => Demand_Plan_Name,
Shared_DB_Prefix => Shared_DB_Prefix,
Code_Location => Code_Location,
Shared_DB_Location => Shared_DB_Location,
Express_Machine_Port => Express_Machine_Port,
OWA_Virtual_Path_Name => OWA_Virtual_Path_Name,
EAD_Name => EAD_Name,
Express_Connect_String => Express_Connect_String);
MSD_DPE.DeleteWorkflow (errbuf, WfRetcode, PlanID);
dispMesg := 'The demand plan databases have not been deleted.';
dispMesg := 'The demand plan was not deleted.';
dispMesg := 'The demand plan was not deleted.';
dispMesg := 'The demand plan was not deleted.';
select item_key
from WF_ITEM_ATTRIBUTE_VALUES
where item_type = itemType
and name = 'ODPPLAN'
and text_value = inPlanTXT;
PROCEDURE DeleteBuildDBS (errbuf out nocopy varchar2,
actText out nocopy varchar2,
retcode out nocopy varchar2,
inPlan in number,
Demand_Plan_Name in varchar2,
Shared_DB_Prefix in varchar2,
Code_Location in varchar2,
Shared_DB_Location in varchar2,
Express_Machine_Port in varchar2,
OWA_Virtual_Path_Name in varchar2,
EAD_Name in varchar2,
Express_Connect_String in varchar2)
IS
ActEntry varchar2(16);
SELECT C0, C1, C2
into EPSretcode, EPSRetText, EPSRetErr
from THE (SELECT CAST (EPS.query(express_server,
'DB0='|| CodeLoc || '/ODPCODE\'
|| 'DBCount=1\'
|| 'MeasureCount=3\'
|| 'Measure0=ACTIVITY.FORMULA\'
|| 'Measure1= ACTIVITY.TEXT\'
|| 'Measure2=ACTIVITY.ERROR\'
|| 'E0Count=2\'
|| 'E0Dim0Name=PLACEHOLDER\'
|| 'E0Dim1Name=ACTIVITY.ENTRY\'
|| 'E0Dim1Script=CALL WF.SETACTIVITY('''|| ActEntry || ''', '''|| inPlan ||''', '''|| DBName ||''', '''|| SharedLoc ||''', '''|| DPAdmin ||''', '''|| thisrole ||''')\'
,NULL
,NULL
,NULL
,NULL
,NULL
,NULL
,NULL
,NULL
,NULL)
AS EPS_express_list_t)
from DUAL);
end DeleteBuildDBS;
procedure DeleteWorkflow (errbuf out nocopy varchar2,
retcode out nocopy varchar2,
inPlan in number)
IS
ItemType varchar2(20);
select item_key
from WF_ITEM_ATTRIBUTE_VALUES
where item_type = itemType
and name = 'ODPPLAN'
and text_value = inPlanTXT;
errbuf:='Plan has an ACTIVE process and Workflow cannot be deleted.';
end DeleteWorkflow;
/* Wrapper to call DeleteWorkflow from Express SPL named odpwf.cleanup. */
Procedure CallDelWF(inPlan in number) is
retcode varchar2(2);
MSD_DPE.DeleteWorkflow(errbuf, retcode, inPlan);