MySQL Error 1064

0

In the insert below I get the following error.

INSERT INTO dump1090 ('hex','squawk','flight','lat','lon','validposition','altitude','vert_rate','track','validtrack','speed','messages','seen') VALUES ('e4827e','3670','TAM3754 ','-22.850818','-43.070628','1','10350','3328','8','1','219','162','161')
  

1064 - You have a syntax error in your SQL next to 'hex', 'squawk', 'flight', 'lat', 'lon', 'validposition', 'altitude', 'vert_rate' trac 'on line 1 *

    
asked by anonymous 28.11.2018 / 17:30

1 answer

3

You should not use quotation marks to enter the column names, just to enter non-numeric values.

Your insert should look like this:

INSERT INTO dump1090 (hex,squawk,flight,lat,lon,validposition,altitude,
   vert_rate,track,validtrack,speed,messages,seen) 
VALUES ('e4827e',3670,'TAM3754 ',-22.850818,-43.070628,1,10350,3328,8,1,219,162,161)

In fact, numeric values may be enclosed in quotation marks, or not, that the database handles this, but alphanumeric values must be enclosed in quotation marks.

    
28.11.2018 / 17:42