sql - Create a simple function in mysql -


i want create , test function named f_add20 accepts 1 integer parameter. function adds 20 , returns result integer.

here code have created far..i have been troubleshooting hour. know simple. appreciated.

 delimiter $  create function f_add20 (num int) returns int  begin  declare final int; select num final + 20 dual; return final;  end $  delimiter;   /*use function created above*/  select f_add20(3) dual; 

change select num final + 20 select num + 20 final.


Comments

Popular posts from this blog

hibernate - How to load global settings frequently used in application in Java -

objective c - Ownership modifiers with manual reference counting -

python 3.x - Mapping specific letters onto a list of words -