mysql> set @foo="Camping"; Query OK, 0 rows affected (0.00 sec) mysql> select * from SKU_DATA where Department=@foo;
CREATE PROCEDURE simple() SELECT * from SKU_DATA;
SELECT pi(); CREATE PROCEDURE pi() SELECT 3.14159; CALL pi(); delimiter # CREATE FUNCTION pi() RETURNS INTEGER BEGIN RETURN 3; END; # delimiter ;
CREATE PROCEDURE params(IN a INTEGER, OUT b INTEGER, INOUT c INTEGER) BEGIN SELECT a, b,c; SET a = 1; SET b = 2; SET c = 3; SELECT a,b,c; END; #