Revision: 67785
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at October 30, 2014 02:24 by jacktan
Initial Code
DELIMITER $$ DROP PROCEDURE IF EXISTS `hello` $$ CREATE PROCEDURE `hello`() SQL SECURITY DEFINER COMMENT 'Hello World!' BEGIN DECLARE str VARCHAR(50); SET str = 'ä½ å¥½ï¼'; SELECT str AS 'HELLO'; END $$ DROP PROCEDURE IF EXISTS `globalHello` $$ CREATE PROCEDURE `globalHello`(IN lang varchar(10)) COMMENT 'Say hello with multi-language' BEGIN DECLARE str VARCHAR(50); SET lang = LOWER(TRIM(lang)); CASE lang WHEN 'zh' THEN SET str = 'ä½ å¥½ï¼'; WHEN 'en' THEN SET str = 'Hello!'; ELSE SET str = '[Hello]!'; END CASE; SELECT str AS 'HELLOWORLD' ; END $$ DELIMITER ;
Initial URL
Initial Description
Before calling the PROCEDUREs you created, use `SHOW PROCEDURE status;` to confirm. To use these procedure, use the script like `CALL hello();` and `CALL globalHello('EN');`
Initial Title
A "hello world" to learn procedure
Initial Tags
Initial Language
SQL