首页 > 代码库 > 创建存储过程
创建存储过程
使用Dbvisualizer 创建存储过程会报错,一般要在存储过程之前加上--/,之后加上/。
--/
CREATE DEFINER=`richmail`@`%` PROCEDURE `cloudp`.`DELETE_CORPORATION_FOR_CLOUDP`(IN p_corpId INT UNSIGNED)
BEGIN
DELETE FROM cloudp.cloudp_file_0 WHERE corp_id = p_corpId;
DELETE FROM cloudp.cloudp_file_1 WHERE corp_id = p_corpId;
DELETE FROM cloudp.cloudp_file_2 WHERE corp_id = p_corpId;
DELETE FROM cloudp.cloudp_file_3 WHERE corp_id = p_corpId;
DELETE FROM cloudp.cloudp_file_4 WHERE corp_id = p_corpId;
DELETE FROM cloudp.cloudp_file_5 WHERE corp_id = p_corpId;
DELETE FROM cloudp.cloudp_file_6 WHERE corp_id = p_corpId;
DELETE FROM cloudp.cloudp_file_7 WHERE corp_id = p_corpId;
DELETE FROM cloudp.cloudp_file_8 WHERE corp_id = p_corpId;
DELETE FROM cloudp.cloudp_file_9 WHERE corp_id = p_corpId;
DELETE FROM cloudp.cloudp_file_appeal WHERE cloudp_file_appeal.corp_id = p_corpId;
DELETE FROM cloudp.cloudp_file_md5 WHERE cloudp_file_md5.bucket_name =
(SELECT B.bucket_name FROM cloudp.cloudp_admin_corporation_info A INNER JOIN cmail.web_corp_exp B ON A.corp_id = B.corp_id
WHERE A.corp_id = p_corpId);
DELETE FROM cloudp.cloudp_admin_corporation_info WHERE corp_id = p_corpId;
DELETE FROM cmail.web_corp_exp WHERE web_corp_exp.corp_id = p_corpId;
END
/
创建存储过程