title: MySQL procedure not working with both select and delete
body: <p>I created a procedure to get a vehicle id from the vehicle table using vehicle number input, then delete the booking record for that vehicle id, and at last to delete the entry in the vehicle table... But when creating the procedure I get an error at line 7 saying <code>Error Code: 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 '' at line 7 </code>
  Please help me to identify the issue...
  Thanks in advance</p>
  <pre><code>CREATE PROCEDURE `DeleteVehicleWithBookings`(IN vehicleNo VARCHAR(10))
  BEGIN
  
      #get vehicle id
      select @vid = vehicleID
      from vehicle
      where vehicle_no = vehicleNo;
  
      #delete booking
      delete from booking where vehicleID = vid;
      
      #delete vehicle
      delete from vehicle where vehicle_no = vehicleNo;
  END 
  DELIMITER ;
  </code></pre>