Created
January 23, 2009 15:42
-
-
Save ohammersmith/51047 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DELIMITER $ | |
| drop FUNCTION if exists tFunc | |
| $ | |
| drop PROCEDURE if exists tProc | |
| $ | |
| CREATE PROCEDURE tProc() | |
| BEGIN | |
| SET @a = 'test'; | |
| SET @b = 'asdf'; | |
| -- SET @a = select id from users where user_id = 1; | |
| END; | |
| $ | |
| CREATE FUNCTION tFunc() | |
| RETURNS INT | |
| BEGIN | |
| CALL tProc(); | |
| RETURN 1; | |
| END; | |
| $ | |
| -- | |
| -- CREATE FUNCTION match_save_all() | |
| -- RETURNS INT | |
| -- BEGIN | |
| -- CALL match_save_all(); | |
| -- RETURN 1; | |
| -- END; | |
| -- $ | |
| DELIMITER ; | |
| -- SELECT match_save_all() FROM DUAL; | |
| -- SELECT tFunc() FROM DUAL; | |
| -- >> 1 | |
| -- | |
| -- SELECT @a FROM DUAL; | |
| -- >> 'test' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment