Created
January 11, 2015 12:08
-
-
Save roniemicro/bc05a27f29524a695bd8 to your computer and use it in GitHub Desktop.
Example block for creating function in MySql
This file contains 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
CREATE FUNCTION func01(value1 INT , monto DECIMAL (10,2)) | |
RETURNS DECIMAL(10,2) | |
DETERMINISTIC | |
BEGIN | |
DECLARE var_name DECIMAL(10,2); | |
SET var_name = 0; | |
SELECT if(value1 = 1,monto *divisa_dolar,monto *divisa_euro) INTO var_name | |
FROM table | |
WHERE data_init = 1; | |
RETURN var_name; | |
END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment