Page 1 of 1

How to get TMyLoader to quote the field names?

Posted: Thu 29 Jul 2010 13:06
by skirsche
If I try to use a TMyLoader (5.90.0.58) to fill a table that contains a column called "Select" it raises an EMyError like this one:

#42000You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Select, Text1, Text2) VALUES (NULL, '1', '1', 'abc1', 'abc2', 'abc3'' at line 1'

There is TMyQuery.Options.QuoteNames, but how do I tell a TMyLoader to quote the field names when generating SQL?

Posted: Thu 29 Jul 2010 14:28
by Dimon
To solve the problem you should quote the column name for appropriate field using the TLoader.Columns property.

Code: Select all

  MyLoader.Columns.Items[1].Name := '`SELECT`';