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

apache - Remove .php and add trailing slash in url using htaccess not loading css -

inno setup - TLabel or TNewStaticText - change .Font.Style on Focus like Cursor changes with .Cursor -