title: MySQL DECLARE/SELECT INTO Syntax error?
body: <p>I honestly have no idea what I'm doing wrong here.</p>
  
  <pre><code>Routine Name: procInsertName
  Type: PROCEDURE
  Parameters: IN Name VARCHAR 30 Charset
  
  DECLARE tempNameID INT;
  
  SELECT nameID
  INTO tempNameID
  FROM name
  WHERE value = @Name;
  
  IF tempNameID IS NULL THEN
  
      INSERT INTO name (value)
      VALUES (@Name);
  
  END IF;
  
  Is deterministic: unchecked
  Definer: &lt;blank&gt;
  Security type: DEFINER
  SQL data access: CONTAINS SQL
  Comment: &lt;blank&gt;
  </code></pre>
  
  <p>I'm coming out with an error of:</p>
  
  <pre><code>One or more errors have occurred while processing your request:
  
  The following query has failed: "CREATE PROCEDURE `procInsertName`(IN `Name` VARCHAR(30)) NOT DETERMINISTIC CONTAINS SQL SQL SECURITY DEFINER DECLARE   tempNameID INT;
  
  SELECT  nameID
  INTO    tempNameID
  FROM    name
  WHERE   value = @Name;
  
  IF tempNameID IS NULL THEN
  
      INSERT INTO name (value)
      VALUES (@Name);
  
  END IF;"
  
  MySQL said: #1064 - 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 'DECLARE  tempNameID INT;
  
  SELECT  nameID
  INTO    tempNameID
  FROM    name
  WHERE   valu' at line 1
  </code></pre>
  
  <p>Any help would be appreciated, I've spent the last 30 minutes looking around online and can't find anything. Thanks.</p>