一、存储过程
CREATE OR REPLACE
PROCEDURE "ACP_DEL_ACTINFO" (--删除流程信息(不包括部署信息)
vs_procInst_id in VARCHAR2,
SUCESS_FLAG OUT NUMBER,
SUCESS_MSG OUT VARCHAR2
)
AS
BUSINESS_KEY VARCHAR2(4000);
Begin
SUCESS_MSG := '查询所有待删除Exe_ID';
SELECT "TO_CHAR"(WM_CONCAT("TO_CHAR"("TO_CHAR"(BUSINESS_KEY_)))) INTO BUSINESS_KEY FROM ACT_HI_PROCINST WHERE INSTR(','||vs_procInst_id||',',','||PROC_INST_ID_||',') > 0;
DELETE FROM ACT_HI_VARINST WHERE INSTR(','||vs_procInst_id||',',','||PROC_INST_ID_||',') > 0;
DELETE FROM ACT_RU_VARIABLE WHERE INSTR(','||vs_procInst_id||',',','||PROC_INST_ID_||',') > 0;
DELETE FROM ACT_RU_IDENTITYLINK WHERE INSTR(','||vs_procInst_id||',',','||PROC_INST_ID_||',') > 0;
DELETE FROM ACT_HI_TASKINST WHERE INSTR(','||vs_procInst_id||',',','||PROC_INST_ID_||',') > 0;
DELETE FROM ACT_HI_IDENTITYLINK WHERE INSTR(','||vs_procInst_id||',',','||PROC_INST_ID_||',') > 0;
DELETE FROM ACT_HI_DETAIL WHERE INSTR(','||vs_procInst_id||',',','||PROC_INST_ID_||',') > 0;
DELETE FROM ACT_HI_COMMENT WHERE INSTR(','||vs_procInst_id||',',','||PROC_INST_ID_||',') > 0;
DELETE FROM ACT_HI_ATTACHMENT WHERE INSTR(','||vs_procInst_id||',',','||PROC_INST_ID_||',') > 0;
DELETE FROM ACT_HI_ACTINST WHERE INSTR(','||vs_procInst_id||',',','||PROC_INST_ID_||',') > 0;
DELETE FROM ACT_RU_JOB WHERE INSTR(','||vs_procInst_id||',',','||PROCESS_INSTANCE_ID_||',') > 0;
DELETE FROM ACT_RU_TASK WHERE INSTR(','||vs_procInst_id||',',','||PROC_INST_ID_||',') > 0;
DELETE FROM ACT_RU_EXECUTION WHERE INSTR(','||vs_procInst_id||',',','||PROC_INST_ID_||',') > 0;
DELETE FROM ACT_HI_PROCINST WHERE INSTR(','||vs_procInst_id||',',','||PROC_INST_ID_||',') > 0;
SUCESS_FLAG := 1;
Exception
When others then
SUCESS_FLAG := 0;
SUCESS_MSG := '存储过程发生异常,断点在:'||SUCESS_MSG||',错误信息为:'||SQLERRM;
Rollback;
End ACP_DEL_ACTINFO;
二、手工SQL
MySQL手工删除数据
SELECT DISTINCT table_name,column_name FROM information_schema.columns
WHERE column_name = 'PROC_INST_ID_';
--手工删除工作流引擎数据
delete from act_ru_execution where PROC_INST_ID_= '9c881069b3fc4ec1987748df589d9bce';
delete from act_hi_actinst where PROC_INST_ID_ = '9c881069b3fc4ec1987748df589d9bce';
delete from act_hi_attachment where PROC_INST_ID_= '9c881069b3fc4ec1987748df589d9bce';
delete from act_hi_comment where PROC_INST_ID_= '9c881069b3fc4ec1987748df589d9bce';
delete from act_hi_detail where PROC_INST_ID_= '9c881069b3fc4ec1987748df589d9bce';
delete from act_hi_identitylink where PROC_INST_ID_= '9c881069b3fc4ec1987748df589d9bce';
delete from act_hi_procinst where PROC_INST_ID_= '9c881069b3fc4ec1987748df589d9bce';
delete from act_hi_taskinst where PROC_INST_ID_= '9c881069b3fc4ec1987748df589d9bce';
delete from act_hi_varinst where PROC_INST_ID_= '9c881069b3fc4ec1987748df589d9bce';
delete from act_ru_event_subscr where PROC_INST_ID_= '9c881069b3fc4ec1987748df589d9bce';
delete from act_ru_identitylink where PROC_INST_ID_= '9c881069b3fc4ec1987748df589d9bce';
delete from act_ru_task where PROC_INST_ID_= '9c881069b3fc4ec1987748df589d9bce';
delete from act_ru_variable where PROC_INST_ID_= '9c881069b3fc4ec1987748df589d9bce';
以上办法等验证。