title: "DECLARE" is not valid at this position for this server version, expecting: ERROR
body: <p>I tried every way possible to put the "DECLARE" in my procedural SQL query (Using MySQL Workbench) and its showing:</p>
  
  <blockquote>
    <p>"DECLARE" is not valid at this position for this server version, expecting: ERROR.</p>
  </blockquote>
  
  <p>Now I need help.</p>
  
  <pre><code>DELIMITER //
  
  CREATE PROCEDURE getdetails()
  BEGIN 
      DECLARE 
          vin table.vin%type; 
          responsetime table.responseTimeStamp%type;
          odometer table.odometer%type;
          chargePercentage table.soc%type;
          CURSOR sequential_vehicle_status is
                  SELECT vin, responseTimeStamp, odometer, soc FROM table ORDER BY vin, responseTimeStamp;
      OPEN sequential_vehicle_status;
      LOOP
      FETCH sequential_vehicle_status into vin, responseTimeStamp, odometer, chargePercentage;
          EXIT WHEN sequential_vehicle_status%notfound;
          dbms_output.put_line(vin || " * " || responseTimeStamp || " * " || odometer || " * " || chargePercentage || "% " ||);
      END LOOP;
      CLOSE sequential_vehicle_status;
  END //
  
  DELIMITER ;
  </code></pre>