mysql> mysql> delimiter $$ mysql> mysql> CREATE PROCEDURE myProc() -> BEGIN -> -> IF (INSTR(version(),'alpha')>0) THEN -> SELECT 'Alpha release of MySQL'; -> ELSEIF (INSTR(version(),'beta')>0) THEN -> SELECT 'Beta release of MySQL'; -> ELSE -> SELECT 'Production release of MySQL'; -> END IF; -> -> -> END$$ Query OK, 0 rows affected (0.00 sec)
mysql> mysql> delimiter ; mysql> mysql> call myProc(); +-----------------------------+ | Production release of MySQL | +-----------------------------+ | Production release of MySQL | +-----------------------------+ 1 row in set (0.00 sec)