mysql> DELIMITER //
mysql> CREATE PROCEDURE p()
BEGIN
SELECT * FROM data;
END //
mysql> DELIMITER //
mysql> CALL p()Other example
mysql> CREATE PROCEDURE p(a INT)
BEGIN
SELECT * FROM data WHERE id = a;
END //mysql> CREATE PROCEDURE p(a INT)
BEGIN
SET @add = 1;
SELECT * FROM data WHERE id = @add + a;
END //
how to call it
ReplyDelete