apzl_leasing/src_sql/procedure/proc_delete_XuanZeDuiHuaKuang.sql

19 lines
765 B
SQL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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