-2

I want to insert data in one table and one of my column Name is abc_data.(here dot).

I wrote

 insert into tablename (abc_data. , data1) 
 values (@abc, @def);

and I get an error:

Error: Incorrect Syntax near ','

I am suspecting the error to be in abc_data.(here dot) here in column name.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • remove the dot after abc_data – ScaisEdge Dec 10 '19 at 07:16
  • Read this https://dev.mysql.com/doc/refman/8.0/en/identifiers.html enclose column name in back ticks OR change column name to valid identifier which would not need backticks (remove .) – P.Salmon Dec 10 '19 at 07:16

1 Answers1

1

You should avoid dot in columns name because the dot is used as oject name saparator in fully qualified name

insert into tablename(abc_data , data1) values(@abc,@def); 

anyway if you have a column name with dot then in mysql use backtics for avoid this error

insert into tablename(`abc_data.` , data1) values(@abc,@def); 
ScaisEdge
  • 131,976
  • 10
  • 91
  • 107