title: Error Code: 1305 MySQL, Function does not Exist
body: <p>I have a problem. I created a function in MySQL which returns a String (varchar data type).</p>
  
  <p>Here's the syntax:</p>
  
  <pre><code>DELIMITER $$
  USE `inv_sbmanis`$$
  DROP FUNCTION IF EXISTS `SafetyStockChecker`$$
  
  CREATE DEFINER=`root`@`localhost` FUNCTION `SafetyStockChecker`
  (jumlah INT, safetystock INT)   
  RETURNS VARCHAR(10) CHARSET latin1
  BEGIN
  DECLARE statbarang VARCHAR(10);
  IF jumlah &gt; safetystock THEN SET statbarang = "Stabil";
  ELSEIF jumlah = safetystock THEN SET statbarang = "Perhatian";
  ELSE SET statbarang = "Kritis";
  END IF;
  RETURN (statbarang);
  END$$
  DELIMITER ;
  </code></pre>
  
  <p>When I call the function like <code>call SafetyStockChecker(16,16)</code>, I get this error:</p>
  
  <blockquote>
    <p>Query : call SafetyStockChecker(16,16)<br>
        Error Code : 1305<br>
        PROCEDURE inv_sbmanis.SafetyStockChecker does not exist<br>
        Execution Time : 00:00:00:000<br>
        Transfer Time  : 00:00:00:000<br>
        Total Time     : 00:00:00:000  </p>
  </blockquote>
  
  <p>What's wrong with the function?</p>