What is wrong with this SQL statement

Error:

You have an error in the SQL syntax; check the manual that matches your MySQL server version for the correct syntax to use next to "RA --- SIN", "DEC - SIN", 0.0, -90.0) "on line 1

INSERT INTO files_table (filename, folder, survey, telescope, author, observer, equinox, ctype1, ctype2, crval1, crval2) VALUES('H001_abcde_luther_chop.fits', 'C:\dev\data\FITS\surveys\', '', '','', -1.0, 'RA---SIN', 'DEC--SIN', 0.0,-90.0)

The statement that created the table was (line breaks just for readability)

 create table files_table (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, 
 filename varchar(255), folder varchar(255), survey varchar(255), telescope varchar(255), 
 author varchar(255), observer varchar(255), equinox double, ctype1 varchar(255), ctype2
 varchar(255), crval1 double, crval2 double);
  • This is because I use "instead" - it did not bother me before
  • This is due to - in RA --- SIN and DEC - SIN
+3
source share
3 answers

I think this is because you lack value

You have 11 columns with names and a total of 10 values

+6
source

- . (, \\), .

+12

This is because you are trying to insert RA-SIN into the equinox column, which is of type double.

I believe that you are missing, '' so the request will work as follows:

INSERT INTO files_table (file name, folder, survey, telescope, author, observer, equinox, ctype1, ctype2, crval1, crval2) VALUES ('H001_abcde_luther_chop.fits',' C: \ dev \ data \ FITS \ survey \ ',' ',' ',' ',' '-1.0,' RA --- SIN ',' DEC - SIN ', 0.0, -90.0)

0
source

Source: https://habr.com/ru/post/1746195/


All Articles