phpmyadmin: create a function

前端 未结 1 1526
暗喜
暗喜 2021-02-06 14:57

i\'m trying to create a function in my phpmyadmin - doesnt work .. :/ here\'s my syntax:

DELIMITER $$

CREATE FUNCTION fixString(input varchar) RETURNS varchar
B         


        
相关标签:
1条回答
  • 2021-02-06 15:31

    You're using VARCHAR, so you have to indicate a max size:

    DELIMITER $$
    
    CREATE FUNCTION fixString(input varchar(15)) RETURNS varchar(15)
    BEGIN
      declare output varchar(15);
      SET output = REPLACE(input,'ö','oe');
      RETURN output;
    END $$
    
    DELIMITER ;
    
    0 讨论(0)
提交回复
热议问题