title: A syntax error when create MySQL function
body: <pre><code>CREATE FUNCTION count(name varchar(20))
          RETURNS integer
          BEGIN
          DECLARE d_count integer;
                  select count(*) into d_count
                  from ins
                  where ins.name = name
          RETURN d_count;
          END
  </code></pre>
  
  <p>the SQL code above show there is a syntax error. </p>
  
  <pre><code>You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'RETURN (d_count); END' at line 8
  </code></pre>
  
  <p>Any ideas how to fix it?</p>