标签:limit 函数 oba rac from mat begin show set
DELIMITER $$
DROP PROCEDURE IF EXISTS `sp_test1`;
CREATE PROCEDURE sp_test1(IN a int, IN b int, OUT sum int )
BEGIN
DECLARE c int;
if a is null then set a = 0;
end if;
if b is null then set b = 0;
end if;
set sum = a + b;
END; $$
DELIMITER ;
SHOW PROCEDURE | FUNCTION STATUS LIKE ‘%sp%‘;
SHOW PROCEDURE STATUS WHERE Db = ‘testdb‘;
SHOW CREATE PROCEDURE `usp_test1` \G;
SELECT * FROM information_schema.ROUTINES WHERE ROUTINE_SCHEMA=‘testdb‘ \G;
使用ALTER语句可以修改存储过程或函数的特性,只能修改特性,如果想修改过程体只能删除存储过程再重新创建。
ALTER {PROCEDURE|FUNCTION} sp_name [characteriss]
DROP {PROCEDURE|FUNCTION} [IF EXISTS] sp_name
SET GLOBAL log_bin_trust_function_creators = 1;
DELIMITER $$
DROP FUNCTION IF EXISTS `ufn_test2`;
CREATE FUNCTION ufn_test2()
RETURNS VARCHAR(100)
BEGIN
RETURN(SELECT 1);
END $$
DELIMITER ;
SET GLOBAL log_bin_trust_function_creators = 0;
标签:limit 函数 oba rac from mat begin show set
原文地址:https://www.cnblogs.com/fishparadise/p/9180757.html