Skip to content

Instantly share code, notes, and snippets.

@ohammersmith
Created January 23, 2009 15:42
Show Gist options
  • Select an option

  • Save ohammersmith/51047 to your computer and use it in GitHub Desktop.

Select an option

Save ohammersmith/51047 to your computer and use it in GitHub Desktop.
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