title: Maria Db making function using if statement
body: <p>I'm working on EnitityFrameWork and trying to use Database Function. I am not familiar with making function with Database . This is What I made. The error says syntax error " for line 16 which is "RETURN x" </p>
  
  <pre><code>delimiter //
  CREATE FUNCTION CREATE_TIME4(hour1 int, minute1 INT, second1 INT) 
  RETURNS VARCHAR(50)
  BEGIN
      DECLARE x VARCHAR(50);
      DECLARE H VARCHAR(10);
      DECLARE M VARCHAR(10);
      DECLARE S VARCHAR(10);
      IF LENGTH(YEA) &lt; 2 THEN 
          SET H = '0' + CONCAT(hour1);
      IF LENGTH(MON) &lt; 2 THEN 
          SET M = '0' + CONCAT(minute1);
      IF LENGTH(SEC) &lt; 2 THEN 
          SET S = '0' + CONCAT(second1); 
      SET x = CONCAT(H,':', M,':', S);
      RETURN x;
  END// 
  </code></pre>