create procedure proc_delete_XianShiMoMan(IN indono varchar(200))
BEGIN
DECLARE result_code INTEGER DEFAULT 0; -- 定义返回结果并赋初值0
DECLARE AWE_DO_CATALOG_number INTEGER DEFAULT 0; -- 定义返回结果并赋初值0
DECLARE awe_do_library_number INTEGER DEFAULT 0; -- 定义返回结果并赋初值0
DECLARE AWE_DO_Group_number INTEGER DEFAULT 0; -- 定义返回结果并赋初值0
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET result_code=1; -- 在执行过程中出任何异常设置result_code为1
--  删除显示模板
select sum(1) a into AWE_DO_CATALOG_number from AWE_DO_CATALOG where dono=indono;
DELETE FROM AWE_DO_CATALOG where dono=indono;
select sum(1) into awe_do_library_number from awe_do_library where dono=indono;
DELETE FROM awe_do_library WHERE dono=indono;
select sum(1) into AWE_DO_Group_number from AWE_DO_Group where dono=indono;
DELETE FROM AWE_DO_Group WHERE dono=indono;
    
IF result_code = 1 THEN -- 可以根据不同的业务逻辑错误返回不同的result_code，这里只定义了1和0
         ROLLBACK; 
     ELSE 
         COMMIT; 
     END IF;
 SELECT result_code,AWE_DO_CATALOG_number,awe_do_library_number,AWE_DO_Group_number;    
    
 END;

